This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/36449] Incorrect code generated for access to a large struct
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jun 2008 13:45:08 -0000
- Subject: [Bug tree-optimization/36449] Incorrect code generated for access to a large struct
- References: <bug-36449-10113@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from rguenth at gcc dot gnu dot org 2008-06-06 13:45 -------
Confirmed.
>From the comparison fold builds BIT_FIELD_REFs and the bit position overflows
32bits.
bar.foo.a = 0;
bar.foo.b = 0;
D.1627 = BIT_FIELD_REF <bar, 32, 0>;
D.1628 = D.1627 & 4294967295;
zip.0 = zip;
D.1630 = BIT_FIELD_REF <*zip.0, 32, ffffffff80000000>;
D.1631 = D.1630 & 0;
if (D.1628 == D.1631)
vs. the correct one:
bar.foo.a = 0;
bar.foo.b = 0;
D.1627 = BIT_FIELD_REF <bar, 32, 0>;
D.1628 = D.1627 & 4294967295;
zip.0 = zip;
D.1630 = BIT_FIELD_REF <*zip.0, 32, 2147483584>;
D.1631 = D.1630 & 4294967295;
if (D.1628 == D.1631)
Same for 4.2 and 4.3, but fixed on the trunk where I removed this code.
if ((BIT_FIELD_REF <bar, 32, 0> & 4294967295) == (BIT_FIELD_REF <*zip, 32,
-2147483648> & 0))
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|c++ |tree-optimization
Ever Confirmed|0 |1
Keywords| |wrong-code
Known to fail| |4.1.2 4.2.4 4.3.1
Known to work| |4.4.0
Last reconfirmed|0000-00-00 00:00:00 |2008-06-06 13:45:07
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36449