This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/49525] New: [4.4] wrong code and wrong warning for bitfield related operations


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: unassigned@gcc.gnu.org
        ReportedBy: marcin.slusarz@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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]