aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-propagate.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-06-14 17:19:04 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2010-06-14 17:19:04 +0200
commit8ab7d796d82889397ac6b74477be99fc5ee76831 (patch)
tree2b10d5795fae249a32a7b7b093a1cd54da5bdfdb /gcc/tree-ssa-propagate.c
parent7cec010e49d84d5aad737fc040dc693615f81e78 (diff)
downloadgcc-8ab7d796d82889397ac6b74477be99fc5ee76831.zip
gcc-8ab7d796d82889397ac6b74477be99fc5ee76831.tar.gz
gcc-8ab7d796d82889397ac6b74477be99fc5ee76831.tar.bz2
re PR tree-optimization/44508 (libgomp.fortran/vla1.f90 ICE on s390)
PR tree-optimization/44508 * tree-ssa-propagate.h (substitute_and_fold): Add DO_DCE argument. * tree-ssa-propagate.c (substitute_and_fold): If !DO_DCE, don't eliminate trivially dead stmts. * tree-vrp.c (vrp_finalize): Pass false as last argument to substitute_and_fold. * tree-ssa-copy.c (fini_copy_prop): Pass true as last argument to substitute_and_fold. * tree-ssa-ccp.c (ccp_finalize): Likewise. * gcc.dg/tree-ssa/pr21086.c: Adjust. From-SVN: r160749
Diffstat (limited to 'gcc/tree-ssa-propagate.c')
-rw-r--r--gcc/tree-ssa-propagate.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 879e0db..5f2ecce 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -964,10 +964,13 @@ replace_phi_args_in (gimple phi, prop_value_t *prop_value)
If FOLD_FN is non-NULL the function will be invoked on all statements
before propagating values for pass specific simplification.
+ DO_DCE is true if trivially dead stmts can be removed.
+
Return TRUE when something changed. */
bool
-substitute_and_fold (prop_value_t *prop_value, ssa_prop_fold_stmt_fn fold_fn)
+substitute_and_fold (prop_value_t *prop_value, ssa_prop_fold_stmt_fn fold_fn,
+ bool do_dce)
{
basic_block bb;
bool something_changed = false;
@@ -1012,8 +1015,12 @@ substitute_and_fold (prop_value_t *prop_value, ssa_prop_fold_stmt_fn fold_fn)
continue;
/* No point propagating into a stmt whose result is not used,
- but instead we might be able to remove a trivially dead stmt. */
- if (gimple_get_lhs (stmt)
+ but instead we might be able to remove a trivially dead stmt.
+ Don't do this when called from VRP, since the SSA_NAME which
+ is going to be released could be still referenced in VRP
+ ranges. */
+ if (do_dce
+ && gimple_get_lhs (stmt)
&& TREE_CODE (gimple_get_lhs (stmt)) == SSA_NAME
&& has_zero_uses (gimple_get_lhs (stmt))
&& !stmt_could_throw_p (stmt)