This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Tree tail merging breaks __builtin_unreachable optimization


On Wed, Jul 4, 2012 at 10:02 AM, Ulrich Weigand <uweigand@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]