diff options
author | Richard Biener <rguenther@suse.de> | 2018-03-08 14:41:39 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-03-08 14:41:39 +0000 |
commit | 24545562ca5ece2615f8178ad6c6eb0be4fe6b3f (patch) | |
tree | 433242ce368d596cca18cadd75987dba9d2b4c25 /gcc/tree-scalar-evolution.c | |
parent | 7fea20f6b8dc2cd598502145ce7ec93091b1bb44 (diff) | |
download | gcc-24545562ca5ece2615f8178ad6c6eb0be4fe6b3f.zip gcc-24545562ca5ece2615f8178ad6c6eb0be4fe6b3f.tar.gz gcc-24545562ca5ece2615f8178ad6c6eb0be4fe6b3f.tar.bz2 |
re PR tree-optimization/84552 (Compile time hog w/ -O2 -floop-nest-optimize -fno-tree-copy-prop -fno-tree-fre -fno-tree-loop-ivcanon)
2018-03-08 Richard Biener <rguenther@suse.de>
PR middle-end/84552
* tree-scalar-evolution.c: Include tree-into-ssa.h.
(follow_copies_to_constant): Do not follow SSA names registered
for update.
* gcc.dg/graphite/pr84552.c: New testcase.
From-SVN: r258365
Diffstat (limited to 'gcc/tree-scalar-evolution.c')
-rw-r--r-- | gcc/tree-scalar-evolution.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 0ba1aa8..fefc9de 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -280,6 +280,7 @@ along with GCC; see the file COPYING3. If not see #include "params.h" #include "tree-ssa-propagate.h" #include "gimple-fold.h" +#include "tree-into-ssa.h" static tree analyze_scalar_evolution_1 (struct loop *, tree); static tree analyze_scalar_evolution_for_address_of (struct loop *loop, @@ -1540,7 +1541,10 @@ static tree follow_copies_to_constant (tree var) { tree res = var; - while (TREE_CODE (res) == SSA_NAME) + while (TREE_CODE (res) == SSA_NAME + /* We face not updated SSA form in multiple places and this walk + may end up in sibling loops so we have to guard it. */ + && !name_registered_for_update_p (res)) { gimple *def = SSA_NAME_DEF_STMT (res); if (gphi *phi = dyn_cast <gphi *> (def)) |