Comments

Hello,
As noted in Bugzilla, the problem is this PR is the rare case of removing
the unconditional jump that is used for traversing CFG when simplifying
control flow. We rescan the remaining successors when we know the flow
below the current point has changed, and when we have removed the jump we
are currently on, we segfault. The fix is just to break out of successor
iterator loop as in the unconditional jump case we have already visited the
only successor.
Bootstrapped and tested on x86-64, ok for trunk? If yes, Alexander, could
you please commit this for me?
Andrey
2013-08-14 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/57662
gcc/
* sel-sched.c (code_motion_process_successors): When the current insn
is removed after the recursive traversal, break from the loop.
Add comments and debug printouts.
testsuite/
* gcc.dg/pr57662.c: New test.

On Wed, 14 Aug 2013, Andrey Belevantsev wrote:
> Hello,> > As noted in Bugzilla, the problem is this PR is the rare case of removing the> unconditional jump that is used for traversing CFG when simplifying control> flow. We rescan the remaining successors when we know the flow below the> current point has changed, and when we have removed the jump we are currently> on, we segfault. The fix is just to break out of successor iterator loop as> in the unconditional jump case we have already visited the only successor.> > Bootstrapped and tested on x86-64, ok for trunk? If yes, Alexander, could you> please commit this for me?
This is OK. Committed after adjusting one overlong line. Thanks.
Alexander