OSDN Git Service

PR tree-optimization/36508
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Jun 2008 11:51:34 +0000 (11:51 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Jun 2008 11:51:34 +0000 (11:51 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137036 138bc75d-0d04-0410-961f-82ee72b054a4

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

index b91ebd1..409f504 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 71de4be..1eaff57 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 3f3aae7..423afe0 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);