This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa] [PATCH]: Fix PRE in presence of pre-pass DCE


DCE screws up the dom_children, but doesn't invalidate it or anything of
the sort, or do the nice thing, like fix them.
:)

2003-07-14  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-pre.c (tree_perform_ssapre): Fix dom_children after DCE
	breaks them.

Index: tree-ssa-pre.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-pre.c,v
retrieving revision 1.1.4.62
diff -u -3 -p -r1.1.4.62 tree-ssa-pre.c
--- tree-ssa-pre.c	5 Jul 2003 18:30:32 -0000	1.1.4.62
+++ tree-ssa-pre.c	15 Jul 2003 00:24:41 -0000
@@ -3257,8 +3257,14 @@ tree_perform_ssapre (tree fndecl)

   /* Compute immediate dominators.  */
   pre_idom = calculate_dominance_info (CDI_DOMINATORS);
-  fixup_domchildren (pre_idom);
+
+  /* DCE screws the dom_children up, without bothering to fix it. So fix it. */
   currbbs = n_basic_blocks;
+  for (i = 0; i < currbbs; i++)
+    if (dom_children (BASIC_BLOCK (i)))
+      bitmap_clear (dom_children (BASIC_BLOCK (i)));
+  fixup_domchildren (pre_idom);
+
   /* Compute dominance frontiers.  */
   pre_dfs = (bitmap *) xmalloc (sizeof (bitmap) * currbbs);
   for (i = 0; i < currbbs; i++)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]