aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-propagate.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-03-27 13:52:31 +0100
committerRichard Biener <rguenther@suse.de>2020-03-27 13:55:22 +0100
commit917e21e8bcddf5047ee0ced063fca412ad81ce7f (patch)
tree712940243609094303e281ecb23793f08e976b13 /gcc/tree-ssa-propagate.c
parent62ede14d30f5d083f1ab23bcab6e0e3c9c649006 (diff)
downloadgcc-917e21e8bcddf5047ee0ced063fca412ad81ce7f.zip
gcc-917e21e8bcddf5047ee0ced063fca412ad81ce7f.tar.gz
gcc-917e21e8bcddf5047ee0ced063fca412ad81ce7f.tar.bz2
tree-optimization/94352 - fix uninitialized use of curr_order
This fixes a (harmless) use of a not re-initialized curr_order. 2020-03-27 Richard Biener <rguenther@suse.de> PR tree-optimization/94352 * tree-ssa-propagate.c (ssa_prop_init): Move seeding of the worklist ... (ssa_propagation_engine::ssa_propagate): ... here after initializing curr_order.
Diffstat (limited to 'gcc/tree-ssa-propagate.c')
-rw-r--r--gcc/tree-ssa-propagate.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 06d4b2a..2fad247 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -421,14 +421,6 @@ ssa_prop_init (void)
e->flags &= ~EDGE_EXECUTABLE;
}
uid_to_stmt.safe_grow (gimple_stmt_max_uid (cfun));
-
- /* Seed the algorithm by adding the successors of the entry block to the
- edge worklist. */
- FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR_FOR_FN (cfun)->succs)
- {
- e->flags &= ~EDGE_EXECUTABLE;
- add_control_edge (e);
- }
}
@@ -758,7 +750,16 @@ ssa_propagation_engine::ssa_propagate (void)
/* Iterate until the worklists are empty. We iterate both blocks
and stmts in RPO order, using sets of two worklists to first
- complete the current iteration before iterating over backedges. */
+ complete the current iteration before iterating over backedges.
+ Seed the algorithm by adding the successors of the entry block to the
+ edge worklist. */
+ edge e;
+ edge_iterator ei;
+ FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR_FOR_FN (cfun)->succs)
+ {
+ e->flags &= ~EDGE_EXECUTABLE;
+ add_control_edge (e);
+ }
while (1)
{
int next_block_order = (bitmap_empty_p (cfg_blocks)