From 94fc7deae27a373460b7b2c6c1995f0de21c3bec Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Mon, 16 Jul 2001 16:48:31 +0000 Subject: [PATCH] dominance.c (calc_dfs_tree_nonrec): Reverse order of tests in if statement so we don't access undefined memory. * dominance.c (calc_dfs_tree_nonrec): Reverse order of tests in if statement so we don't access undefined memory. From-SVN: r44043 --- gcc/ChangeLog | 5 +++++ gcc/dominance.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e22f06fcae4..b80e0152e7a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-07-16 Steve Ellcey + + * dominance.c (calc_dfs_tree_nonrec): Reverse order of tests + in if statement so we don't access undefined memory. + 2001-07-16 Daniel Berlin * ssa-ccp.c: (optimize_unexecutable_edges): Add note about removal diff --git a/gcc/dominance.c b/gcc/dominance.c index 66ff11e2bae..8f5e0d370a0 100644 --- a/gcc/dominance.c +++ b/gcc/dominance.c @@ -242,7 +242,7 @@ calc_dfs_tree_nonrec (di, bb, reverse) /* If the next node BN is either already visited or a border block the current edge is useless, and simply overwritten with the next edge out of the current node. */ - if (di->dfs_order[bn->index] || bn == ex_block) + if (bn == ex_block || di->dfs_order[bn->index]) { e = e->pred_next; continue; @@ -253,7 +253,7 @@ calc_dfs_tree_nonrec (di, bb, reverse) else { bn = e->dest; - if (di->dfs_order[bn->index] || bn == ex_block) + if (bn == ex_block || di->dfs_order[bn->index]) { e = e->succ_next; continue; -- 2.30.2