re PR rtl-optimization/87759 (ICE in lra_assign, at lra-assigns.c:1624, or ICE: Maxim...
authorVladimir Makarov <vmakarov@redhat.com>
Tue, 18 Dec 2018 21:20:16 +0000 (21:20 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Tue, 18 Dec 2018 21:20:16 +0000 (21:20 +0000)
2018-12-18  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/87759
* lra-assigns.c (lra_split_hard_reg_for): Recalculate
non_reload_pseudos.

2018-12-18  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/87759
* gcc.target/i386/pr87759.c: New.

From-SVN: r267244

gcc/ChangeLog
gcc/lra-assigns.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr87759.c [new file with mode: 0644]

index a4051f7acd207f94292761af85453f61fd4bac3d..e9f5baa6557cb0d7b0ebcaa4ab780e947939458d 100644 (file)
@@ -1,3 +1,9 @@
+2018-12-18  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/87759
+       * lra-assigns.c (lra_split_hard_reg_for): Recalculate
+       non_reload_pseudos.
+
 2018-12-18  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/88464
index 6b9d3ae4deb76df705b4c7990710ff28877f61f4..c43fedad74c50fec9e50d17b1b71dbb098fc6180 100644 (file)
@@ -1758,6 +1758,10 @@ lra_split_hard_reg_for (void)
             "\n****** Splitting a hard reg after assignment #%d: ******\n\n",
             lra_assignment_iter);
   bitmap_initialize (&failed_reload_pseudos, &reg_obstack);
+  bitmap_initialize (&non_reload_pseudos, &reg_obstack);
+  bitmap_ior (&non_reload_pseudos, &lra_inheritance_pseudos, &lra_split_regs);
+  bitmap_ior_into (&non_reload_pseudos, &lra_subreg_reload_pseudos);
+  bitmap_ior_into (&non_reload_pseudos, &lra_optional_reload_pseudos);
   for (i = lra_constraint_new_regno_start; i < max_regno; i++)
     if (reg_renumber[i] < 0 && lra_reg_info[i].nrefs != 0
        && (rclass = lra_get_allocno_class (i)) != NO_REGS
@@ -1772,6 +1776,7 @@ lra_split_hard_reg_for (void)
          }
        bitmap_set_bit (&failed_reload_pseudos, i);
       }
+  bitmap_clear (&non_reload_pseudos);
   bitmap_initialize (&failed_reload_insns, &reg_obstack);
   EXECUTE_IF_SET_IN_BITMAP (&failed_reload_pseudos, 0, u, bi)
     {
index e8a5868892778b5a47ab9fb1312582b7c0d2c791..d1eab574617aae0a1e3baa1c5ce1b0243f95e414 100644 (file)
@@ -1,3 +1,8 @@
+2018-12-18  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/87759
+       * gcc.target/i386/pr87759.c: New.
+
 2018-12-18  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/88464
diff --git a/gcc/testsuite/gcc.target/i386/pr87759.c b/gcc/testsuite/gcc.target/i386/pr87759.c
new file mode 100644 (file)
index 0000000..253d827
--- /dev/null
@@ -0,0 +1,39 @@
+/* PR rtl-optimization/87759 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -w -fschedule-insns -fselective-scheduling -ftrapv -fno-dce -fno-expensive-optimizations -fno-ipa-ra -fno-tree-dce -fno-tree-ter" } */
+
+int cc;
+
+void
+rc (__int128 *oi)
+{
+  __int128 qz = (__int128)2 << cc;
+
+  if (qz != 0)
+    {
+      if (cc != 0)
+        {
+          __int128 zp = 1;
+
+          for (;;)
+            {
+              unsigned __int128 *ar = &cc;
+              int y5;
+
+              if (oi != 0)
+                {
+ y3:
+                  zp = *oi + *ar;
+                }
+
+              y5 = (cc + 1) == ((*ar /= *oi) << ((zp >>= 128) / cc));
+              qz += !!y5 ? 1 : qz == (*ar ^ zp + 1);
+              ++*oi;
+            }
+        }
+      else
+        ++qz;
+    }
+
+  goto y3;
+}