diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-05-11 20:17:43 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-05-11 20:17:43 +0200 |
commit | 3b5fda81f9c543ca8bccf438a74a0cb5b54f6a70 (patch) | |
tree | 1cb4796f120b34f94f9e016946901fdcba7136f8 /gcc/cfgrtl.c | |
parent | 3895ec538abb365483f1ff862f1fe0e78a3119d5 (diff) | |
download | gcc-3b5fda81f9c543ca8bccf438a74a0cb5b54f6a70.zip gcc-3b5fda81f9c543ca8bccf438a74a0cb5b54f6a70.tar.gz gcc-3b5fda81f9c543ca8bccf438a74a0cb5b54f6a70.tar.bz2 |
re PR middle-end/44071 (ICE with asm goto and __builtin_unreachable())
PR middle-end/44071
* cfglayout.c (fixup_reorder_chain): Allow asm goto to have
no fallthru edge.
* cfgcleanup.c (try_optimize_cfg): When in cfglayout mode
optimizing away empty bb with no successors, move over its
footer chain to fallthru predecessor.
* cfgrtl.c (patch_jump_insn): Update also REG_LABEL_OPERAND.
(rtl_split_edge): For asm goto call patch_jump_insn even if
splitting fallthru edge.
* c-c++-common/asmgoto-4.c: New test.
* gcc.target/i386/pr44071.c: New test.
From-SVN: r159288
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r-- | gcc/cfgrtl.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 7fb1873..abdbf9d 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -994,6 +994,9 @@ patch_jump_insn (rtx insn, rtx old_label, basic_block new_bb) && !find_reg_note (insn, REG_LABEL_TARGET, new_label)) add_reg_note (insn, REG_LABEL_TARGET, new_label); } + while ((note = find_reg_note (insn, REG_LABEL_OPERAND, old_label)) + != NULL_RTX) + XEXP (note, 0) = new_label; } else { @@ -1407,7 +1410,22 @@ rtl_split_edge (edge edge_in) gcc_assert (redirected); } else - redirect_edge_succ (edge_in, bb); + { + if (edge_in->src != ENTRY_BLOCK_PTR) + { + /* For asm goto even splitting of fallthru edge might + need insn patching, as other labels might point to the + old label. */ + rtx last = BB_END (edge_in->src); + if (last + && JUMP_P (last) + && edge_in->dest != EXIT_BLOCK_PTR + && extract_asm_operands (PATTERN (last)) != NULL_RTX + && patch_jump_insn (last, before, bb)) + df_set_bb_dirty (edge_in->src); + } + redirect_edge_succ (edge_in, bb); + } return bb; } |