This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] Use FOR_EACH_BB in build_dominator_tree
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 26 Aug 2003 20:23:01 +0200
- Subject: [tree-ssa] Use FOR_EACH_BB in build_dominator_tree
Hello,
in general it is not a good idea to expect basic blocks to be contiguous
with indices from 0 to n_basic_blocks - 1 -- even if it is true now
on the particular place, it might change somewhen.
Commited as obvious.
Zdenek
* tree-ssa.c (build_dominator_tree): Use FOR_EACH_BB.
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.121
diff -c -3 -p -r1.1.4.121 tree-ssa.c
*** tree-ssa.c 25 Aug 2003 02:44:23 -0000 1.1.4.121
--- tree-ssa.c 26 Aug 2003 18:15:47 -0000
*************** rewrite_into_ssa (tree fndecl, sbitmap v
*** 410,420 ****
void
build_dominator_tree (dominance_info idom)
{
- int i;
basic_block bb;
! for (i = 0; i < n_basic_blocks; i++)
! clear_dom_children (BASIC_BLOCK (i));
/* Using the immediate dominators, build a dominator tree. */
FOR_EACH_BB (bb)
--- 410,419 ----
void
build_dominator_tree (dominance_info idom)
{
basic_block bb;
! FOR_EACH_BB (bb)
! clear_dom_children (bb);
/* Using the immediate dominators, build a dominator tree. */
FOR_EACH_BB (bb)