aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-im.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-05-15 08:37:22 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-05-15 08:37:22 +0000
commit8ded35f90c50bd3ff06e75f0bc90dc611360dcac (patch)
tree99049872595c742fb546abf5ae46e4c0ed30cf52 /gcc/tree-ssa-loop-im.c
parent45ff5edaea467950434730376d3abd8e6cebe196 (diff)
downloadgcc-8ded35f90c50bd3ff06e75f0bc90dc611360dcac.zip
gcc-8ded35f90c50bd3ff06e75f0bc90dc611360dcac.tar.gz
gcc-8ded35f90c50bd3ff06e75f0bc90dc611360dcac.tar.bz2
re PR tree-optimization/36009 (PRE causes missed loop store motion, store sinking doesn't work)
2008-05-15 Richard Guenther <rguenther@suse.de> PR tree-optimization/36009 PR tree-optimization/36204 * tree-ssa-loop-im.c (tree-ssa-propagate.h): Include. (determine_invariantness_stmt): Record the loop a store is always executed in. * Makefile.in (tree-ssa-loop-im.o): Add tree-ssa-propagate.h dependency. * gcc.dg/tree-ssa/ssa-lim-5.c: New testcase. * gcc.dg/tree-ssa/ssa-lim-6.c: Likewise.. From-SVN: r135330
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
-rw-r--r--gcc/tree-ssa-loop-im.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index ba36343..8740030 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see
#include "hashtab.h"
#include "tree-affine.h"
#include "pointer-set.h"
+#include "tree-ssa-propagate.h"
/* TODO: Support for predicated code motion. I.e.
@@ -900,6 +901,14 @@ determine_invariantness_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED,
maybe_never = true;
outermost = NULL;
}
+ /* Make sure to note always_executed_in for stores to make
+ store-motion work. */
+ else if (stmt_makes_single_store (stmt))
+ {
+ stmt_ann (stmt)->common.aux
+ = xcalloc (1, sizeof (struct lim_aux_data));
+ LIM_DATA (stmt)->always_executed_in = outermost;
+ }
continue;
}