This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR80359
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: law at redhat dot com
- Date: Wed, 12 Apr 2017 15:34:04 +0200 (CEST)
- Subject: [PATCH] Fix PR80359
- Authentication-results: sourceware.org; auth=none
I am testing the follow^W^W^WJeff has tested the following,
applied to trunk.
Richard.
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.
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;
+ }
+ }