This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49525] New: [4.4] wrong code and wrong warning for bitfield related operations
- From: "marcin.slusarz at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 24 Jun 2011 22:20:51 +0000
- Subject: [Bug c++/49525] New: [4.4] wrong code and wrong warning for bitfield related operations
- Auto-submitted: auto-generated
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.