This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR46404: call scev_reset to reset the number of iterations as well.


Hi,

I committed this patch to trunk to force graphite to reset the number
of iterations expressions between the code generation of scops: the
SSA names used in the niter expressions could be invalid after the
graphite code generation.  This passed regstrap on amd64-linux.

Sebastian

2010-12-15  Sebastian Pop  <sebastian.pop@amd.com>

	PR tree-optimization/46404
	* graphite-clast-to-gimple.c (gloog): Call scev_reset.

	* gcc.dg/graphite/pr46404-1.c: New.
---
 gcc/ChangeLog                             |    5 +++++
 gcc/graphite-clast-to-gimple.c            |    2 +-
 gcc/testsuite/ChangeLog                   |    5 +++++
 gcc/testsuite/gcc.dg/graphite/pr46404-1.c |   27 +++++++++++++++++++++++++++
 4 files changed, 38 insertions(+), 1 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/graphite/pr46404-1.c

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f99ec93..42ea2ac 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-15  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR tree-optimization/46404
+	* graphite-clast-to-gimple.c (gloog): Call scev_reset.
+
 2010-12-14  Jan Hubicka  <jh@suse.cz>
 
 	* tree.c (get_file_function_name): Avoid using random seed on GLOBAL_sub_I
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 4894b52..eef5ad1 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -1555,7 +1555,7 @@ gloog (scop_p scop, htab_t bb_pbb_mapping)
 		   &newivs, newivs_index,
 		   bb_pbb_mapping, 1, params_index);
   graphite_verify ();
-  scev_reset_htab ();
+  scev_reset ();
   recompute_all_dominators ();
   graphite_verify ();
 
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c10535c..ba55a34 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,6 +1,11 @@
 2010-12-15  Sebastian Pop  <sebastian.pop@amd.com>
 
 	PR tree-optimization/46404
+	* gcc.dg/graphite/pr46404-1.c: New.
+
+2010-12-15  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR tree-optimization/46404
 	* gcc.dg/graphite/pr46404.c: New.
 
 2010-12-15  Jakub Jelinek  <jakub@redhat.com>
diff --git a/gcc/testsuite/gcc.dg/graphite/pr46404-1.c b/gcc/testsuite/gcc.dg/graphite/pr46404-1.c
new file mode 100644
index 0000000..c3e620c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr46404-1.c
@@ -0,0 +1,27 @@
+/* { dg-options "-O -fgraphite-identity -fno-tree-scev-cprop" } */
+
+int
+huft_build (unsigned *b)
+{
+  int k;
+  for (k = 0; k <= 10; k++)
+    if (foo ());
+}
+int
+inflate_fixed ()
+{
+  int i;
+  unsigned l[288];
+  for (i = 0; i < 144; i++)
+    l[i] = 8;
+  for (; i < 256; i++)
+    l[i] = 9;
+  for (; i < 280; i++)
+    l[i] = 7;
+  for (; i < 288; i++)
+    l[i] = 8;
+  if ((i = huft_build (l)) != 0)
+    return i;
+  for (i = 0; i < 30; i++)
+    l[i] = 5;
+}
-- 
1.7.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]