On Wed, Jul 4, 2012 at 10:02 AM, Ulrich Weigand <uweig...@de.ibm.com> wrote:
> Any suggestions how to fix this?  Should tail merging detect
> __builtin_unreachable and not merge such block?  Or else, should
> the CFG optimizer be extended (how?) to handle unreachable blocks
> with multiple predecessors better?

This bug has nothing to do with tail merging except tail merging
exposing it.  I have seen this behavior on MIPS even without tail
merging.  The problem is how __builtin_unreachable is implemented.  It
is implemented fine on the tree level but once it is expanded to RTL,
to optimize it away it depends on the unreachable basic block being
right after the conditional.

See PR 50385 #c1 which shows exactly the problem I saw while
implementing a basic block reorder on the tree level.

Thanks,
Andrew Pinski

Reply via email to