re PR rtl-optimization/80193 (ICE on valid (but hairy) C code at -O3 on x86_64-linux...
authorVladimir Makarov <vmakarov@redhat.com>
Tue, 28 Mar 2017 20:55:38 +0000 (20:55 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Tue, 28 Mar 2017 20:55:38 +0000 (20:55 +0000)
2017-03-28  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/80193
* ira.c (ira): Do not check allocation for LRA.

2017-03-28  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/80193
* gcc.target/i386/pr80193.c: New.

From-SVN: r246554

gcc/ChangeLog
gcc/ira.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr80193.c [new file with mode: 0644]

index 7a575a8a46a3839fb932b006f92423bd4ad22852..c848c7157171b480eee62c356391f8d97b7a901a 100644 (file)
@@ -1,3 +1,8 @@
+2017-03-28  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/80193
+       * ira.c (ira): Do not check allocation for LRA.
+
 2017-03-28  Alexander Monakov  <amonakov@ispras.ru>
 
        * config/nvptx/nvptx-protos.h (nvptx_output_simt_enter): Declare.
index b41c480c99d5f9d9aca29acf863333e147b100f0..7079573bc3a30c96a13729bb8b5170088dd35bdc 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -5334,7 +5334,6 @@ ira (FILE *f)
                                        reg_alternate_class (old_regno),
                                        reg_allocno_class (old_regno));
                 }
-
            }
          else
            {
@@ -5370,7 +5369,14 @@ ira (FILE *f)
   calculate_allocation_cost ();
 
 #ifdef ENABLE_IRA_CHECKING
-  if (ira_conflicts_p)
+  if (ira_conflicts_p && ! ira_use_lra_p)
+    /* Opposite to reload pass, LRA does not use any conflict info
+       from IRA.  We don't rebuild conflict info for LRA (through
+       ira_flattening call) and can not use the check here.  We could
+       rebuild this info for LRA in the check mode but there is a risk
+       that code generated with the check and without it will be a bit
+       different.  Calling ira_flattening in any mode would be a
+       wasting CPU time.  So do not check the allocation for LRA.  */
     check_allocation ();
 #endif
 
index c7c82a3e39d8357d7545cf6e0b8cdf002bac49dd..654863e6be4faa7b312bab71515641fdd5df3193 100644 (file)
@@ -1,3 +1,8 @@
+2017-03-28  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/80193
+       * gcc.target/i386/pr80193.c: New.
+
 2017-03-28  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/78661
diff --git a/gcc/testsuite/gcc.target/i386/pr80193.c b/gcc/testsuite/gcc.target/i386/pr80193.c
new file mode 100644 (file)
index 0000000..5bfc039
--- /dev/null
@@ -0,0 +1,196 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+int printf (const char *, ...);
+
+char a, e, h, ag, ak, am, ar, ay, az, bc, bd, k, l;
+int f, i, n, o, c, ac, ad, p, ah, s, aj, al, an, b, ao, aq, at, av, be, t, u, g, q, r, ai, **aa, ap;
+
+int d (int v)
+{ 
+  return v + a;
+}
+
+int j (char v, char w)
+{ 
+  return v - w;
+}
+
+void m (int p)
+{
+}
+
+static void bf ()
+{ 
+  int bg[240], bi, bk, bl, bj, bm = -1;
+  const int *bh;
+  if (h)
+    { 
+      int bn, bo;
+      while (1)
+        { 
+          int *bp = &at;
+          const int **bq = &bh, **br = bq;
+          while (av)
+            while (ah)
+              ;
+          int bs = r, bt;
+          if (bt)
+            break;
+        bu:
+          for (; r; r = d (r))
+            { 
+              *bp = j (q && b, 0);
+              if (n)
+                u = b;
+              if (u && ak)
+                p = 0;
+            }
+          if (c)
+            { 
+              while (a)
+                while (r)
+                  { 
+                    int bw = ar, bx = an;
+                  by:
+                    printf ("%d\n", an);
+                    while (ao)
+                      while (bw)
+                        { 
+                          a = !g || f / g;
+                          if (i)
+                            az = i;
+                          l = j (q && bh, 5);
+                          if (n != 0)
+                            t = l / n;
+                          if (t)
+                            while (bo)
+                              ;
+                        }
+                    while (a)
+                      ;
+                    if (s)
+                      while (bx)
+                        while (1)
+                          { 
+                            if (r)
+                              break;
+                            *aa || q;
+                          }
+                    while (at)
+                      ;
+                  }
+              while (av)
+                if (b)
+                  goto by;
+              while (bl)
+                while (1)
+                  { 
+                    if (r)
+                      break;
+                    while (ag)
+                      if (bi)
+                        printf ("%d\n", 0);
+                    if (bk)
+                      { 
+                        bo = bn = bi = printf ("");
+                        goto bz;
+                      }
+                    while (o)
+                      if (a)
+                        { 
+                          while (1)
+                            ;
+                        ca:
+                          ;
+                        }
+                    if (ap)
+                      while (1)
+                        ;
+                    while (a)
+                      { 
+                        if (ai)
+                          {
+                          bz:
+                            while (be)
+                              if (a)
+                                while (bn)
+                                  bl = bg[am];
+                            while (ac)
+                              if (ad)
+                                { 
+                                  bj++;
+                                  while (bj)
+                                    if (c)
+                                      goto bu;
+                                }
+                            if (s)
+                              { 
+                                while (ao)
+                                  while (f)
+                                    while (p)
+                                      if (e)
+                                        while (bj)
+                                          for (; bo;)
+                                            ;
+                                if (aq)
+                                  { 
+                                    while (aj)
+                                      ;
+                                    continue;
+                                  }
+                                while (1)
+                                  ;
+                              }
+                            while (!bj)
+                              { 
+                                al = 0;
+                                for (; al < 6; al++)
+                                  { 
+                                    ai = 0;
+                                    for (; ai < 60; ai = d (ai))
+                                      { 
+                                        k = !g || f / g;
+                                        if (i)
+                                          ay = 0;
+                                        bc = j (q && *bq, ay);
+                                        if (!n)
+                                          ;
+                                        else
+                                          bd = bc / n;
+                                        if (**bq)
+                                          __builtin_abort ();
+                                        *bp = !aa;
+                                      }
+                                    while (av)
+                                      for (; ai; ai++)
+                                        for (; ar; ar++)
+                                          { 
+                                            int cb;
+                                            *aa = &cb;
+                                          }
+                                    m ((long) &br);
+                                    while (an)
+                                      while (1)
+                                        ;
+                                  }
+                              }
+                          }
+                        o = b;
+                      }
+                    while (bs)
+                      bm++;
+                    while (bm)
+                      ;
+                  }
+            }
+        }
+      goto ca;
+    }
+}
+
+int main ()
+{ 
+  bf ();
+  return 0;
+}