diff options
author | Richard Biener <rguenther@suse.de> | 2021-10-13 13:42:22 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-10-13 15:12:43 +0200 |
commit | 489c8f27296362dcfbc967aecef17ba7c5cab0f2 (patch) | |
tree | 3715aaa30654be1c67d3969cf5356d985828e8e4 /gcc/tree-if-conv.c | |
parent | e415bc4c035b1b655cf2cafcbe515382d1cefc93 (diff) | |
download | gcc-489c8f27296362dcfbc967aecef17ba7c5cab0f2.zip gcc-489c8f27296362dcfbc967aecef17ba7c5cab0f2.tar.gz gcc-489c8f27296362dcfbc967aecef17ba7c5cab0f2.tar.bz2 |
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.
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r-- | gcc/tree-if-conv.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index 6a67acf..0b6b07c 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -2582,11 +2582,7 @@ predicate_statements (loop_p loop) { gsi_remove (&gsi, true); gsi_insert_seq_before (&gsi, rewrite_to_defined_overflow (stmt), - GSI_SAME_STMT); - if (gsi_end_p (gsi)) - gsi = gsi_last_bb (gimple_bb (stmt)); - else - gsi_prev (&gsi); + GSI_LAST_NEW_STMT); } else if (gimple_vdef (stmt)) { |