I am testing the follow^W^W^WJeff has tested the following,
applied to trunk.

Richard.

2017-04-12  Richard Biener  <rguent...@suse.de>
        Jeff Law  <l...@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.

Index: gcc/tree-ssa-dse.c
===================================================================
*** gcc/tree-ssa-dse.c  (revision 246871)
--- gcc/tree-ssa-dse.c  (working copy)
*************** maybe_trim_memstar_call (ao_ref *ref, sb
*** 451,457 ****
  static void
  maybe_trim_partially_dead_store (ao_ref *ref, sbitmap live, gimple *stmt)
  {
!   if (is_gimple_assign (stmt))
      {
        switch (gimple_assign_rhs_code (stmt))
        {
--- 451,458 ----
  static void
  maybe_trim_partially_dead_store (ao_ref *ref, sbitmap live, gimple *stmt)
  {
!   if (is_gimple_assign (stmt)
!       && TREE_CODE (gimple_assign_lhs (stmt)) != TARGET_MEM_REF)
      {
        switch (gimple_assign_rhs_code (stmt))
        {
Index: gcc/testsuite/gcc.dg/torture/pr80359.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr80359.c      (nonexistent)
--- gcc/testsuite/gcc.dg/torture/pr80359.c      (working copy)
***************
*** 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;
+     }
+ }

Reply via email to