aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/optabs.c11
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cbe7b30..1984d2a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,14 @@
2009-05-12 Paolo Bonzini <bonzini@gnu.org>
+ Revert:
+
+ 2009-05-12 Paolo Bonzini <bonzini@gnu.org>
+
+ * optabs.c (prepare_cmp_insn): Temporarily disable test that
+ causes spurious differences between trunk and cond-optab branch.
+
+2009-05-12 Paolo Bonzini <bonzini@gnu.org>
+
* dojump.c (compare_from_rtx): Delete.
* expmed.c (emit_store_flag): Only try cstore_optab. Canonicalize
any MODE_CC mode to the cstorecc4 pattern. Use prepare_operand, fail
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 970f150..9c8cb86 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