From 940c9a7c2cf3bbbf43b0602c9283bf7579cf05ec Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 12 Apr 2017 13:47:26 +0000 Subject: [PATCH] re PR tree-optimization/80359 (DSE causes error: invalid reference prefix) 2017-04-12 Richard Biener Jeff Law 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 From-SVN: r246875 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/torture/pr80359.c | 12 ++++++++++++ gcc/tree-ssa-dse.c | 3 ++- 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr80359.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d59a0e997ee..1f98b8823af 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-04-12 Richard Biener + Jeff Law + + 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 PR tree-optimization/79390 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 115e1233dc0..bc2424a1d6f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-04-12 Richard Biener + Jeff Law + + PR tree-optimization/80359 + * gcc.dg/torture/pr80359.c: New testcase. + 2017-04-12 Richard Biener Bernd Edlinger diff --git a/gcc/testsuite/gcc.dg/torture/pr80359.c b/gcc/testsuite/gcc.dg/torture/pr80359.c new file mode 100644 index 00000000000..89b3d530528 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr80359.c @@ -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; + } +} diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c index 53feaf3f4f7..90230abe822 100644 --- a/gcc/tree-ssa-dse.c +++ b/gcc/tree-ssa-dse.c @@ -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)) { -- 2.30.2