diff options
author | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-13 20:40:53 +0000 |
---|---|---|
committer | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-13 20:40:53 +0000 |
commit | 3cc98df40ddf9f78f075d95378c4c2d3c54fb4bf (patch) | |
tree | d7f07a98f652d9df0af95a74a6a37c347bbe58d7 /gcc/cfgcleanup.c | |
parent | 5eb8d0020a7808559028eb2ea892073e2533eeb4 (diff) | |
download | gcc-3cc98df40ddf9f78f075d95378c4c2d3c54fb4bf.tar.gz |
* cfgcleanup.c (try_head_merge_bb): If get_condition returns
NULL for a jump that is a cc0 insn, pick the previous insn for
move_before.
* gcc.c-torture/compile/20110913-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178834 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r-- | gcc/cfgcleanup.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 396057cc19b..20a409c4fae 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -2214,7 +2214,14 @@ try_head_merge_bb (basic_block bb) cond = get_condition (jump, &move_before, true, false); if (cond == NULL_RTX) - move_before = jump; + { +#ifdef HAVE_cc0 + if (reg_mentioned_p (cc0_rtx, jump)) + move_before = prev_nonnote_nondebug_insn (jump); + else +#endif + move_before = jump; + } for (ix = 0; ix < nedges; ix++) if (EDGE_SUCC (bb, ix)->dest == EXIT_BLOCK_PTR) @@ -2376,7 +2383,14 @@ try_head_merge_bb (basic_block bb) jump = BB_END (final_dest_bb); cond = get_condition (jump, &move_before, true, false); if (cond == NULL_RTX) - move_before = jump; + { +#ifdef HAVE_cc0 + if (reg_mentioned_p (cc0_rtx, jump)) + move_before = prev_nonnote_nondebug_insn (jump); + else +#endif + move_before = jump; + } } do |