From 4b5e2dbc974abfe763a79e37ec7f37993a306d94 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Thu, 8 Jun 2006 01:18:16 +0000 Subject: re PR middle-end/27793 (num_ssa_names inconsistent or immediate use iterator wrong) 2006-06-07 Andrew MacLeod PR middle-end/27793 * tree-dfa.c (referenced_vars_dup_list): New. List of duplicate referenced_variables with matching DECL_UID's. (find_referenced_vars): Make sure duplicate list is empty to start. (referenced_var_p): Remove. (referenced_var_check_and_insert): Renamed from referenced_var_insert. Check if var is in the list, and add if needed. Update the duplicate list if a different var is in the list with the same DECL_UID. (add_referenced_var): Call routine to check and insert. * tree-ssa.c (delete_tree_ssa): Clear var_ann's on duplicates. * tree-flow.h (referenced_vars_dup_list): External declaration. From-SVN: r114480 --- gcc/tree-ssa.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gcc/tree-ssa.c') diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 1446612..9eb1b21 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -853,6 +853,7 @@ delete_tree_ssa (void) block_stmt_iterator bsi; referenced_var_iterator rvi; tree var; + unsigned u; /* Release any ssa_names still in use. */ for (i = 0; i < num_ssa_names; i++) @@ -887,6 +888,16 @@ delete_tree_ssa (void) ggc_free (var->common.ann); var->common.ann = NULL; } + + /* Remove any referenced variables which had duplicate UID's. */ + for (u = 0; u < VEC_length (tree, referenced_vars_dup_list); u++) + { + var = VEC_index (tree, referenced_vars_dup_list, u); + ggc_free (var->common.ann); + var->common.ann = NULL; + } + VEC_free (tree, gc, referenced_vars_dup_list); + htab_delete (referenced_vars); referenced_vars = NULL; -- cgit v1.1