PR middle-end/19068
* expr.c (expand_expr_real_1) <MAX_EXPR>: Ensure that target, op0
and op1 are all registers (or constants) before expanding the RTL
comparison sequence [to avoid reg_overlap_mentioned (target, op1)].
* g++.dg/opt/max1.C: New test case.
From-SVN: r92404
+2004-12-19 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/19068
+ * expr.c (expand_expr_real_1) <MAX_EXPR>: Ensure that target, op0
+ and op1 are all registers (or constants) before expanding the RTL
+ comparison sequence [to avoid reg_overlap_mentioned (target, op1)].
+
2004-12-16 Eric Botcazou <ebotcazou@adacore.com>
PR middle-end/18882
/* At this point, a MEM target is no longer useful; we will get better
code without it. */
- if (GET_CODE (target) == MEM)
+ if (! REG_P (target))
target = gen_reg_rtx (mode);
+ /* We generate better code and avoid problems with op1 mentioning
+ target by forcing op1 into a pseudo if it isn't a constant. */
+ if (! CONSTANT_P (op1))
+ op1 = force_reg (mode, op1);
+
if (target != op0)
emit_move_insn (target, op0);
+2004-12-19 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/19068
+ * g++.dg/opt/max1.C: New test case.
+
2004-12-16 Wolfgang Bangerth <bangerth@dealii.com>
* g++.dg/other/complex1.C: New test.