Fix reload after function-abi patches (PR91948)
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 1 Oct 2019 12:55:16 +0000 (12:55 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 1 Oct 2019 12:55:16 +0000 (12:55 +0000)
The code was passing a pseudo rather than its allocated hard reg
to ira_need_caller_save_p.  Running under valgrind to reproduce
the failure also showed that ALLOCNO_CROSSED_CALLS_ABIS wasn't
being explicitly initialised.

2019-10-01  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR rtl-optimization/91948
* ira-build.c (ira_create_allocno): Initialize
ALLOCNO_CROSSED_CALLS_ABIS.
* ira-color.c (allocno_reload_assign): Pass hard_regno rather
than regno to ira_need_caller_save_p.

From-SVN: r276407

gcc/ChangeLog
gcc/ira-build.c
gcc/ira-color.c

index ce7109f9b433998b8c1cc7f978e68787e16ab99d..ab81f414284a25141f7d8250cb9a1aab40617a62 100644 (file)
@@ -1,3 +1,11 @@
+2019-10-01  Richard Sandiford  <richard.sandiford@arm.com>
+
+       PR rtl-optimization/91948
+       * ira-build.c (ira_create_allocno): Initialize
+       ALLOCNO_CROSSED_CALLS_ABIS.
+       * ira-color.c (allocno_reload_assign): Pass hard_regno rather
+       than regno to ira_need_caller_save_p.
+
 2019-10-01  Alexandre Oliva <oliva@adacore.com>
 
        * config/i386/i386-options.c
index 222956e22ee420df168120e7ca48e99818e83e89..47ce189af472885a7d7ec2f49bf35a7872d788f2 100644 (file)
@@ -504,6 +504,7 @@ ira_create_allocno (int regno, bool cap_p,
   ALLOCNO_CALL_FREQ (a) = 0;
   ALLOCNO_CALLS_CROSSED_NUM (a) = 0;
   ALLOCNO_CHEAP_CALLS_CROSSED_NUM (a) = 0;
+  ALLOCNO_CROSSED_CALLS_ABIS (a) = 0;
   CLEAR_HARD_REG_SET (ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS (a));
 #ifdef STACK_REGS
   ALLOCNO_NO_STACK_REG_P (a) = false;
index 9197db972f37f6e8183741dfa1f03dc2e50e9b2f..42309b99e691f444574cc7fb00e4e40c64aa9912 100644 (file)
@@ -4398,7 +4398,7 @@ allocno_reload_assign (ira_allocno_t a, HARD_REG_SET forbidden_regs)
               ? ALLOCNO_CLASS_COST (a)
               : ALLOCNO_HARD_REG_COSTS (a)[ira_class_hard_reg_index
                                            [aclass][hard_regno]]));
-      if (ira_need_caller_save_p (a, regno))
+      if (ira_need_caller_save_p (a, hard_regno))
        {
          ira_assert (flag_caller_saves);
          caller_save_needed = 1;