re PR rtl-optimization/87305 (Segfault in end_hard_regno in setup_live_pseudos_and_sp...
authorVladimir Makarov <vmakarov@redhat.com>
Fri, 11 Jan 2019 19:25:31 +0000 (19:25 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Fri, 11 Jan 2019 19:25:31 +0000 (19:25 +0000)
2019-01-11  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/87305
* lra-assigns.c
(setup_live_pseudos_and_spill_after_risky_transforms): Add code
for little endian pseudos used as paradoxical subreg.

From-SVN: r267854

gcc/ChangeLog
gcc/lra-assigns.c

index bca96c04ac81479f1b4927960d3659fbc04d38b3..3185dd6e50cecb906f73e404b01340c481fda34e 100644 (file)
@@ -1,3 +1,10 @@
+2019-01-11  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/87305
+       * lra-assigns.c
+       (setup_live_pseudos_and_spill_after_risky_transforms): Add code
+       for little endian pseudos used as paradoxical subreg.
+
 2019-01-11  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/88693
index bcd81450c06eb224c18af96e848b6ef0b41b965b..8b56b58fb2e5e48f9b2aaf9633126f9da254b15a 100644 (file)
@@ -1174,10 +1174,14 @@ setup_live_pseudos_and_spill_after_risky_transforms (bitmap
                      - hard_regno_nregs (hard_regno, PSEUDO_REGNO_MODE (i)));
        enum reg_class rclass = lra_get_allocno_class (i);
 
-       if (WORDS_BIG_ENDIAN
-           && (hard_regno - nregs_diff < 0
-               || !TEST_HARD_REG_BIT (reg_class_contents[rclass],
-                                      hard_regno - nregs_diff)))
+       if ((WORDS_BIG_ENDIAN
+            && (hard_regno - nregs_diff < 0
+                || !TEST_HARD_REG_BIT (reg_class_contents[rclass],
+                                       hard_regno - nregs_diff)))
+           || (!WORDS_BIG_ENDIAN
+               && (hard_regno + nregs_diff >= FIRST_PSEUDO_REGISTER
+                   || !TEST_HARD_REG_BIT (reg_class_contents[rclass],
+                                          hard_regno + nregs_diff))))
          {
            /* Hard registers of paradoxical sub-registers are out of
               range of pseudo register class.  Spill the pseudo.  */