re PR tree-optimization/80359 (DSE causes error: invalid reference prefix)
authorRichard Biener <rguenther@suse.de>
Wed, 12 Apr 2017 13:47:26 +0000 (13:47 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 12 Apr 2017 13:47:26 +0000 (13:47 +0000)
2017-04-12  Richard Biener  <rguenther@suse.de>
Jeff Law  <law@redhat.com>

PR tree-optimization/80359
* tree-ssa-dse.c (maybe_trim_partially_dead_store): Do not
trim stores to TARGET_MEM_REFs.

* gcc.dg/torture/pr80359.c: New testcase.

Co-Authored-By: Jeff Law <law@redhat.com>
From-SVN: r246875

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr80359.c [new file with mode: 0644]
gcc/tree-ssa-dse.c

index d59a0e997ee528b9ecfe1456e15cb70d70bb495d..1f98b8823af0eaedab26d5e93e1e241d8aa5fff1 100644 (file)
@@ -1,3 +1,10 @@
+2017-04-12  Richard Biener  <rguenther@suse.de>
+       Jeff Law  <law@redhat.com>
+
+       PR tree-optimization/80359
+       * tree-ssa-dse.c (maybe_trim_partially_dead_store): Do not
+       trim stores to TARGET_MEM_REFs.
+
 2017-04-12  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/79390
index 115e1233dc00547a0055d314c5f550fe3210a48f..bc2424a1d6fc0e0a901fe22dce11ee0d7b1b858a 100644 (file)
@@ -1,3 +1,9 @@
+2017-04-12  Richard Biener  <rguenther@suse.de>
+       Jeff Law  <law@redhat.com>
+
+       PR tree-optimization/80359
+       * gcc.dg/torture/pr80359.c: New testcase.
+
 2017-04-12  Richard Biener  <rguenther@suse.de>
        Bernd Edlinger  <bernd.edlinger@hotmail.de>
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr80359.c b/gcc/testsuite/gcc.dg/torture/pr80359.c
new file mode 100644 (file)
index 0000000..89b3d53
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+void FFT(_Complex *X, int length)
+{
+  unsigned i, j;
+  for (; i < length; i++)
+    {
+      X[i] = 0;
+      for (j = 0; j < length; j++)
+       X[i] = X[i] / length;
+    }
+}
index 53feaf3f4f763e68e4b5c862efd62c9170f67786..90230abe822e50d4c1c4fbe0ade9c355c6db55ca 100644 (file)
@@ -451,7 +451,8 @@ maybe_trim_memstar_call (ao_ref *ref, sbitmap live, gimple *stmt)
 static void
 maybe_trim_partially_dead_store (ao_ref *ref, sbitmap live, gimple *stmt)
 {
-  if (is_gimple_assign (stmt))
+  if (is_gimple_assign (stmt)
+      && TREE_CODE (gimple_assign_lhs (stmt)) != TARGET_MEM_REF)
     {
       switch (gimple_assign_rhs_code (stmt))
        {