This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/52754] [4.7/4.8 Regression] indirect indexing broken with -fpredictive-commoning
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 30 Mar 2012 10:22:45 +0000
- Subject: [Bug other/52754] [4.7/4.8 Regression] indirect indexing broken with -fpredictive-commoning
- Auto-submitted: auto-generated
- References: <bug-52754-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52754
--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-30 10:22:45 UTC ---
We indeed should not create negative array indices (well, out-of-bound array
indices). The issue why this happens is that we transform
const unsigned int * ii = (const unsigned int *) &indexes[i];
*(ii + 12)
to
MEM[(const unsigned int *)&indexes + 12B][i_3];
via
ii = &indexes[i];
D.3849 = ii + 12;
D.3850 = *D.3849;
forwprop1 (still ok):
ii_9 = &indexes[i_3];
D.3850_11 = MEM[(const unsigned int *)ii_9 + 12B];
forwprop2 (bogus):
D.3850_11 = MEM[(const unsigned int *)&indexes + 12B][i_3];