------- Comment #4 from rguenth at gcc dot gnu dot org 2007-10-31 17:03 ------- Reduced testcase:
void decode(char *d, int len); void decode(char *d, int len) { int i = len - 1; while(i >= 0) { d[i]; if(d[i] == 0) d[i]=' '; i--; } } int main(int argc, char **argv) { decode("this bug is really weird", 24); } the store is turned into an unconditional store by the cselim pass, but this store traps as the 'd' argument is in read-only memory. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matz at gcc dot gnu dot org Severity|normal |blocker Status|UNCONFIRMED |NEW Component|tree-optimization |rtl-optimization Ever Confirmed|0 |1 Keywords| |wrong-code Last reconfirmed|0000-00-00 00:00:00 |2007-10-31 17:03:11 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33961