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

           Summary: [4.4] wrong code and wrong warning for bitfield
                    related operations
           Product: gcc
           Version: 4.4.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: marcin.slus...@gmail.com


Created attachment 24595
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24595
testcase

Compilation of attached file generates wrong warning:
$ g++-4.4.5 -c -O2 -Wall all.c
all.c: In function ‘void test(const st_src_reg*, ureg_dst)’:
all.c:118: warning: ‘reg’ is used uninitialized in this function
all.c:118: note: ‘reg’ was declared here

And produces wrong code - at random after "test" function, src[i].Negate (one
bit unsigned bit-field) becomes 1 when src_reg[i]->negate == 0 - something
which should not happen.

The bug does not manifest when compiled with gcc instead of g++ or with g++
4.3.5 or 4.5.2.

Reply via email to