This removes the renaming variant of find_referenced_vars_in. I'm working towards removing the mark_symbols_for_renaming hammer.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2012-05-11 Richard Guenther <rguent...@suse.de> * tree-flow.h (referenced_var_check_and_insert): Remove. (find_new_referenced_vars): Likewise. * tree-dfa.c (referenced_var_check_and_insert): Make static. (find_new_referenced_vars_1, find_new_referenced_vars): Remove. * tree-inline.c (copy_bb): Use find_referenced_vars_in instead of find_new_referenced_vars. * gimple-fold.c (gimplify_and_update_call_from_tree): Likewise. Index: gcc/tree-flow.h =================================================================== *** gcc/tree-flow.h (revision 187401) --- gcc/tree-flow.h (working copy) *************** typedef struct *** 332,338 **** (VAR) = next_referenced_var (&(ITER))) extern tree referenced_var_lookup (struct function *, unsigned int); - extern bool referenced_var_check_and_insert (tree); #define num_referenced_vars htab_elements (gimple_referenced_vars (cfun)) #define num_ssa_names (VEC_length (tree, cfun->gimple_df->ssa_names)) --- 332,337 ---- *************** extern tree get_virtual_var (tree); *** 496,502 **** extern bool add_referenced_var (tree); extern void remove_referenced_var (tree); extern void mark_symbols_for_renaming (gimple); - extern void find_new_referenced_vars (gimple); extern tree make_rename_temp (tree, const char *); extern void set_default_def (tree, tree); extern tree gimple_default_def (struct function *, tree); --- 495,500 ---- Index: gcc/tree-dfa.c =================================================================== *** gcc/tree-dfa.c (revision 187401) --- gcc/tree-dfa.c (working copy) *************** find_vars_r (tree *tp, int *walk_subtree *** 462,470 **** return NULL_TREE; } ! /* Find referenced variables in STMT. In contrast with ! find_new_referenced_vars, this function will not mark newly found ! variables for renaming. */ void find_referenced_vars_in (gimple stmt) --- 462,468 ---- return NULL_TREE; } ! /* Find referenced variables in STMT. */ void find_referenced_vars_in (gimple stmt) *************** referenced_var_lookup (struct function * *** 505,511 **** /* Check if TO is in the referenced_vars hash table and insert it if not. Return true if it required insertion. */ ! bool referenced_var_check_and_insert (tree to) { tree h, *loc; --- 503,509 ---- /* Check if TO is in the referenced_vars hash table and insert it if not. Return true if it required insertion. */ ! static bool referenced_var_check_and_insert (tree to) { tree h, *loc; *************** mark_symbols_for_renaming (gimple stmt) *** 667,704 **** } - /* Find all variables within the gimplified statement that were not - previously visible to the function and add them to the referenced - variables list. */ - - static tree - find_new_referenced_vars_1 (tree *tp, int *walk_subtrees, - void *data ATTRIBUTE_UNUSED) - { - tree t = *tp; - - if (TREE_CODE (t) == VAR_DECL && !var_ann (t)) - { - add_referenced_var (t); - mark_sym_for_renaming (t); - } - - if (IS_TYPE_OR_DECL_P (t)) - *walk_subtrees = 0; - - return NULL; - } - - - /* Find any new referenced variables in STMT. */ - - void - find_new_referenced_vars (gimple stmt) - { - walk_gimple_op (stmt, find_new_referenced_vars_1, NULL); - } - - /* If EXP is a handled component reference for a structure, return the base variable. The access range is delimited by bit positions *POFFSET and *POFFSET + *PMAX_SIZE. The access size is *PSIZE bits. If either --- 657,662 ---- Index: gcc/tree-inline.c =================================================================== *** gcc/tree-inline.c (revision 187401) --- gcc/tree-inline.c (working copy) *************** copy_bb (copy_body_data *id, basic_block *** 1794,1800 **** ssa_op_iter i; tree def; ! find_new_referenced_vars (gsi_stmt (copy_gsi)); FOR_EACH_SSA_TREE_OPERAND (def, stmt, i, SSA_OP_DEF) if (TREE_CODE (def) == SSA_NAME) SSA_NAME_DEF_STMT (def) = stmt; --- 1794,1800 ---- ssa_op_iter i; tree def; ! find_referenced_vars_in (gsi_stmt (copy_gsi)); FOR_EACH_SSA_TREE_OPERAND (def, stmt, i, SSA_OP_DEF) if (TREE_CODE (def) == SSA_NAME) SSA_NAME_DEF_STMT (def) = stmt; Index: gcc/gimple-fold.c =================================================================== *** gcc/gimple-fold.c (revision 187401) --- gcc/gimple-fold.c (working copy) *************** gimplify_and_update_call_from_tree (gimp *** 625,631 **** new_stmt = gsi_stmt (i); /* The replacement can expose previously unreferenced variables. */ if (gimple_in_ssa_p (cfun)) ! find_new_referenced_vars (new_stmt); /* If the new statement possibly has a VUSE, update it with exact SSA name we know will reach this one. */ if (gimple_has_mem_ops (new_stmt)) --- 625,631 ---- new_stmt = gsi_stmt (i); /* The replacement can expose previously unreferenced variables. */ if (gimple_in_ssa_p (cfun)) ! find_referenced_vars_in (new_stmt); /* If the new statement possibly has a VUSE, update it with exact SSA name we know will reach this one. */ if (gimple_has_mem_ops (new_stmt))