public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] tree-optimization/94352 - fix uninitialized use of curr_order
@ 2020-03-27 12:54 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2020-03-27 12:54 UTC (permalink / raw)
  To: gcc-patches

This fixes a (harmless) use of a not re-initialized curr_order.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

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.
---
 gcc/tree-ssa-propagate.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 06d4b2a74c7..2fad2472775 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)
-- 
2.12.3

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-27 12:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-27 12:54 [PATCH] tree-optimization/94352 - fix uninitialized use of curr_order Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).