2011-06-06 Dmitry PLotnikov <dplotnikov@ispras.ru>
gcc/
* config/arm/arm.c (arm_rtx_costs_1): Fixed costs for CONST_INT
in PLUS pattern.
@@ -7050,7 +7056,9 @@ arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total, bool speed)
case CONST_INT:
if (const_ok_for_arm (INTVAL (x))
- || const_ok_for_arm (~INTVAL (x)))
+ || const_ok_for_arm (~INTVAL (x))
+ || (TARGET_THUMB2 && outer == PLUS
+ && (const_ok_for_op (INTVAL (x), outer))))
*total = COSTS_N_INSNS (1);
else
*total = COSTS_N_INSNS (arm_gen_constant (SET, mode, NULL_RTX,