[Bug rtl-optimization/87468] [9 Regression] ice "wrong amount of branch edges after conditional jump in bb"

law at redhat dot com gcc-bugzilla@gcc.gnu.org
Wed Nov 21 15:33:00 GMT 2018


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

--- Comment #6 from Jeffrey A. Law <law at redhat dot com> ---
More correctly, jump threading is duplicating a switch in which there's an
outgoing edge marked as EDGE_IGNORE.  That duplicate has EDGE_IGNORE set, but
isn't in the cleanup queue.  Thus it leaks into the IL after the VRP pass is
complete.

Reviewing the original introduction of these bits, it looks like Richi's
intention was to simplify the switches and remove the edges later because doing
so early is going to mess up dominators.  That's a problem because we have to
do an ssa update to handle newly exposed variables.  That SSA update occurs
after identifying jump threads, but before the CFG updates.  Ugh.  I've always
hated the sequencing hoops we have to jump through for this stuff.

I'm going to look at moving the cleanup call to a slightly earlier point --
essentially just before we update the CFG for jump threading.  That has certain
nice properties, but I'll need to review some of the jump threading code to be
sure that's safe.

I'm also going to look at other mitigations in the updater.  We could just add
the copied objects to the cleanup list and the right things would just happen.

I don't want to disable threading through switches that have dead labels.  That
seems too drastic.


More information about the Gcc-bugs mailing list