This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa][PATCH]: Fix dfs_id/dfn arrays in tree-ssa-pre
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 22 Nov 2003 00:09:23 -0500 (EST)
- Subject: [tree-ssa][PATCH]: Fix dfs_id/dfn arrays in tree-ssa-pre
Small bug, the symptoms of which were noticed by honza.
fast_a_dominates_b wasn't returning the right value for block 0, because
I used if (bb->index > 0) rather than if (bb->index >= 0) when building
the arrays.
Fix thusly.
--Dan
2003-11-22 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-pre.c (build_dfs_id_array_1): > should be >=
(build_dfn_array): Ditto.
Index: gcc/tree-ssa-pre.c
===================================================================
--- gcc.orig/tree-ssa-pre.c 2003-11-21 20:21:27.000000000 -0500
+++ gcc/tree-ssa-pre.c 2003-11-22 00:00:52.000000000 -0500
@@ -900,7 +900,7 @@
build_dfs_id_array_1 (basic_block bb, int *id)
{
int i;
- if (bb->index > 0)
+ if (bb->index >= 0)
dfs_id[bb->index] = *id;
++(*id);
@@ -909,7 +909,7 @@
{
build_dfs_id_array_1 (BASIC_BLOCK (i), id);
});
- if (bb->index > 0)
+ if (bb->index >= 0)
dfs_id_last[bb->index] = *id - 1;
}
@@ -932,7 +932,7 @@
build_dfn_array (basic_block bb, int num)
{
int i;
- if (bb->index > 0)
+ if (bb->index >= 0)
dfn[bb->index] = num;
if (dom_children (bb))
EXECUTE_IF_SET_IN_BITMAP (dom_children (bb), 0, i,