OSDN Git Service

Fix PR42521.
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Jan 2010 07:39:01 +0000 (07:39 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Jan 2010 07:39:01 +0000 (07:39 +0000)
2010-01-07  Sebastian Pop  <sebastian.pop@amd.com>

PR middle-end/42521
* graphite.c (graphite_finalize): Call scev_reset.
(graphite_transform_loops): Do not call scev_reset between the code
generation of scops.

* testsuite/gcc.dg/graphite/pr42521.c: New.

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

gcc/ChangeLog.graphite
gcc/graphite.c
gcc/testsuite/gcc.dg/graphite/pr42521.c [new file with mode: 0644]

index 379e351..165f7eb 100644 (file)
@@ -1,5 +1,14 @@
 2010-01-07  Sebastian Pop  <sebastian.pop@amd.com>
 
+       PR middle-end/42521
+       * graphite.c (graphite_finalize): Call scev_reset.
+       (graphite_transform_loops): Do not call scev_reset between the code
+       generation of scops.
+
+       * testsuite/gcc.dg/graphite/pr42521.c: New.
+
+2010-01-07  Sebastian Pop  <sebastian.pop@amd.com>
+
        * graphite-interchange.c (memory_stride_in_loop): Renamed
        pdr_stride_in_loop.
        (memory_strides_in_loop): Renamed memory_strides_in_loop_1.
index 83d484a..7037a3f 100644 (file)
@@ -228,6 +228,7 @@ graphite_finalize (bool need_cfg_cleanup_p)
 {
   if (need_cfg_cleanup_p)
     {
+      scev_reset ();
       cleanup_tree_cfg ();
       profile_status = PROFILE_ABSENT;
       release_recorded_exits ();
@@ -279,10 +280,7 @@ graphite_transform_loops (void)
        check_poly_representation (scop);
 
       if (transform_done)
-       {
-         scev_reset ();
-         need_cfg_cleanup_p = true;
-       }
+       need_cfg_cleanup_p = true;
     }
 
   htab_delete (bb_pbb_mapping);
diff --git a/gcc/testsuite/gcc.dg/graphite/pr42521.c b/gcc/testsuite/gcc.dg/graphite/pr42521.c
new file mode 100644 (file)
index 0000000..2695df5
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-options "-O3 -fgraphite-identity" } */
+
+extern int *A;
+extern int B[][4];
+
+void foo(int im, int jm, int cond)
+{
+  int i, j;
+  if (cond)
+    for (i = 0; i < 256; i++)
+      A[i] = 0;
+
+  for (i = 0; i < im; i++)
+    for (j = 1; j < jm; j++)
+      if (jm != 8 || j != jm >> 1)
+        B[j][0] ^= B[j-1][0];
+
+}