diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-12-06 20:28:09 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-12-06 20:28:09 +0100 |
commit | 150bd82096743de59b2528fefcb7a5ec936f9d89 (patch) | |
tree | 959f69dcff53adb1e2fe7053bcc927890ba29a79 /gcc/cfglayout.c | |
parent | ce7190e503340dd94fec600f25d0ec64c7f56422 (diff) | |
download | gcc-150bd82096743de59b2528fefcb7a5ec936f9d89.zip gcc-150bd82096743de59b2528fefcb7a5ec936f9d89.tar.gz gcc-150bd82096743de59b2528fefcb7a5ec936f9d89.tar.bz2 |
re PR rtl-optimization/46777 (ICE: in rtl_verify_flow_info, at cfgrtl.c:2164 with -O -fgcse -fno-tree-dominator-opts -funroll-loops)
PR rtl-optimization/46777
* cfglayout.c (duplicate_insn_chain): Avoid duplicating
also barrier after tablejump.
* gcc.dg/pr46777.c: New test.
From-SVN: r167513
Diffstat (limited to 'gcc/cfglayout.c')
-rw-r--r-- | gcc/cfglayout.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c index e883af4..f7d4d10 100644 --- a/gcc/cfglayout.c +++ b/gcc/cfglayout.c @@ -1177,7 +1177,20 @@ duplicate_insn_chain (rtx from, rtx to) moved far from original jump. */ if (GET_CODE (PATTERN (insn)) == ADDR_VEC || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC) - break; + { + /* Avoid copying following barrier as well if any + (and debug insns in between). */ + rtx next; + + for (next = NEXT_INSN (insn); + next != NEXT_INSN (to); + next = NEXT_INSN (next)) + if (!DEBUG_INSN_P (next)) + break; + if (next != NEXT_INSN (to) && BARRIER_P (next)) + insn = next; + break; + } copy = emit_copy_of_insn_after (insn, get_last_insn ()); maybe_copy_prologue_epilogue_insn (insn, copy); break; |