Message ID | 201111192141.05177.ebotcazou@adacore.com |
---|---|
State | New |
Headers | show |
On Sat, Nov 19, 2011 at 12:41 PM, Eric Botcazou <ebotcazou@adacore.com> wrote: > This is the miscompilation of the cross-compiler targetting AVR by the native > compiler on the SPARC at -O2, a latent problem in reorg.c that is exposed in > the 4.5.x (and later) series by the introduction of __builtin_unreachable. I saw this also when I looked into __builtin_unreachable in one bug report at one point on MIPS. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49054#c1 . Thanks, Andrew Pinski
> I saw this also when I looked into __builtin_unreachable in one bug > report at one point on MIPS. See > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49054#c1 . Yes, the Debian folks also saw the problem on other architectures.
Index: reorg.c =================================================================== --- reorg.c (revision 181505) +++ reorg.c (working copy) @@ -3600,9 +3600,11 @@ relax_delay_slots (rtx first) } } + /* See if we have a simple (conditional) jump that is useless. */ if (! INSN_ANNULLED_BRANCH_P (delay_insn) - && prev_active_insn (target_label) == insn && ! condjump_in_parallel_p (delay_insn) + && prev_active_insn (target_label) == insn + && ! BARRIER_P (prev_nonnote_insn (target_label)) #ifdef HAVE_cc0 /* If the last insn in the delay slot sets CC0 for some insn, various code assumes that it is in a delay slot. We could