+2005-05-01 Roger Sayle <roger@eyesopen.com>
+
+ PR rtl-optimization/19579
+ Backport from mainline
+ 2005-01-26 Jakub Jelinek <jakub@redhat.com>
+ * ifcvt.c (noce_try_cmove_arith): If emitting instructions to set up
+ both A and B, see if they don't clobber registers the other expr uses.
+
2005-04-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
PR 14884
rtx a = if_info->a;
rtx b = if_info->b;
rtx x = if_info->x;
+ rtx orig_a, orig_b;
rtx insn_a, insn_b;
rtx tmp, target;
int is_mem = 0;
start_sequence ();
+ orig_a = a;
+ orig_b = b;
+
/* If either operand is complex, load it into a register first.
The best way to do this is to copy the original insn. In this
way we preserve any clobbers etc that the insn may have had.
}
if (! general_operand (b, GET_MODE (b)))
{
- rtx set;
+ rtx set, last;
if (no_new_pseudos)
goto end_seq_and_fail;
if (is_mem)
{
tmp = gen_reg_rtx (GET_MODE (b));
- tmp = emit_insn (gen_rtx_SET (VOIDmode, tmp, b));
+ tmp = gen_rtx_SET (VOIDmode, tmp, b);
}
else if (! insn_b
#if 0
tmp = copy_rtx (insn_b);
set = single_set (tmp);
SET_DEST (set) = b;
- tmp = emit_insn (PATTERN (tmp));
+ tmp = PATTERN (tmp);
+ }
+
+ /* If insn to set up A clobbers any registers B depends on, try to
+ swap insn that sets up A with the one that sets up B. If even
+ that doesn't help, punt. */
+ last = get_last_insn ();
+ if (last && modified_in_p (orig_b, last))
+ {
+ tmp = emit_insn_before (tmp, get_insns ());
+ if (modified_in_p (orig_a, tmp))
+ goto end_seq_and_fail;
}
+ else
+ tmp = emit_insn (tmp);
+
if (recog_memoized (tmp) < 0)
goto end_seq_and_fail;
}
+2005-05-01 Roger Sayle <roger@eyesopen.com>
+
+ PR rtl-optimization/19579
+ Backport from mainline
+ * gcc.c-torture/execute/20050124-1.c: New test.
+
2005-04-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
PR c++/18644