https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96015

--- Comment #33 from Jeffrey A. Law <law at redhat dot com> ---
Have I mentioned before that I think __builtin_unreachable is fundamentally
broken/wrong :-)


I could argue that the BARRIER in the IL is wrong because it doesn't actually
line up with the semantics of the instruction stream.  But that's probably a
losing battle with those who think that __builtin_unreachable's current
behavior is sensible.

One thought would be to turn a conditional jump followed by a barrier into an
unconditional jump in jump.c.  But I fear that just papers over the problem and
that we'd see the same issue raise its head again in a slightly perturbed form
that wasn't recognized by jump.c, but tripped the same code as we have now in
reorg.c.

Another thought would be to detect this in relax_delay_slots and twiddle the
transformation to avoid the problematic behavior.  I think we could detect just
by seeing if there's a barrier after INSN in the same hunk of code that Eric
quoted and changing the behavior slightly when that's detected.

I hate special casing things like that and there's a reasonable chance other
parts of GCC are affected by the same problem.  That may argue for implementing
both approaches.

But I'd really just like to change how __builtin_unreachable works.

Eric, thoughts?

jeff

Reply via email to