Check suitability of spill register for mode
authorKwok Cheung Yeung <kcy@codesourcery.com>
Thu, 14 Nov 2019 23:37:13 +0000 (23:37 +0000)
committerKwok Cheung Yeung <kcy@gcc.gnu.org>
Thu, 14 Nov 2019 23:37:13 +0000 (23:37 +0000)
2019-11-14  Kwok Cheung Yeung  <kcy@codesourcery.com>

gcc/
* lra-spills.c (assign_spill_hard_regs): Check that the spill
register is suitable for the mode.

From-SVN: r278267

gcc/ChangeLog
gcc/lra-spills.c

index 240bda5789ca3a21aa2a8a232675626cca065fd0..a811edbcc566875c3952d143c493b8c720dbdb04 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-14  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+       * lra-spills.c (assign_spill_hard_regs): Check that the spill
+       register is suitable for the mode.
+
 2019-11-14  Andrew MacLeod  <amacleod@redhat.com>
 
        * range-op.h (range_operator::fold_range): Return a bool.
index 54f76ccf8644ee4e7d2a64d8d05e19406ea1462e..8fbd3a8a2f2ddb215bc380c81854fff77ba79351 100644 (file)
@@ -283,7 +283,8 @@ assign_spill_hard_regs (int *pseudo_regnos, int n)
       for (k = 0; k < spill_class_size; k++)
        {
          hard_regno = ira_class_hard_regs[spill_class][k];
-         if (TEST_HARD_REG_BIT (eliminable_regset, hard_regno))
+         if (TEST_HARD_REG_BIT (eliminable_regset, hard_regno)
+             || !targetm.hard_regno_mode_ok (hard_regno, mode))
            continue;
          if (! overlaps_hard_reg_set_p (conflict_hard_regs, mode, hard_regno))
            break;