make FOR_EACH_IMM_USE_STMT safe for early exits
authorAlexandre Oliva <oliva@adacore.com>
Tue, 12 Jan 2021 02:37:59 +0000 (23:37 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Tue, 12 Jan 2021 02:37:59 +0000 (23:37 -0300)
commit640296c367f97a1b9974bfb60bb02c934d71baf4
treedf3eae8c2ec9b2891ef1e53258a47ccd24182fd4
parentab88f3607233376c3145c320e92e71943a495bb5
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.
16 files changed:
gcc/doc/tree-ssa.texi
gcc/gimple-ssa-strength-reduction.c
gcc/graphite-scop-detection.c
gcc/ipa-modref.c
gcc/ipa-pure-const.c
gcc/ipa-sra.c
gcc/ssa-iterators.h
gcc/tree-predcom.c
gcc/tree-ssa-ccp.c
gcc/tree-ssa-dce.c
gcc/tree-ssa-dse.c
gcc/tree-ssa-loop-ivopts.c
gcc/tree-ssa-math-opts.c
gcc/tree-ssa-phiprop.c
gcc/tree-ssa.c
gcc/tree-vect-slp.c