[PATCH] Fix PR 57662

Andrey Belevantsev abel@ispras.ru
Wed Aug 14 13:12:00 GMT 2013


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.	

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr57662.diff
Type: text/x-patch
Size: 2325 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130814/791d3807/attachment.bin>


More information about the Gcc-patches mailing list