diff options
author | Richard Biener <rguenther@suse.de> | 2018-09-24 07:08:24 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-09-24 07:08:24 +0000 |
commit | e78c3eb320a5352c55583dfd8856759ac5045e30 (patch) | |
tree | 2e4bed12d0886eda92cad130e21384352245aeed /gcc/tree-ssa-propagate.c | |
parent | e528260d8fa487d0087b42c157ec9972d99049d5 (diff) | |
download | gcc-e78c3eb320a5352c55583dfd8856759ac5045e30.zip gcc-e78c3eb320a5352c55583dfd8856759ac5045e30.tar.gz gcc-e78c3eb320a5352c55583dfd8856759ac5045e30.tar.bz2 |
re PR middle-end/63155 (memory hog)
2018-09-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/63155
* tree-ssa-propagate.c (add_ssa_edge): Avoid adding PHIs to
the worklist when the edge of the respective argument isn't
executable.
From-SVN: r264523
Diffstat (limited to 'gcc/tree-ssa-propagate.c')
-rw-r--r-- | gcc/tree-ssa-propagate.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c index 9f67a9a..140b153 100644 --- a/gcc/tree-ssa-propagate.c +++ b/gcc/tree-ssa-propagate.c @@ -168,10 +168,18 @@ add_ssa_edge (tree var) FOR_EACH_IMM_USE_FAST (use_p, iter, var) { gimple *use_stmt = USE_STMT (use_p); + basic_block use_bb = gimple_bb (use_stmt); /* If we did not yet simulate the block wait for this to happen and do not add the stmt to the SSA edge worklist. */ - if (! (gimple_bb (use_stmt)->flags & BB_VISITED)) + if (! (use_bb->flags & BB_VISITED)) + continue; + + /* If this is a use on a not yet executable edge do not bother to + queue it. */ + if (gimple_code (use_stmt) == GIMPLE_PHI + && !(EDGE_PRED (use_bb, PHI_ARG_INDEX_FROM_USE (use_p))->flags + & EDGE_EXECUTABLE)) continue; if (prop_simulate_again_p (use_stmt) |