aboutsummaryrefslogtreecommitdiff
path: root/gcc/sel-sched.c
diff options
context:
space:
mode:
authorAndrey Belevantsev <abel@ispras.ru>2013-08-14 18:31:26 +0400
committerAlexander Monakov <amonakov@gcc.gnu.org>2013-08-14 18:31:26 +0400
commite839e2a9311ecfa2cfd8e9bc0b6eeba65da48418 (patch)
tree6797bfb33445b2da9e17d960737957cc6f4fdc6f /gcc/sel-sched.c
parentaec9ba36b142026cae3b194840c41d9ba7b5c8f4 (diff)
downloadgcc-e839e2a9311ecfa2cfd8e9bc0b6eeba65da48418.zip
gcc-e839e2a9311ecfa2cfd8e9bc0b6eeba65da48418.tar.gz
gcc-e839e2a9311ecfa2cfd8e9bc0b6eeba65da48418.tar.bz2
re PR rtl-optimization/57662 (ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2)
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. From-SVN: r201728
Diffstat (limited to 'gcc/sel-sched.c')
-rw-r--r--gcc/sel-sched.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index fb9386f..46c66b4 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -6424,10 +6424,23 @@ code_motion_process_successors (insn_t insn, av_set_t orig_ops,
res = b;
/* We have simplified the control flow below this point. In this case,
- the iterator becomes invalid. We need to try again. */
+ the iterator becomes invalid. We need to try again.
+ If we have removed the insn itself, it could be only an
+ unconditional jump. Thus, do not rescan but break immediately --
+ we have already visited the only successor block. */
+ if (!BLOCK_FOR_INSN (insn))
+ {
+ if (sched_verbose >= 6)
+ sel_print ("Not doing rescan: already visited the only successor"
+ " of block %d\n", old_index);
+ break;
+ }
if (BLOCK_FOR_INSN (insn)->index != old_index
|| EDGE_COUNT (bb->succs) != old_succs)
{
+ if (sched_verbose >= 6)
+ sel_print ("Rescan: CFG was simplified below insn %d, block %d\n",
+ INSN_UID (insn), BLOCK_FOR_INSN (insn)->index);
insn = sel_bb_end (BLOCK_FOR_INSN (insn));
goto rescan;
}