This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] PHI_ARG_CAPACITY != block degree
Hello,
a second try. Bootstrapped and tested on i686.
Zdenek
* tree-ssa.c (rewrite_block): Test vars_to_rename instead of
PHI_ARG_CAPACITY.
* tree-dfa.c (remove_phi_arg_num): Don't update
PHI_ARG_CAPACITY.
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.130
diff -c -3 -p -r1.1.4.130 tree-ssa.c
*** tree-ssa.c 21 Sep 2003 22:14:27 -0000 1.1.4.130
--- tree-ssa.c 3 Oct 2003 10:04:00 -0000
*************** rewrite_block (basic_block bb)
*** 783,789 ****
tree currdef;
/* Ignore PHI nodes that have already been renamed. */
! if (PHI_NUM_ARGS (phi) == PHI_ARG_CAPACITY (phi))
continue;
currdef = get_reaching_def (SSA_NAME_VAR (PHI_RESULT (phi)));
--- 783,790 ----
tree currdef;
/* Ignore PHI nodes that have already been renamed. */
! if (!TEST_BIT (vars_to_rename,
! var_ann (SSA_NAME_VAR (PHI_RESULT (phi)))->uid))
continue;
currdef = get_reaching_def (SSA_NAME_VAR (PHI_RESULT (phi)));
Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v
retrieving revision 1.1.4.164
diff -c -3 -p -r1.1.4.164 tree-dfa.c
*** tree-dfa.c 25 Sep 2003 19:34:50 -0000 1.1.4.164
--- tree-dfa.c 3 Oct 2003 10:04:00 -0000
*************** remove_phi_arg_num (tree phi, int i)
*** 1022,1034 ****
PHI_ARG_EDGE (phi, num_elem - 1) = NULL;
PHI_NUM_ARGS (phi)--;
- /* Apparently we also use PHI_ARG_CAPACITY to determine if we've
- already renamed PHI nodes. So if we remove a PHI argument,
- then we must reduce its capacity so that we still know
- the PHI has been rewritten. This means that any memory
- statistics for this PHI may be incorrect. */
- PHI_ARG_CAPACITY (phi)--;
-
/* If we removed the last PHI argument, then go ahead and
remove the PHI node. */
if (PHI_NUM_ARGS (phi) == 0)
--- 1022,1027 ----