public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] init uids in tree-ssa-reassoc
@ 2023-07-27 15:15 Alexandre Oliva
  0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2023-07-27 15:15 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:11efcde8f12499f41dd286a0416eef84418718ed

commit 11efcde8f12499f41dd286a0416eef84418718ed
Author: Alexandre Oliva <oliva@gnu.org>
Date:   Thu Jul 27 12:12:21 2023 -0300

    init uids in tree-ssa-reassoc

Diff:
---
 gcc/tree-ssa-reassoc.cc | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gcc/tree-ssa-reassoc.cc b/gcc/tree-ssa-reassoc.cc
index eda03bf98a6..2a0ea45118f 100644
--- a/gcc/tree-ssa-reassoc.cc
+++ b/gcc/tree-ssa-reassoc.cc
@@ -7254,6 +7254,22 @@ init_reassoc (void)
   free (bbs);
   calculate_dominance_info (CDI_POST_DOMINATORS);
   plus_negates = vNULL;
+
+  /* Make sure gimple uids are initialized; we rely on them in
+     reassoc_stmt_dominates_stmt_p.  */
+  basic_block bb;
+  FOR_EACH_BB_FN (bb, cfun)
+    {
+      unsigned int uid = 1;
+
+      for (gimple_stmt_iterator gsi = gsi_start_bb (bb);
+	   !gsi_end_p (gsi); gsi_next (&gsi))
+	{
+	  gimple *stmt = gsi_stmt (gsi);
+	  gimple_set_visited (stmt, false);
+	  gimple_set_uid (stmt, uid++);
+	}
+    }
 }
 
 /* Cleanup after the reassociation pass, and print stats if

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

only message in thread, other threads:[~2023-07-27 15:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-27 15:15 [gcc(refs/users/aoliva/heads/testme)] init uids in tree-ssa-reassoc Alexandre Oliva

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).