]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Use SSA_NAME_DEF_STMT only on SSA_NAMEs.
authorSebastian Pop <sebastian.pop@amd.com>
Wed, 11 Aug 2010 20:29:35 +0000 (20:29 +0000)
committerSebastian Pop <spop@gcc.gnu.org>
Wed, 11 Aug 2010 20:29:35 +0000 (20:29 +0000)
2010-07-22  Sebastian Pop  <sebastian.pop@amd.com>

* graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Use
SSA_NAME_DEF_STMT only on SSA_NAMEs.

* gcc.dg/graphite/id-24.c: New.

From-SVN: r163156

gcc/ChangeLog
gcc/ChangeLog.graphite
gcc/graphite-sese-to-poly.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/graphite/id-24.c [new file with mode: 0644]

index 4b46d2631fbcc83a165668327e876757e754b546..15b5acf22b5b14838d0f50e86e76fa8feb4c8f32 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Use
+       SSA_NAME_DEF_STMT only on SSA_NAMEs.
+
 2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
 
        * tree-scalar-evolution.c (instantiate_scev_name): Do not
index 155e396165680b58eab26dda276d0cf602914787..1ae2bf2163b2dc18b7fb81b6c8f1e18bda5e4977 100644 (file)
@@ -1,3 +1,10 @@
+2010-07-22  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Use
+       SSA_NAME_DEF_STMT only on SSA_NAMEs.
+
+       * gcc.dg/graphite/id-24.c: New.
+
 2010-07-22  Sebastian Pop  <sebastian.pop@amd.com>
 
        * tree-scalar-evolution.c (instantiate_scev_name): Do not
index 81b2dc250aa2687d144ab99747e70bd28dbe8b6a..084dd31cf52ccccf3d087ec861dfbfcc36c717c2 100644 (file)
@@ -2256,7 +2256,8 @@ rewrite_phi_out_of_ssa (gimple_stmt_iterator *psi)
 
       /* Avoid the insertion of code in the loop latch to please the
         pattern matching of the vectorizer.  */
-      if (e->src == bb->loop_father->latch)
+      if (TREE_CODE (arg) == SSA_NAME
+         && e->src == bb->loop_father->latch)
        insert_out_of_ssa_copy (zero_dim_array, arg, SSA_NAME_DEF_STMT (arg));
       else
        insert_out_of_ssa_copy_on_edge (e, zero_dim_array, arg);
index 553e567ae89cff13c78f031293d5461bc3e8bae9..fe463045de795a4c09654e9b7b36c43f1f4d8382 100644 (file)
@@ -1,3 +1,7 @@
+2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * gcc.dg/graphite/id-24.c: New.
+
 2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
 
        * gcc.dg/tree-ssa/pr20742.c: New.
diff --git a/gcc/testsuite/gcc.dg/graphite/id-24.c b/gcc/testsuite/gcc.dg/graphite/id-24.c
new file mode 100644 (file)
index 0000000..d466069
--- /dev/null
@@ -0,0 +1,22 @@
+/* gcc.dg/tree-ssa/loadpre23.c used to ICE with Graphite.  */
+
+struct {
+  int a;
+  int large[100];
+} x;
+
+int foo(int argc)
+{
+  int b;
+  int c;
+  int i;
+  int d, e;
+
+  for (i = 0; i < argc; i++)
+    {
+      e = x.a;
+      x.a = 9;
+    }
+  return d + e;
+}
+