diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cbe7b3097e1..1984d2a33fc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2009-05-12 Paolo Bonzini + + Revert: + + 2009-05-12 Paolo Bonzini + + * optabs.c (prepare_cmp_insn): Temporarily disable test that + causes spurious differences between trunk and cond-optab branch. + 2009-05-12 Paolo Bonzini * dojump.c (compare_from_rtx): Delete. diff --git a/gcc/optabs.c b/gcc/optabs.c index 970f1501700..9c8cb86dd14 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -4015,6 +4015,17 @@ prepare_cmp_insn (rtx x, rtx y, enum rtx_code comparison, rtx size, gcc_assert (methods == OPTAB_DIRECT || methods == OPTAB_WIDEN || methods == OPTAB_LIB_WIDEN); + /* If we are optimizing, force expensive constants into a register. */ + if (CONSTANT_P (x) && optimize + && (rtx_cost (x, COMPARE, optimize_insn_for_speed_p ()) + > COSTS_N_INSNS (1))) + x = force_reg (mode, x); + + if (CONSTANT_P (y) && optimize + && (rtx_cost (y, COMPARE, optimize_insn_for_speed_p ()) + > COSTS_N_INSNS (1))) + y = force_reg (mode, y); + #ifdef HAVE_cc0 /* Make sure if we have a canonical comparison. The RTL documentation states that canonical comparisons are required only