This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/26643] Linux matroxfb_probe miscompiled
- From: "matz at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Mar 2006 08:57:36 -0000
- Subject: [Bug middle-end/26643] Linux matroxfb_probe miscompiled
- References: <bug-26643-1216@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from matz at suse dot de 2006-03-13 08:57 -------
-fno-ivopts fixes it. The problem is how bitfield refs are dealt with it
seems. With -fno-ivopts the final_cleanup pass looks like so at the
interesting point:
D.2180 = BIT_FIELD_REF <*pdev, 32, 544> & 4294967295;
...
if ((BIT_FIELD_REF <*b, 32, 0> & 4294967295) != D.2180) goto <L3>;
else goto <L1>;
ivopts lead to this code at that point:
D.2180 = BIT_FIELD_REF <*pdev, 32, 544> & 4294967295;
...
if ((MEM[base: (long unsigned int *) b] & 4294967295) != D.2180) goto <L3>;
else goto <L1>;
Now BIT_FIELD_REF<*b,32,0> extract exactly the 32 bit at address 'b'.
But MEM[base: (long unsigned int *) b] extracts the 64 bit at that address.
The masking afterwards selects the lower 32bit from that, but ppc being
a big endian target this extracts the wrong half. Let's CC Zdenek for this.
--
matz at suse dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rakdver at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26643