PR middle-end/33290
* optabs.c (avoid_expensive_constant): Canonicalize CONST_INTs
before forcing them into a register.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128048
138bc75d-0d04-0410-961f-
82ee72b054a4
2007-09-03 Richard Sandiford <richard@codesourcery.com>
+ PR middle-end/33290
+ * optabs.c (avoid_expensive_constant): Canonicalize CONST_INTs
+ before forcing them into a register.
+
+2007-09-03 Richard Sandiford <richard@codesourcery.com>
+
* config/mips/mips.md (fetchop_bit): Use define_code_iterator
rather than define_code_macro.
&& CONSTANT_P (x)
&& rtx_cost (x, binoptab->code) > COSTS_N_INSNS (1))
{
- if (GET_MODE (x) != VOIDmode)
+ if (GET_CODE (x) == CONST_INT)
+ {
+ HOST_WIDE_INT intval = trunc_int_for_mode (INTVAL (x), mode);
+ if (intval != INTVAL (x))
+ x = GEN_INT (intval);
+ }
+ else
x = convert_modes (mode, VOIDmode, x, unsignedp);
x = force_reg (mode, x);
}