(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
This commit is contained in:
Richard Kenner 1992-09-23 19:24:25 -04:00
parent b6c9b49af9
commit 01ca1b9182

View File

@ -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);