]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ira: Fix s390 build
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 11 Jan 2022 12:47:05 +0000 (12:47 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 11 Jan 2022 12:47:05 +0000 (12:47 +0000)
My g:01f3e6a40e7202310abbeb41c345d325bd69554f broke the s390
build because the rclass variable was still needed by the
IRA_HARD_REGNO_ADD_COST_MULTIPLIER code.

gcc/
* ira-costs.c (ira_tune_allocno_costs): Fix missing rclass
definition in IRA_HARD_REGNO_ADD_COST_MULTIPLIER code.

gcc/ira-costs.c

index cbb58d32be81196f97bd7f5fd2eff261184e21ea..1e4cf5a35e4e4d6cf3d765c616e67d91b1870503 100644 (file)
@@ -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;