]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add GSI_LAST_NEW_STMT iterator update
authorRichard Biener <rguenther@suse.de>
Wed, 13 Oct 2021 11:42:22 +0000 (13:42 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 13 Oct 2021 13:12:43 +0000 (15:12 +0200)
commit489c8f27296362dcfbc967aecef17ba7c5cab0f2
tree3715aaa30654be1c67d3969cf5356d985828e8e4
parente415bc4c035b1b655cf2cafcbe515382d1cefc93
Add GSI_LAST_NEW_STMT iterator update

Currently when adding a sequence before there's no way to get the
iterator placed at the last added stmt which results in convoluted
code in the if-conversion usecase.  The following adds
GSI_LAST_NEW_STMT and corrects one obvious mistake in
execute_update_addresses_taken as well as tries to avoid the
just filed PR102726 by biasing the enum values to be outside of
the boolean 0/1 range.

2021-10-13  Richard Biener  <rguenther@suse.de>

* gimple-iterator.h (gsi_iterator_update): Add GSI_LAST_NEW_STMT,
start at integer value 2.
* gimple-iterator.c (gsi_insert_seq_nodes_before): Update
the iterator for GSI_LAST_NEW_STMT.
(gsi_insert_seq_nodes_after): Likewise.
* tree-if-conv.c (predicate_statements): Use GSI_LAST_NEW_STMT.
* tree-ssa.c (execute_update_addresses_taken): Correct bogus
arguments to gsi_replace.
gcc/gimple-iterator.c
gcc/gimple-iterator.h
gcc/tree-if-conv.c
gcc/tree-ssa.c