aboutsummaryrefslogtreecommitdiff
path: root/gcc/auto-inc-dec.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/auto-inc-dec.c')
-rw-r--r--gcc/auto-inc-dec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/auto-inc-dec.c b/gcc/auto-inc-dec.c
index 35d6c87..6db9c7e 100644
--- a/gcc/auto-inc-dec.c
+++ b/gcc/auto-inc-dec.c
@@ -515,13 +515,14 @@ attempt_change (rtx new_addr, rtx inc_reg)
rtx new_mem;
int old_cost = 0;
int new_cost = 0;
+ bool speed = optimize_bb_for_speed_p (bb);
PUT_MODE (mem_tmp, mode);
XEXP (mem_tmp, 0) = new_addr;
- old_cost = rtx_cost (mem, 0)
- + rtx_cost (PATTERN (inc_insn.insn), 0);
- new_cost = rtx_cost (mem_tmp, 0);
+ old_cost = rtx_cost (mem, 0, speed)
+ + rtx_cost (PATTERN (inc_insn.insn), 0, speed);
+ new_cost = rtx_cost (mem_tmp, 0, speed);
/* The first item of business is to see if this is profitable. */
if (old_cost < new_cost)