This is follow-up patch that fixes rtx costs for CONST_INT in PLUS
pattern. Original discussion is here:
http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01427.html
2011-06-06 Dmitry PLotnikov <dplotni...@ispras.ru>
gcc/
* config/arm/arm.c (arm_rtx_costs_1): Fixed costs for CONST_INT
in PLUS pattern.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 22ddcd2..9ef6f6d 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -7050,7 +7056,10 @@ 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)
+ || const_ok_for_op (~INTVAL (x), outer))))
*total = COSTS_N_INSNS (1);
else
*total = COSTS_N_INSNS (arm_gen_constant (SET, mode, NULL_RTX,