------- Comment #2 from rguenth at gcc dot gnu dot org  2007-04-09 19:21 -------
struct tree_type {
  unsigned int precision : 9;
};
void bork(unsigned int Subpart);
void foo(struct tree_type *t)
{
  bork(t->precision);
}

we miss the zero extension of the argument (comparing cc1 to cc1plus output)

-       movzwl  %ax, %eax
-       movl    %eax, (%esp)
-       call    bork
+       movw    %ax, (%esp)
+       call    _Z4borkj

but it's also different on the tree level in that C uses int and C++
a bitfield type.

This is related to PR30332, but unlike that one, this one works with 4.1.x.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
OtherBugsDependingO|                            |30332
              nThis|                            |
             Status|UNCONFIRMED                 |NEW
          Component|c                           |c++
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2007-04-09 19:21:39
               date|                            |
            Summary|Miscompilation of Function  |[4.2/4.3 Regression]
                   |Passing Bit Field Value to  |Miscompilation of Function
                   |Function                    |Passing Bit Field Value to
                   |                            |Function
   Target Milestone|---                         |4.2.0
            Version|unknown                     |4.2.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31513

Reply via email to