]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/58438 (ICE: in check_rtl, at lra.c:2036)
authorVladimir Makarov <vmakarov@redhat.com>
Wed, 18 Sep 2013 18:24:49 +0000 (18:24 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Wed, 18 Sep 2013 18:24:49 +0000 (18:24 +0000)
2013-09-18  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/58438
* lra.c (lra): Clear lra_optional_reload_pseudos in upper loop.
* lra-constraints.c (undo_optional_reloads): Keep optional reloads
from previous subpasses.

2013-09-18  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/58438
* g++.dg/pr58438.C: New test.

From-SVN: r202714

gcc/ChangeLog
gcc/lra-constraints.c
gcc/lra.c
gcc/testsuite/ChangeLog

index 3d38778c615dae60a8513c39fe1d71806b48d05f..d222ee09d2b3138bdcb45c69d4ad9f4dea4b9240 100644 (file)
@@ -1,3 +1,10 @@
+2013-09-18  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/58438
+       * lra.c (lra): Clear lra_optional_reload_pseudos in upper loop.
+       * lra-constraints.c (undo_optional_reloads): Keep optional reloads
+       from previous subpasses.
+
 2013-09-18  Richard Earnshaw  <rearnsha@arm.com>
 
        * arm.c (arm_get_frame_offsets): Validate architecture supports
index b949a6b4f2eca3ee439bced8a8451f6773f6a1ec..e87ba91f3c705a543d40a10d7c10d2163b3712bf 100644 (file)
@@ -5456,10 +5456,12 @@ undo_optional_reloads (void)
   EXECUTE_IF_SET_IN_BITMAP (&lra_optional_reload_pseudos, 0, regno, bi)
     {
       keep_p = false;
-      if (reg_renumber[lra_reg_info[regno].restore_regno] >= 0)
-       /* If the original pseudo changed its allocation, just
-          removing the optional pseudo is dangerous as the original
-          pseudo will have longer live range.  */
+      /* Keep optional reloads from previous subpasses.  */
+      if (lra_reg_info[regno].restore_regno < 0
+         /* If the original pseudo changed its allocation, just
+            removing the optional pseudo is dangerous as the original
+            pseudo will have longer live range.  */
+         || reg_renumber[lra_reg_info[regno].restore_regno] >= 0)
        keep_p = true;
       else if (reg_renumber[regno] >= 0)
        EXECUTE_IF_SET_IN_BITMAP (&lra_reg_info[regno].insn_bitmap, 0, uid, bi2)
index df457f5bc9e57f4e73dc6f592324981e7b0e884d..f5aab1739272ba72922dbf7a35ecbfc50c2c4c0c 100644 (file)
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -2315,7 +2315,6 @@ lra (FILE *f)
     {
       for (;;)
        {
-         bitmap_clear (&lra_optional_reload_pseudos);
          /* We should try to assign hard registers to scratches even
             if there were no RTL transformations in
             lra_constraints.  */
@@ -2367,6 +2366,9 @@ lra (FILE *f)
                lra_clear_live_ranges ();
            }
        }
+      /* Don't clear optional reloads bitmap until all constraints are
+        satisfied as we need to differ them from regular reloads.  */
+      bitmap_clear (&lra_optional_reload_pseudos);
       bitmap_clear (&lra_subreg_reload_pseudos);
       bitmap_clear (&lra_inheritance_pseudos);
       bitmap_clear (&lra_split_regs);
index e388eb469e8e4990b6cb05fb7e00de283695c4b0..4ed1d8b943b86bd611e4a257857cf336a6bac1ed 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-18  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/58438
+       * g++.dg/pr58438.C: New test.
+
 2013-09-18  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/43366