On 06/06/2011 04:41 PM, Andrew Stubbs wrote:
On 06/06/11 13:15, Dmitry Plotnikov wrote:
+ && (const_ok_for_op (INTVAL (x), outer)
+ || const_ok_for_op (~INTVAL (x), outer))))
The second call is redundant. const_ok_for_op should already do that.
Fixed patch is attached. Ok?
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,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,