diff options
-rw-r--r-- | gcc/ira-costs.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index cbb58d3..1e4cf5a 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -2351,10 +2351,13 @@ ira_tune_allocno_costs (void) if (ira_need_caller_save_p (a, regno)) cost += ira_caller_save_cost (a); #ifdef IRA_HARD_REGNO_ADD_COST_MULTIPLIER - cost += ((ira_memory_move_cost[mode][rclass][0] - + ira_memory_move_cost[mode][rclass][1]) - * ALLOCNO_FREQ (a) - * IRA_HARD_REGNO_ADD_COST_MULTIPLIER (regno) / 2); + { + auto rclass = REGNO_REG_CLASS (regno); + cost += ((ira_memory_move_cost[mode][rclass][0] + + ira_memory_move_cost[mode][rclass][1]) + * ALLOCNO_FREQ (a) + * IRA_HARD_REGNO_ADD_COST_MULTIPLIER (regno) / 2); + } #endif if (INT_MAX - cost < reg_costs[j]) reg_costs[j] = INT_MAX; |