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 other/52754] [4.7/4.8 Regression] indirect indexing broken with -fpredictive-commoning


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];


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