middle-end/10336: [3.4 regression] ICE with -Wunreachable-code

Steven Bosscher s.bosscher@student.tudelft.nl
Tue Apr 29 00:10:00 GMT 2003


http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10336

Jason,

Your patch added this line:

+ for (insn = PREV_INSN (avoided_insn); ; insn = PREV_INSN (insn))

I fixed a bug some time ago where such a loop ignored
BARRIER insns, walked the whole list of INSNs until insn
was NULL, which caused a segfault.  It seems that for
this test case, the same thing happens in your new loop.

You can see in gdb that the C front end is ignoring
"(barrier 14 13 15)".  Two insns later you have a the
segfault...

So maybe something like this would fix it??

+ for (insn = PREV_INSN (avoided_insn);
+      GET_CODE (insn) != BARRIER;
+      insn = PREV_INSN (insn))

Assuming PREV_INSN (avoided_insn) is never NULL, but of
course we make that assumption now, too.

Can't test it this week.  Wolfgang, maybe you can, and if
it works, submit a patch and use your new privileges? :-)

Greetz
Steven





More information about the Gcc-bugs mailing list