diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2006-05-23 14:07:21 +0000 |
---|---|---|
committer | Andrew Macleod <amacleod@gcc.gnu.org> | 2006-05-23 14:07:21 +0000 |
commit | f004ab022e2d651c3838e04a8c23243f71041964 (patch) | |
tree | 2b7049784095c414b53ca43eb183cfd9844c3b8d /gcc | |
parent | dcdf969d4be84628b7a5a62011a1b600b7d8faa3 (diff) | |
download | gcc-f004ab022e2d651c3838e04a8c23243f71041964.zip gcc-f004ab022e2d651c3838e04a8c23243f71041964.tar.gz gcc-f004ab022e2d651c3838e04a8c23243f71041964.tar.bz2 |
re PR c++/26757 (C++ front-end producing two DECLs with the same UID)
2006-05-23 Andrew MacLeod <amacleod@redhat.com>
PR c++/26757
* tree-ssa-loop-im.c (determine_invariantness_stmt): Use
add_referenced_var instead of add_referenced_tmp_var.
* tree-complex.c (create_one_component_var): Use add_referenced_var.
* tree-ssa-loop-manip.c (create_iv, tree_unroll_loop): Use
add_referenced_var.
* tree-tailcall.c (adjust_accumulator_values, adjust_return_value,
tree_optimize_tail_calls_1): Use add_referenced_var.
* tree-ssa-loop-ivopts.c (create_new_iv): Use add_referenced_var.
* tree-ssa-alias.c (create_memory_tag, create_global_var, create_sft):
Use add_referenced_var.
* tree-if-conv.c (ifc_temp_var): Use add_referenced_var.
* gimplify.c (force_gimple_operand): Use add_referenced_var.
* tree-ssa-phiopt.c (conditional_replacement, abs_replacement):
Use add_referenced_var.
* tree-dfa.c (struct walk_state): Remove.
(find_referenced_vars): Remove walk state and vars_found hash table.
(make_rename_temp): Use add_referenced_var.
(find_vars_r): Pass less parameters to add_referenced_var.
(referenced_var_p): New. Is var in referenced_var hash table.
(referenced_var_insert): Assert var isn't already in hash table.
(add_referenced_var): Don't need walk_state parameter. Add var if it
isn't already in the hash table.
(add_referenced_tmp_var): Remove.
(find_new_referenced_vars_1): Use add_referenced_var.
* tree-ssa-pre.c (create_expression_by_pieces,
insert_into_preds_of_block, insert_extra_phis, realify_fake_stores):
Use add_referenced_var.
* tree-vect-patterns.c (vect_pattern_recog_1): Use add_referenced_var.
* lambda-code.c (lbv_to_gcc_expression, lle_to_gcc_expression,
lambda_loopnest_to_gcc_loopnest, perfect_nestify): Use
add_referenced_var.
* tree-vect-transform.c (vect_create_addr_base_for_vector_ref,
vect_create_data_ref_ptr, vect_create_destination_var,
vect_init_vector, vect_build_loop_niters,
vect_generate_tmps_on_preheader, vect_update_ivs_after_vectorizer,
vect_gen_niters_for_prolog_loop, vect_create_cond_for_align_checks):
Use add_referenced_var.
* tree-outof-ssa.c (create_temp): Use add_referenced_var.
* tree-flow.h (add_referenced_tmp_var): Remove prototype
(add_referenced_var): Add prototype.
* tree-ssa-structalias.c (get_constraint_for,
intra_create_variable_infos): Use add_referenced_var.
From-SVN: r114018
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 46 | ||||
-rw-r--r-- | gcc/gimplify.c | 2 | ||||
-rw-r--r-- | gcc/lambda-code.c | 10 | ||||
-rw-r--r-- | gcc/tree-complex.c | 2 | ||||
-rw-r--r-- | gcc/tree-dfa.c | 85 | ||||
-rw-r--r-- | gcc/tree-flow.h | 2 | ||||
-rw-r--r-- | gcc/tree-if-conv.c | 2 | ||||
-rw-r--r-- | gcc/tree-outof-ssa.c | 4 | ||||
-rw-r--r-- | gcc/tree-ssa-alias.c | 6 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-im.c | 2 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 2 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-manip.c | 4 | ||||
-rw-r--r-- | gcc/tree-ssa-phiopt.c | 6 | ||||
-rw-r--r-- | gcc/tree-ssa-pre.c | 8 | ||||
-rw-r--r-- | gcc/tree-ssa-structalias.c | 4 | ||||
-rw-r--r-- | gcc/tree-tailcall.c | 10 | ||||
-rw-r--r-- | gcc/tree-vect-patterns.c | 2 | ||||
-rw-r--r-- | gcc/tree-vect-transform.c | 28 |
18 files changed, 123 insertions, 102 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 18c97a9..219face 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,49 @@ +2006-05-23 Andrew MacLeod <amacleod@redhat.com> + + PR c++/26757 + * tree-ssa-loop-im.c (determine_invariantness_stmt): Use + add_referenced_var instead of add_referenced_tmp_var. + * tree-complex.c (create_one_component_var): Use add_referenced_var. + * tree-ssa-loop-manip.c (create_iv, tree_unroll_loop): Use + add_referenced_var. + * tree-tailcall.c (adjust_accumulator_values, adjust_return_value, + tree_optimize_tail_calls_1): Use add_referenced_var. + * tree-ssa-loop-ivopts.c (create_new_iv): Use add_referenced_var. + * tree-ssa-alias.c (create_memory_tag, create_global_var, create_sft): + Use add_referenced_var. + * tree-if-conv.c (ifc_temp_var): Use add_referenced_var. + * gimplify.c (force_gimple_operand): Use add_referenced_var. + * tree-ssa-phiopt.c (conditional_replacement, abs_replacement): + Use add_referenced_var. + * tree-dfa.c (struct walk_state): Remove. + (find_referenced_vars): Remove walk state and vars_found hash table. + (make_rename_temp): Use add_referenced_var. + (find_vars_r): Pass less parameters to add_referenced_var. + (referenced_var_p): New. Is var in referenced_var hash table. + (referenced_var_insert): Assert var isn't already in hash table. + (add_referenced_var): Don't need walk_state parameter. Add var if it + isn't already in the hash table. + (add_referenced_tmp_var): Remove. + (find_new_referenced_vars_1): Use add_referenced_var. + * tree-ssa-pre.c (create_expression_by_pieces, + insert_into_preds_of_block, insert_extra_phis, realify_fake_stores): + Use add_referenced_var. + * tree-vect-patterns.c (vect_pattern_recog_1): Use add_referenced_var. + * lambda-code.c (lbv_to_gcc_expression, lle_to_gcc_expression, + lambda_loopnest_to_gcc_loopnest, perfect_nestify): Use + add_referenced_var. + * tree-vect-transform.c (vect_create_addr_base_for_vector_ref, + vect_create_data_ref_ptr, vect_create_destination_var, + vect_init_vector, vect_build_loop_niters, + vect_generate_tmps_on_preheader, vect_update_ivs_after_vectorizer, + vect_gen_niters_for_prolog_loop, vect_create_cond_for_align_checks): + Use add_referenced_var. + * tree-outof-ssa.c (create_temp): Use add_referenced_var. + * tree-flow.h (add_referenced_tmp_var): Remove prototype + (add_referenced_var): Add prototype. + * tree-ssa-structalias.c (get_constraint_for, + intra_create_variable_infos): Use add_referenced_var. + 2006-05-23 Alexandre Oliva <aoliva@redhat.com> * simplify-rtx.c (simplify_subreg): Adjust REG_OFFSET for diff --git a/gcc/gimplify.c b/gcc/gimplify.c index a438974..103b36e 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -6228,7 +6228,7 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var) if (referenced_vars) { for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t)) - add_referenced_tmp_var (t); + add_referenced_var (t); } pop_gimplify_context (NULL); diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c index 60f1be2..c59de3c 100644 --- a/gcc/lambda-code.c +++ b/gcc/lambda-code.c @@ -1539,7 +1539,7 @@ lbv_to_gcc_expression (lambda_body_vector lbv, /* Create a statement list and a linear expression temporary. */ stmts = alloc_stmt_list (); resvar = create_tmp_var (type, "lbvtmp"); - add_referenced_tmp_var (resvar); + add_referenced_var (resvar); /* Start at 0. */ stmt = build2 (MODIFY_EXPR, void_type_node, resvar, integer_zero_node); @@ -1626,7 +1626,7 @@ lle_to_gcc_expression (lambda_linear_expression lle, /* Create a statement list and a linear expression temporary. */ stmts = alloc_stmt_list (); resvar = create_tmp_var (type, "lletmp"); - add_referenced_tmp_var (resvar); + add_referenced_var (resvar); /* Build up the linear expressions, and put the variable representing the result in the results array. */ @@ -1846,7 +1846,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, /* First, build the new induction variable temporary */ ivvar = create_tmp_var (type, "lnivtmp"); - add_referenced_tmp_var (ivvar); + add_referenced_var (ivvar); VEC_safe_push (tree, heap, new_ivs, ivvar); @@ -2457,7 +2457,7 @@ perfect_nestify (struct loops *loops, /* Create the new iv. */ oldivvar = VEC_index (tree, loopivs, 0); ivvar = create_tmp_var (TREE_TYPE (oldivvar), "perfectiv"); - add_referenced_tmp_var (ivvar); + add_referenced_var (ivvar); standard_iv_increment_position (newloop, &bsi, &insert_after); create_iv (VEC_index (tree, lbounds, 0), build_int_cst (TREE_TYPE (oldivvar), VEC_index (int, steps, 0)), @@ -2468,7 +2468,7 @@ perfect_nestify (struct loops *loops, exit_condition = get_loop_exit_condition (newloop); uboundvar = create_tmp_var (integer_type_node, "uboundvar"); - add_referenced_tmp_var (uboundvar); + add_referenced_var (uboundvar); stmt = build2 (MODIFY_EXPR, void_type_node, uboundvar, VEC_index (tree, ubounds, 0)); uboundvar = make_ssa_name (uboundvar, stmt); diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c index 65466bb..0a5040e 100644 --- a/gcc/tree-complex.c +++ b/gcc/tree-complex.c @@ -387,7 +387,7 @@ create_one_component_var (tree type, tree orig, const char *prefix, const char *suffix, enum tree_code code) { tree r = create_tmp_var (type, prefix); - add_referenced_tmp_var (r); + add_referenced_var (r); DECL_SOURCE_LOCATION (r) = DECL_SOURCE_LOCATION (orig); DECL_ARTIFICIAL (r) = 1; diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 9ff2bd5..621a0d3 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -65,19 +65,10 @@ struct dfa_stats_d }; -/* State information for find_vars_r. */ -struct walk_state -{ - /* Hash table used to avoid adding the same variable more than once. */ - htab_t vars_found; -}; - - /* Local functions. */ static void collect_dfa_stats (struct dfa_stats_d *); static tree collect_dfa_stats_r (tree *, int *, void *); static tree find_vars_r (tree *, int *, void *); -static void add_referenced_var (tree, struct walk_state *); /* Global declarations. */ @@ -106,23 +97,16 @@ htab_t default_defs; static unsigned int find_referenced_vars (void) { - htab_t vars_found; basic_block bb; block_stmt_iterator si; - struct walk_state walk_state; - - vars_found = htab_create (50, htab_hash_pointer, htab_eq_pointer, NULL); - memset (&walk_state, 0, sizeof (walk_state)); - walk_state.vars_found = vars_found; FOR_EACH_BB (bb) for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si)) { tree *stmt_p = bsi_stmt_ptr (si); - walk_tree (stmt_p, find_vars_r, &walk_state, NULL); + walk_tree (stmt_p, find_vars_r, NULL, NULL); } - htab_delete (vars_found); return 0; } @@ -243,7 +227,7 @@ make_rename_temp (tree type, const char *prefix) if (referenced_vars) { - add_referenced_tmp_var (t); + add_referenced_var (t); mark_sym_for_renaming (t); } @@ -607,14 +591,12 @@ collect_dfa_stats_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, the function. */ static tree -find_vars_r (tree *tp, int *walk_subtrees, void *data) +find_vars_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) { - struct walk_state *walk_state = (struct walk_state *) data; - /* If T is a regular variable that the optimizers are interested in, add it to the list of variables. */ if (SSA_VAR_P (*tp)) - add_referenced_var (*tp, walk_state); + add_referenced_var (*tp); /* Type, _DECL and constant nodes have no interesting children. Ignore them. */ @@ -624,6 +606,21 @@ find_vars_r (tree *tp, int *walk_subtrees, void *data) return NULL_TREE; } +/* Lookup VAR in the referenced_vars hashtable and return true if it is + present. */ + +static inline bool +referenced_var_p (tree var) +{ + struct int_tree_map *h, in; + in.uid = DECL_UID (var); + h = (struct int_tree_map *) htab_find_with_hash (referenced_vars, + &in, + in.uid); + if (h) + return h->to != NULL_TREE; + return false; +} /* Lookup UID in the referenced_vars hashtable and return the associated variable. */ @@ -652,6 +649,9 @@ referenced_var_insert (unsigned int uid, tree to) h->uid = uid; h->to = to; loc = htab_find_slot_with_hash (referenced_vars, h, uid, INSERT); + /* This assert can only trigger if a variable with the same UID has been + inserted already. */ + gcc_assert ((*(struct int_tree_map **)loc) == NULL); *(struct int_tree_map **) loc = h; } @@ -705,33 +705,21 @@ set_default_def (tree var, tree def) } } -/* Add VAR to the list of dereferenced variables. - - WALK_STATE contains a hash table used to avoid adding the same - variable more than once. Note that this function assumes that - VAR is a valid SSA variable. If WALK_STATE is NULL, no - duplicate checking is done. */ +/* Add VAR to the list of referenced variables if it isn't already there. */ -static void -add_referenced_var (tree var, struct walk_state *walk_state) +void +add_referenced_var (tree var) { - void **slot; var_ann_t v_ann; v_ann = get_var_ann (var); - - if (walk_state) - slot = htab_find_slot (walk_state->vars_found, (void *) var, INSERT); - else - slot = NULL; - - if (slot == NULL || *slot == NULL) + gcc_assert (DECL_P (var)); + + if (!referenced_var_p (var)) { /* This is the first time we find this variable, add it to the REFERENCED_VARS array and annotate it with attributes that are intrinsic to the variable. */ - if (slot) - *slot = (void *) var; referenced_var_insert (DECL_UID (var), var); @@ -750,7 +738,7 @@ add_referenced_var (tree var, struct walk_state *walk_state) variables because it cannot be propagated by the optimizers. */ && (TREE_CONSTANT (var) || TREE_READONLY (var))) - walk_tree (&DECL_INITIAL (var), find_vars_r, walk_state, 0); + walk_tree (&DECL_INITIAL (var), find_vars_r, NULL, 0); } } @@ -778,19 +766,6 @@ get_virtual_var (tree var) return var; } -/* Add a temporary variable to REFERENCED_VARS. This is similar to - add_referenced_var, but is used by passes that need to add new temps to - the REFERENCED_VARS array after the program has been scanned for - variables. The variable will just receive a new UID and be added - to the REFERENCED_VARS array without checking for duplicates. */ - -void -add_referenced_tmp_var (tree var) -{ - add_referenced_var (var, NULL); -} - - /* Mark all the non-SSA variables found in STMT's operands to be processed by update_ssa. */ @@ -868,7 +843,7 @@ find_new_referenced_vars_1 (tree *tp, int *walk_subtrees, if (TREE_CODE (t) == VAR_DECL && !var_ann (t)) { - add_referenced_tmp_var (t); + add_referenced_var (t); mark_sym_for_renaming (t); } diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index 3b374d8..1bd3237 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -633,7 +633,7 @@ extern void debug_variable (tree); extern void dump_subvars_for (FILE *, tree); extern void debug_subvars_for (tree); extern tree get_virtual_var (tree); -extern void add_referenced_tmp_var (tree); +extern void add_referenced_var (tree); extern void mark_new_vars_to_rename (tree); extern void find_new_referenced_vars (tree *); diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index 2a61020..ecd1368 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -989,7 +989,7 @@ ifc_temp_var (tree type, tree exp) /* Create new temporary variable. */ var = create_tmp_var (type, name); - add_referenced_tmp_var (var); + add_referenced_var (var); /* Build new statement to assign EXP to new variable. */ stmt = build2 (MODIFY_EXPR, type, var, exp); diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c index e41b0ff..55f74e1 100644 --- a/gcc/tree-outof-ssa.c +++ b/gcc/tree-outof-ssa.c @@ -168,9 +168,9 @@ create_temp (tree t) } DECL_ARTIFICIAL (tmp) = DECL_ARTIFICIAL (t); DECL_IGNORED_P (tmp) = DECL_IGNORED_P (t); - add_referenced_tmp_var (tmp); + add_referenced_var (tmp); - /* add_referenced_tmp_var will create the annotation and set up some + /* add_referenced_var will create the annotation and set up some of the flags in the annotation. However, some flags we need to inherit from our original variable. */ var_ann (tmp)->symbol_mem_tag = var_ann (t)->symbol_mem_tag; diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 9d5f145..0b30a81 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -2141,7 +2141,7 @@ create_memory_tag (tree type, bool is_type_tag) ann->symbol_mem_tag = NULL_TREE; /* Add the tag to the symbol table. */ - add_referenced_tmp_var (tag); + add_referenced_var (tag); return tag; } @@ -2253,7 +2253,7 @@ create_global_var (void) create_var_ann (global_var); mark_call_clobbered (global_var, ESCAPE_UNKNOWN); - add_referenced_tmp_var (global_var); + add_referenced_var (global_var); mark_sym_for_renaming (global_var); } @@ -2900,7 +2900,7 @@ create_sft (tree var, tree field, unsigned HOST_WIDE_INT offset, /* Add the new variable to REFERENCED_VARS. */ ann = get_var_ann (subvar); ann->symbol_mem_tag = NULL; - add_referenced_tmp_var (subvar); + add_referenced_var (subvar); SFT_PARENT_VAR (subvar) = var; SFT_OFFSET (subvar) = offset; SFT_SIZE (subvar) = size; diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index 4dcda9f..e51e214 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -624,7 +624,7 @@ determine_invariantness_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED, /* stmt must be MODIFY_EXPR. */ var = create_tmp_var (TREE_TYPE (rhs), "reciptmp"); - add_referenced_tmp_var (var); + add_referenced_var (var); stmt1 = build2 (MODIFY_EXPR, void_type_node, var, build2 (RDIV_EXPR, TREE_TYPE (rhs), diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 7cf91e2..9a289cc 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -5123,7 +5123,7 @@ create_new_iv (struct ivopts_data *data, struct iv_cand *cand) } gimple_add_tmp_var (cand->var_before); - add_referenced_tmp_var (cand->var_before); + add_referenced_var (cand->var_before); base = unshare_expr (cand->iv->base); diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c index 21d1ea1..556264c 100644 --- a/gcc/tree-ssa-loop-manip.c +++ b/gcc/tree-ssa-loop-manip.c @@ -60,7 +60,7 @@ create_iv (tree base, tree step, tree var, struct loop *loop, if (!var) { var = create_tmp_var (TREE_TYPE (base), "ivtmp"); - add_referenced_tmp_var (var); + add_referenced_var (var); } vb = make_ssa_name (var, NULL_TREE); @@ -916,7 +916,7 @@ tree_unroll_loop (struct loops *loops, struct loop *loop, unsigned factor, else { var = create_tmp_var (TREE_TYPE (init), "unrinittmp"); - add_referenced_tmp_var (var); + add_referenced_var (var); } new_init = make_ssa_name (var, NULL_TREE); diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index a005991..edad768 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -410,7 +410,7 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb, return false; tmp = create_tmp_var (TREE_TYPE (cond), NULL); - add_referenced_tmp_var (tmp); + add_referenced_var (tmp); new_var = make_ssa_name (tmp, NULL); old_result = cond; cond = new_var; @@ -512,7 +512,7 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb, op0 = TREE_OPERAND (cond, 0); tmp = create_tmp_var (TREE_TYPE (op0), NULL); - add_referenced_tmp_var (tmp); + add_referenced_var (tmp); cond_tmp = make_ssa_name (tmp, NULL); new = build2 (MODIFY_EXPR, TREE_TYPE (cond_tmp), cond_tmp, op0); SSA_NAME_DEF_STMT (cond_tmp) = new; @@ -959,7 +959,7 @@ abs_replacement (basic_block cond_bb, basic_block middle_bb, if (negate) { tree tmp = create_tmp_var (TREE_TYPE (result), NULL); - add_referenced_tmp_var (tmp); + add_referenced_var (tmp); lhs = make_ssa_name (tmp, NULL); } else diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 08f0930..0f2d6b4 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -2422,7 +2422,7 @@ create_expression_by_pieces (basic_block block, tree expr, tree stmts) } temp = pretemp; - add_referenced_tmp_var (temp); + add_referenced_var (temp); if (TREE_CODE (TREE_TYPE (expr)) == COMPLEX_TYPE) DECL_COMPLEX_GIMPLE_REG_P (temp) = 1; @@ -2565,7 +2565,7 @@ insert_into_preds_of_block (basic_block block, value_set_node_t node, } temp = prephitemp; - add_referenced_tmp_var (temp); + add_referenced_var (temp); if (TREE_CODE (type) == COMPLEX_TYPE) DECL_COMPLEX_GIMPLE_REG_P (temp) = 1; @@ -3040,7 +3040,7 @@ insert_extra_phis (basic_block block, basic_block dom) fprintf (dump_file, " to merge available but not dominating values "); } - add_referenced_tmp_var (temp); + add_referenced_var (temp); temp = create_phi_node (temp, block); NECESSARY (temp) = 0; VEC_safe_push (tree, heap, inserted_exprs, temp); @@ -3288,7 +3288,7 @@ realify_fake_stores (void) tree newstmt; /* Mark the temp variable as referenced */ - add_referenced_tmp_var (SSA_NAME_VAR (TREE_OPERAND (stmt, 0))); + add_referenced_var (SSA_NAME_VAR (TREE_OPERAND (stmt, 0))); /* Put the new statement in GC memory, fix up the SSA_NAME_DEF_STMT on it, and then put it in place of diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 26dbd0d..2e7c924 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -2560,7 +2560,7 @@ get_constraint_for (tree t, VEC (ce_s, heap) **results) heapvar = create_tmp_var_raw (ptr_type_node, "HEAP"); DECL_EXTERNAL (heapvar) = 1; if (referenced_vars) - add_referenced_tmp_var (heapvar); + add_referenced_var (heapvar); heapvar_insert (t, heapvar); } @@ -4074,7 +4074,7 @@ intra_create_variable_infos (void) "PARM_NOALIAS"); DECL_EXTERNAL (heapvar) = 1; if (referenced_vars) - add_referenced_tmp_var (heapvar); + add_referenced_var (heapvar); heapvar_insert (t, heapvar); } id = create_variable_info_for (heapvar, diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c index fb9948e..e45f0be 100644 --- a/gcc/tree-tailcall.c +++ b/gcc/tree-tailcall.c @@ -562,7 +562,7 @@ adjust_accumulator_values (block_stmt_iterator bsi, tree m, tree a, edge back) build2 (MULT_EXPR, ret_type, m_acc, a)); tmp = create_tmp_var (ret_type, "acc_tmp"); - add_referenced_tmp_var (tmp); + add_referenced_var (tmp); var = make_ssa_name (tmp, stmt); TREE_OPERAND (stmt, 0) = var; @@ -641,7 +641,7 @@ adjust_return_value (basic_block bb, tree m, tree a) build2 (MULT_EXPR, ret_type, m_acc, ret_var)); tmp = create_tmp_var (ret_type, "acc_tmp"); - add_referenced_tmp_var (tmp); + add_referenced_var (tmp); var = make_ssa_name (tmp, stmt); TREE_OPERAND (stmt, 0) = var; @@ -656,7 +656,7 @@ adjust_return_value (basic_block bb, tree m, tree a) build2 (PLUS_EXPR, ret_type, a_acc, var)); tmp = create_tmp_var (ret_type, "acc_tmp"); - add_referenced_tmp_var (tmp); + add_referenced_var (tmp); var = make_ssa_name (tmp, stmt); TREE_OPERAND (stmt, 0) = var; @@ -928,7 +928,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls) ret_type = TREE_TYPE (DECL_RESULT (current_function_decl)); tmp = create_tmp_var (ret_type, "add_acc"); - add_referenced_tmp_var (tmp); + add_referenced_var (tmp); phi = create_phi_node (tmp, first); add_phi_arg (phi, @@ -944,7 +944,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls) ret_type = TREE_TYPE (DECL_RESULT (current_function_decl)); tmp = create_tmp_var (ret_type, "mult_acc"); - add_referenced_tmp_var (tmp); + add_referenced_var (tmp); phi = create_phi_node (tmp, first); add_phi_arg (phi, diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index b6e5ef0..e73ea3b 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -516,7 +516,7 @@ vect_pattern_recog_1 ( code = TREE_CODE (pattern_expr); pattern_type = TREE_TYPE (pattern_expr); var = create_tmp_var (pattern_type, "patt"); - add_referenced_tmp_var (var); + add_referenced_var (var); var_name = make_ssa_name (var, NULL_TREE); pattern_expr = build2 (MODIFY_EXPR, void_type_node, var_name, pattern_expr); SSA_NAME_DEF_STMT (var_name) = pattern_expr; diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index 8c65b86..7b1227b 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -153,14 +153,14 @@ vect_create_addr_base_for_vector_ref (tree stmt, /* Create base_offset */ base_offset = size_binop (PLUS_EXPR, base_offset, init); dest = create_tmp_var (TREE_TYPE (base_offset), "base_off"); - add_referenced_tmp_var (dest); + add_referenced_var (dest); base_offset = force_gimple_operand (base_offset, &new_stmt, false, dest); append_to_statement_list_force (new_stmt, new_stmt_list); if (offset) { tree tmp = create_tmp_var (TREE_TYPE (base_offset), "offset"); - add_referenced_tmp_var (tmp); + add_referenced_var (tmp); offset = fold_build2 (MULT_EXPR, TREE_TYPE (offset), offset, DR_STEP (dr)); base_offset = fold_build2 (PLUS_EXPR, TREE_TYPE (base_offset), @@ -176,7 +176,7 @@ vect_create_addr_base_for_vector_ref (tree stmt, /* addr_expr = addr_base */ addr_expr = vect_get_new_vect_var (scalar_ptr_type, vect_pointer_var, get_name (base_name)); - add_referenced_tmp_var (addr_expr); + add_referenced_var (addr_expr); vec_stmt = build2 (MODIFY_EXPR, void_type_node, addr_expr, addr_base); new_temp = make_ssa_name (addr_expr, vec_stmt); TREE_OPERAND (vec_stmt, 0) = new_temp; @@ -291,7 +291,7 @@ vect_create_data_ref_ptr (tree stmt, vect_ptr_type = build_pointer_type (vectype); vect_ptr = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var, get_name (base_name)); - add_referenced_tmp_var (vect_ptr); + add_referenced_var (vect_ptr); /** (2) Add aliasing information to the new vector-pointer: @@ -389,7 +389,7 @@ vect_create_destination_var (tree scalar_dest, tree vectype) if (!new_name) new_name = "var_"; vec_dest = vect_get_new_vect_var (type, vect_simple_var, new_name); - add_referenced_tmp_var (vec_dest); + add_referenced_var (vec_dest); return vec_dest; } @@ -416,7 +416,7 @@ vect_init_vector (tree stmt, tree vector_var) basic_block new_bb; new_var = vect_get_new_vect_var (vectype, vect_simple_var, "cst_"); - add_referenced_tmp_var (new_var); + add_referenced_var (new_var); init_stmt = build2 (MODIFY_EXPR, vectype, new_var, vector_var); new_temp = make_ssa_name (new_var, init_stmt); @@ -2291,7 +2291,7 @@ vect_build_loop_niters (loop_vec_info loop_vinfo) tree ni = unshare_expr (LOOP_VINFO_NITERS (loop_vinfo)); var = create_tmp_var (TREE_TYPE (ni), "niters"); - add_referenced_tmp_var (var); + add_referenced_var (var); ni_name = force_gimple_operand (ni, &stmt, false, var); pe = loop_preheader_edge (loop); @@ -2342,7 +2342,7 @@ vect_generate_tmps_on_preheader (loop_vec_info loop_vinfo, /* Create: ratio = ni >> log2(vf) */ var = create_tmp_var (TREE_TYPE (ni), "bnd"); - add_referenced_tmp_var (var); + add_referenced_var (var); ratio_name = make_ssa_name (var, NULL_TREE); stmt = build2 (MODIFY_EXPR, void_type_node, ratio_name, build2 (RSHIFT_EXPR, TREE_TYPE (ni_name), ni_name, log_vf)); @@ -2355,7 +2355,7 @@ vect_generate_tmps_on_preheader (loop_vec_info loop_vinfo, /* Create: ratio_mult_vf = ratio << log2 (vf). */ var = create_tmp_var (TREE_TYPE (ni), "ratio_mult_vf"); - add_referenced_tmp_var (var); + add_referenced_var (var); ratio_mult_vf_name = make_ssa_name (var, NULL_TREE); stmt = build2 (MODIFY_EXPR, void_type_node, ratio_mult_vf_name, build2 (LSHIFT_EXPR, TREE_TYPE (ratio_name), ratio_name, log_vf)); @@ -2556,7 +2556,7 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, tree niters, niters, step_expr), init_expr); var = create_tmp_var (TREE_TYPE (init_expr), "tmp"); - add_referenced_tmp_var (var); + add_referenced_var (var); ni_name = force_gimple_operand (ni, &stmt, false, var); @@ -2732,7 +2732,7 @@ vect_gen_niters_for_prolog_loop (loop_vec_info loop_vinfo, tree loop_niters) } var = create_tmp_var (niters_type, "prolog_loop_niters"); - add_referenced_tmp_var (var); + add_referenced_var (var); iters_name = force_gimple_operand (iters, &stmt, false, var); /* Insert stmt on loop preheader edge. */ @@ -2905,7 +2905,7 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo, sprintf (tmp_name, "%s%d", "addr2int", i); addr_tmp = create_tmp_var (int_ptrsize_type, tmp_name); - add_referenced_tmp_var (addr_tmp); + add_referenced_var (addr_tmp); addr_tmp_name = make_ssa_name (addr_tmp, NULL_TREE); addr_stmt = fold_convert (int_ptrsize_type, addr_base); addr_stmt = build2 (MODIFY_EXPR, void_type_node, @@ -2920,7 +2920,7 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo, /* create: or_tmp = or_tmp | addr_tmp */ sprintf (tmp_name, "%s%d", "orptrs", i); or_tmp = create_tmp_var (int_ptrsize_type, tmp_name); - add_referenced_tmp_var (or_tmp); + add_referenced_var (or_tmp); new_or_tmp_name = make_ssa_name (or_tmp, NULL_TREE); or_stmt = build2 (MODIFY_EXPR, void_type_node, new_or_tmp_name, build2 (BIT_IOR_EXPR, int_ptrsize_type, @@ -2939,7 +2939,7 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo, /* create: and_tmp = or_tmp & mask */ and_tmp = create_tmp_var (int_ptrsize_type, "andmask" ); - add_referenced_tmp_var (and_tmp); + add_referenced_var (and_tmp); and_tmp_name = make_ssa_name (and_tmp, NULL_TREE); and_stmt = build2 (MODIFY_EXPR, void_type_node, |