aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-pure-const.c
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2021-01-11 23:37:59 -0300
committerAlexandre Oliva <oliva@gnu.org>2021-01-11 23:37:59 -0300
commit640296c367f97a1b9974bfb60bb02c934d71baf4 (patch)
treedf3eae8c2ec9b2891ef1e53258a47ccd24182fd4 /gcc/ipa-pure-const.c
parentab88f3607233376c3145c320e92e71943a495bb5 (diff)
downloadgcc-640296c367f97a1b9974bfb60bb02c934d71baf4.zip
gcc-640296c367f97a1b9974bfb60bb02c934d71baf4.tar.gz
gcc-640296c367f97a1b9974bfb60bb02c934d71baf4.tar.bz2
make FOR_EACH_IMM_USE_STMT safe for early exits
Use a dtor to automatically remove ITER from IMM_USE list in FOR_EACH_IMM_USE_STMT. for gcc/ChangeLog * ssa-iterators.h (end_imm_use_stmt_traverse): Forward declare. (auto_end_imm_use_stmt_traverse): New struct. (FOR_EACH_IMM_USE_STMT): Use it. (BREAK_FROM_IMM_USE_STMT, RETURN_FROM_IMM_USE_STMT): Remove, along with uses... * gimple-ssa-strength-reduction.c: ... here, ... * graphite-scop-detection.c: ... here, ... * ipa-modref.c, ipa-pure-const.c, ipa-sra.c: ... here, ... * tree-predcom.c, tree-ssa-ccp.c: ... here, ... * tree-ssa-dce.c, tree-ssa-dse.c: ... here, ... * tree-ssa-loop-ivopts.c, tree-ssa-math-opts.c: ... here, ... * tree-ssa-phiprop.c, tree-ssa.c: ... here, ... * tree-vect-slp.c: ... and here, ... * doc/tree-ssa.texi: ... and the example here.
Diffstat (limited to 'gcc/ipa-pure-const.c')
-rw-r--r--gcc/ipa-pure-const.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 66f2177..957217a 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -842,20 +842,20 @@ check_retval_uses (tree retval, gimple *stmt)
{
tree op2 = gimple_cond_rhs (cond);
if (!integer_zerop (op2))
- RETURN_FROM_IMM_USE_STMT (use_iter, false);
+ return false;
}
else if (gassign *ga = dyn_cast<gassign *> (use_stmt))
{
enum tree_code code = gimple_assign_rhs_code (ga);
if (TREE_CODE_CLASS (code) != tcc_comparison)
- RETURN_FROM_IMM_USE_STMT (use_iter, false);
+ return false;
if (!integer_zerop (gimple_assign_rhs2 (ga)))
- RETURN_FROM_IMM_USE_STMT (use_iter, false);
+ return false;
}
else if (is_gimple_debug (use_stmt))
;
else if (use_stmt != stmt)
- RETURN_FROM_IMM_USE_STMT (use_iter, false);
+ return false;
return true;
}