From 640296c367f97a1b9974bfb60bb02c934d71baf4 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 11 Jan 2021 23:37:59 -0300 Subject: 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. --- gcc/tree-vect-slp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/tree-vect-slp.c') diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index e7191ed..877d44b 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -3857,7 +3857,7 @@ vect_bb_slp_mark_live_stmts (bb_vec_info bb_vinfo, slp_tree node, mark_visited = false; else STMT_VINFO_LIVE_P (stmt_info) = false; - BREAK_FROM_IMM_USE_STMT (use_iter); + break; } } /* We have to verify whether we can insert the lane extract @@ -4124,7 +4124,7 @@ vect_bb_slp_scalar_cost (vec_info *vinfo, (vect_stmt_to_vectorize (use_stmt_info))) { (*life)[i] = true; - BREAK_FROM_IMM_USE_STMT (use_iter); + break; } } } -- cgit v1.1