Commit 82460c75 by Andrew MacLeod Committed by Andrew Macleod

re PR middle-end/27793 (num_ssa_names inconsistent or immediate use iterator wrong)


2006-06-15  Andrew MacLeod  <amacleod@redhat.com>
	
	PR middle-end/27793
	* tree-dfa.c (referenced_vars_dup_list): Remove.
	(find_referenced_vars): Remove assert.
	(referenced_var_check_and_insert): Replace dup list with assert.
	* tree-ssa.c (delete_tree_ssa): Remove dup list processing.
	* tree-flow.h (referenced_vars_dup_list): Remove extern decl.

From-SVN: r114678
parent da4340a1
2006-06-15 Andrew MacLeod <amacleod@redhat.com>
PR middle-end/27793
* tree-dfa.c (referenced_vars_dup_list): Remove.
(find_referenced_vars): Remove assert.
(referenced_var_check_and_insert): Replace dup list with assert.
* tree-ssa.c (delete_tree_ssa): Remove dup list processing.
* tree-flow.h (referenced_vars_dup_list): Remove extern decl.
2006-06-15 Richard Guenther <rguenther@suse.de> 2006-06-15 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (alias_get_name): Avoid creating * tree-ssa-structalias.c (alias_get_name): Avoid creating
......
...@@ -75,8 +75,6 @@ static tree find_vars_r (tree *, int *, void *); ...@@ -75,8 +75,6 @@ static tree find_vars_r (tree *, int *, void *);
/* Array of all variables referenced in the function. */ /* Array of all variables referenced in the function. */
htab_t referenced_vars; htab_t referenced_vars;
/* List of referenced variables with duplicate UID's. */
VEC(tree,gc) *referenced_vars_dup_list;
/* Default definition for this symbols. If set for symbol, it /* Default definition for this symbols. If set for symbol, it
means that the first reference to this variable in the function is a means that the first reference to this variable in the function is a
...@@ -102,7 +100,6 @@ find_referenced_vars (void) ...@@ -102,7 +100,6 @@ find_referenced_vars (void)
basic_block bb; basic_block bb;
block_stmt_iterator si; block_stmt_iterator si;
gcc_assert (VEC_length (tree, referenced_vars_dup_list) == 0);
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si)) for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
{ {
...@@ -640,27 +637,9 @@ referenced_var_check_and_insert (tree to) ...@@ -640,27 +637,9 @@ referenced_var_check_and_insert (tree to)
if (h) if (h)
{ {
unsigned u;
tree t = NULL_TREE;
/* DECL_UID has already been entered in the table. Verify that it is /* DECL_UID has already been entered in the table. Verify that it is
the same entry as TO. */ the same entry as TO. See PR 27793. */
gcc_assert (h->to != NULL); gcc_assert (h->to == to);
if (h->to == to)
return false;
/* PRs 26757 and 27793. Maintain a list of duplicate variable pointers
with the same DECL_UID. There isn't usually very many.
TODO. Once the C++ front end doesn't create duplicate DECL UID's, this
code can be removed. */
for (u = 0; u < VEC_length (tree, referenced_vars_dup_list); u++)
{
t = VEC_index (tree, referenced_vars_dup_list, u);
if (t == to)
break;
}
if (t != to)
VEC_safe_push (tree, gc, referenced_vars_dup_list, to);
return false; return false;
} }
......
...@@ -419,8 +419,6 @@ typedef struct ...@@ -419,8 +419,6 @@ typedef struct
/* Array of all variables referenced in the function. */ /* Array of all variables referenced in the function. */
extern GTY((param_is (struct int_tree_map))) htab_t referenced_vars; extern GTY((param_is (struct int_tree_map))) htab_t referenced_vars;
/* List of referenced variables in the function with duplicate UID's. */
extern VEC(tree,gc) *referenced_vars_dup_list;
/* Default defs for undefined symbols. */ /* Default defs for undefined symbols. */
extern GTY((param_is (struct int_tree_map))) htab_t default_defs; extern GTY((param_is (struct int_tree_map))) htab_t default_defs;
......
...@@ -853,7 +853,6 @@ delete_tree_ssa (void) ...@@ -853,7 +853,6 @@ delete_tree_ssa (void)
block_stmt_iterator bsi; block_stmt_iterator bsi;
referenced_var_iterator rvi; referenced_var_iterator rvi;
tree var; tree var;
unsigned u;
/* Release any ssa_names still in use. */ /* Release any ssa_names still in use. */
for (i = 0; i < num_ssa_names; i++) for (i = 0; i < num_ssa_names; i++)
...@@ -888,16 +887,6 @@ delete_tree_ssa (void) ...@@ -888,16 +887,6 @@ delete_tree_ssa (void)
ggc_free (var->common.ann); ggc_free (var->common.ann);
var->common.ann = NULL; 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); htab_delete (referenced_vars);
referenced_vars = NULL; referenced_vars = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment