re PR tree-optimization/36508 (ICE in compute_antic)
authorJakub Jelinek <jakub@redhat.com>
Mon, 23 Jun 2008 11:51:34 +0000 (13:51 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 23 Jun 2008 11:51:34 +0000 (13:51 +0200)
PR tree-optimization/36508
* tree-ssa-pre.c (compute_antic): Allow num_iterations up to
499, don't check it at all in release compilers.

* gcc.dg/pr36508.c: New test.

From-SVN: r137036

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr36508.c [new file with mode: 0644]
gcc/tree-ssa-pre.c

index b91ebd197bcc0adec443c9553daed02dbaddfb98..409f5040a24ebfca323ef4839095b086fa325e91 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/36508
+       * tree-ssa-pre.c (compute_antic): Allow num_iterations up to
+       499, don't check it at all in release compilers.
+
 2008-06-23  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.md (*fop_<mode>_1_i387): Use SSE_FLOAT_MODE_P
index 71de4be63cee01a2ce2a13fbfea95bdd34549cc6..1eaff577cc78c7072e9eb2590803029b5c233efc 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/36508
+       * gcc.dg/pr36508.c: New test.
+
 2008-06-20  Joseph Myers  <joseph@codesourcery.com>
 
        * gcc.dg/inline-31.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr36508.c b/gcc/testsuite/gcc.dg/pr36508.c
new file mode 100644 (file)
index 0000000..3048992
--- /dev/null
@@ -0,0 +1,29 @@
+/* PR tree-optimization/36508 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-pre" } */
+
+void
+foo (short *sp)
+{
+  int k;
+  k = 1;
+#define SP0 *sp++ = 1;
+  while (1)
+    {
+      if (k > 6)
+       break;
+      SP0
+      k++;
+    }
+  k = 1;
+  while (1)
+    {
+      if (k > 6)
+       break;
+      SP0
+      k++;
+    }
+#define SP1 SP0 SP0 SP0 SP0 SP0 SP0 SP0 SP0 SP0 SP0 SP0
+#define SP2 SP1 SP1 SP1 SP1 SP1 SP1 SP1 SP1 SP1 SP1 SP1
+  SP2
+}
index 3f3aae777e1a460852468cd62e4c86e9b88471e1..423afe04785f64da14cbac7bd642cf0c2983372f 100644 (file)
@@ -2094,8 +2094,10 @@ compute_antic (void)
                                                      block->index));
            }
        }
+#ifdef ENABLE_CHECKING
       /* Theoretically possible, but *highly* unlikely.  */
-      gcc_assert (num_iterations < 50);
+      gcc_assert (num_iterations < 500);
+#endif
     }
 
   statistics_histogram_event (cfun, "compute_antic iterations",
@@ -2124,8 +2126,10 @@ compute_antic (void)
                                                            block->index));
                }
            }
+#ifdef ENABLE_CHECKING
          /* Theoretically possible, but *highly* unlikely.  */
-         gcc_assert (num_iterations < 50);
+         gcc_assert (num_iterations < 500);
+#endif
        }
       statistics_histogram_event (cfun, "compute_partial_antic iterations",
                                  num_iterations);