diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1992-09-23 19:24:25 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1992-09-23 19:24:25 -0400 |
commit | 01ca1b91827b2faec4f39050247a3b278dfdf6a3 (patch) | |
tree | 545e05e713e1dda9184b5fdda5af2aa4a5f01838 /gcc | |
parent | b6c9b49af96ef5a6bc00143b1a835a75a794e0f1 (diff) | |
download | gcc-01ca1b91827b2faec4f39050247a3b278dfdf6a3.zip gcc-01ca1b91827b2faec4f39050247a3b278dfdf6a3.tar.gz gcc-01ca1b91827b2faec4f39050247a3b278dfdf6a3.tar.bz2 |
(jump_optimize): Tighten up test for when we can't delete a set of CC0.
Don't insert insns between set and use of CC0.
From-SVN: r2217
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/jump.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -1040,7 +1040,9 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan) && ! ((temp6 = prev_nonnote_insn (insn)) != 0 && GET_CODE (temp6) == INSN - && sets_cc0_p (PATTERN (temp6)) == -1) + && (sets_cc0_p (PATTERN (temp6)) == -1 + || (sets_cc0_p (PATTERN (temp6)) == 1 + && FIND_REG_INC_NOTE (temp6, NULL_RTX)))) #endif ) { @@ -1088,6 +1090,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan) normalizep); if (target) { + rtx before = insn; rtx seq; /* Put the store-flag insns in front of the first insn @@ -1143,7 +1146,15 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan) seq = get_insns (); end_sequence (); - emit_insns_before (seq, insn); +#ifdef HAVE_cc0 + /* If INSN uses CC0, we must not separate it from the + insn that sets cc0. */ + + if (reg_mentioned_p (cc0_rtx, PATTERN (before))) + before = prev_nonnote_insn (before); +#endif + + emit_insns_before (seq, before); delete_insn (temp); next = NEXT_INSN (insn); |