tree-flow.h (create_var_ann): Remove.
2012-05-24 Richard Guenther <rguenther@suse.de> * tree-flow.h (create_var_ann): Remove. * tree-dfa.c (create_var_ann): Remove and inline into its single caller ... (add_referenced_var_1): ... here. * varpool.c (add_new_static_var): Do not call add_referenced_var for global vars. * gimple-fold.c (canonicalize_constructor_val): Likewise. * tree-switch-conversion.c (build_one_array): Likewise. * tree-profile.c (gimple_gen_ic_profiler): Likewise. * tree-flow-inline.h (gimple_referenced_vars): Guard against NULL fn argument. * tree-inline.c (remap_gimple_op_r): Likewise. Check gimple_referenced_vars instead of gimple_in_ssa_p. (copy_tree_body_r): Likewise. (setup_one_parameter): Likewise. (declare_return_variable): Likewise. (tree_function_versioning): Likewise. From-SVN: r187829
This commit is contained in:
parent
0d5a9e7848
commit
0faa05629e
9 changed files with 34 additions and 42 deletions
|
@ -1,3 +1,23 @@
|
|||
2012-05-24 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
* tree-flow.h (create_var_ann): Remove.
|
||||
* tree-dfa.c (create_var_ann): Remove and inline into its
|
||||
single caller ...
|
||||
(add_referenced_var_1): ... here.
|
||||
* varpool.c (add_new_static_var): Do not call add_referenced_var
|
||||
for global vars.
|
||||
* gimple-fold.c (canonicalize_constructor_val): Likewise.
|
||||
* tree-switch-conversion.c (build_one_array): Likewise.
|
||||
* tree-profile.c (gimple_gen_ic_profiler): Likewise.
|
||||
* tree-flow-inline.h (gimple_referenced_vars): Guard against
|
||||
NULL fn argument.
|
||||
* tree-inline.c (remap_gimple_op_r): Likewise. Check
|
||||
gimple_referenced_vars instead of gimple_in_ssa_p.
|
||||
(copy_tree_body_r): Likewise.
|
||||
(setup_one_parameter): Likewise.
|
||||
(declare_return_variable): Likewise.
|
||||
(tree_function_versioning): Likewise.
|
||||
|
||||
2012-05-24 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/53465
|
||||
|
|
|
@ -164,7 +164,8 @@ canonicalize_constructor_val (tree cval, tree from_decl)
|
|||
if (TREE_CODE (base) == VAR_DECL)
|
||||
{
|
||||
TREE_ADDRESSABLE (base) = 1;
|
||||
if (cfun && gimple_referenced_vars (cfun))
|
||||
if (cfun && gimple_referenced_vars (cfun)
|
||||
&& !is_global_var (base))
|
||||
add_referenced_var (base);
|
||||
}
|
||||
else if (TREE_CODE (base) == FUNCTION_DECL)
|
||||
|
|
|
@ -118,27 +118,6 @@ struct gimple_opt_pass pass_referenced_vars =
|
|||
};
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Manage annotations
|
||||
---------------------------------------------------------------------------*/
|
||||
/* Create a new annotation for a _DECL node T. */
|
||||
|
||||
var_ann_t
|
||||
create_var_ann (tree t)
|
||||
{
|
||||
var_ann_t ann;
|
||||
|
||||
gcc_assert (t);
|
||||
gcc_assert (TREE_CODE (t) == VAR_DECL
|
||||
|| TREE_CODE (t) == PARM_DECL
|
||||
|| TREE_CODE (t) == RESULT_DECL);
|
||||
|
||||
ann = ggc_alloc_cleared_var_ann_d ();
|
||||
*DECL_VAR_ANN_PTR (t) = ann;
|
||||
|
||||
return ann;
|
||||
}
|
||||
|
||||
/* Renumber all of the gimple stmt uids. */
|
||||
|
||||
void
|
||||
|
@ -587,7 +566,7 @@ add_referenced_var_1 (tree var, struct function *fn)
|
|||
return false;
|
||||
|
||||
if (!*DECL_VAR_ANN_PTR (var))
|
||||
create_var_ann (var);
|
||||
*DECL_VAR_ANN_PTR (var) = ggc_alloc_cleared_var_ann_d ();
|
||||
|
||||
/* Insert VAR into the referenced_vars hash table if it isn't present. */
|
||||
if (referenced_var_check_and_insert (var, fn))
|
||||
|
|
|
@ -39,7 +39,7 @@ gimple_in_ssa_p (const struct function *fun)
|
|||
static inline htab_t
|
||||
gimple_referenced_vars (const struct function *fun)
|
||||
{
|
||||
if (!fun->gimple_df)
|
||||
if (!fun || !fun->gimple_df)
|
||||
return NULL;
|
||||
return fun->gimple_df->referenced_vars;
|
||||
}
|
||||
|
|
|
@ -482,7 +482,6 @@ extern int op_prio (const_tree);
|
|||
extern const char *op_symbol_code (enum tree_code);
|
||||
|
||||
/* In tree-dfa.c */
|
||||
extern var_ann_t create_var_ann (tree);
|
||||
extern void renumber_gimple_stmt_uids (void);
|
||||
extern void renumber_gimple_stmt_uids_in_blocks (basic_block *, int);
|
||||
extern void dump_dfa_stats (FILE *);
|
||||
|
|
|
@ -876,8 +876,8 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
|
|||
|
||||
/* Global variables we haven't seen yet need to go into referenced
|
||||
vars. If not referenced from types only. */
|
||||
if (gimple_in_ssa_p (cfun)
|
||||
&& TREE_CODE (*tp) == VAR_DECL
|
||||
if (gimple_referenced_vars (cfun)
|
||||
&& TREE_CODE (*tp) == VAR_DECL && !is_global_var (*tp)
|
||||
&& id->remapping_type_depth == 0
|
||||
&& !processing_debug_stmt)
|
||||
add_referenced_var (*tp);
|
||||
|
@ -1119,8 +1119,8 @@ copy_tree_body_r (tree *tp, int *walk_subtrees, void *data)
|
|||
|
||||
/* Global variables we haven't seen yet needs to go into referenced
|
||||
vars. If not referenced from types or debug stmts only. */
|
||||
if (gimple_in_ssa_p (cfun)
|
||||
&& TREE_CODE (*tp) == VAR_DECL
|
||||
if (gimple_referenced_vars (cfun)
|
||||
&& TREE_CODE (*tp) == VAR_DECL && !is_global_var (*tp)
|
||||
&& id->remapping_type_depth == 0
|
||||
&& !processing_debug_stmt)
|
||||
add_referenced_var (*tp);
|
||||
|
@ -2604,11 +2604,11 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
|
|||
/* We are eventually using the value - make sure all variables
|
||||
referenced therein are properly recorded. */
|
||||
if (value
|
||||
&& gimple_in_ssa_p (cfun)
|
||||
&& gimple_referenced_vars (cfun)
|
||||
&& TREE_CODE (value) == ADDR_EXPR)
|
||||
{
|
||||
tree base = get_base_address (TREE_OPERAND (value, 0));
|
||||
if (base && TREE_CODE (base) == VAR_DECL)
|
||||
if (base && TREE_CODE (base) == VAR_DECL && !is_global_var (base))
|
||||
add_referenced_var (base);
|
||||
}
|
||||
|
||||
|
@ -2917,7 +2917,7 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest,
|
|||
gcc_assert (TREE_CODE (TYPE_SIZE_UNIT (callee_type)) == INTEGER_CST);
|
||||
|
||||
var = copy_result_decl_to_var (result, id);
|
||||
if (gimple_in_ssa_p (cfun))
|
||||
if (gimple_referenced_vars (cfun))
|
||||
add_referenced_var (var);
|
||||
|
||||
DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
|
||||
|
@ -2978,7 +2978,7 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest,
|
|||
&& !is_gimple_val (var))
|
||||
{
|
||||
tree temp = create_tmp_var (TREE_TYPE (result), "retvalptr");
|
||||
if (gimple_in_ssa_p (id->src_cfun))
|
||||
if (gimple_referenced_vars (cfun))
|
||||
add_referenced_var (temp);
|
||||
insert_decl_map (id, result, temp);
|
||||
/* When RESULT_DECL is in SSA form, we need to remap and initialize
|
||||
|
@ -5194,10 +5194,8 @@ tree_function_versioning (tree old_decl, tree new_decl,
|
|||
|
||||
if (TREE_CODE (op) == ADDR_EXPR)
|
||||
{
|
||||
op = TREE_OPERAND (op, 0);
|
||||
while (handled_component_p (op))
|
||||
op = TREE_OPERAND (op, 0);
|
||||
if (TREE_CODE (op) == VAR_DECL)
|
||||
op = get_base_address (TREE_OPERAND (op, 0));
|
||||
if (op && TREE_CODE (op) == VAR_DECL && !is_global_var (op))
|
||||
add_referenced_var (op);
|
||||
}
|
||||
gcc_assert (TREE_CODE (replace_info->old_tree) == PARM_DECL);
|
||||
|
|
|
@ -347,7 +347,6 @@ gimple_gen_ic_profiler (histogram_value value, unsigned tag, unsigned base)
|
|||
gimple_assign_set_lhs (stmt2, make_ssa_name (tmp1, stmt2));
|
||||
find_referenced_vars_in (stmt2);
|
||||
stmt3 = gimple_build_assign (ic_void_ptr_var, gimple_assign_lhs (stmt2));
|
||||
add_referenced_var (ic_void_ptr_var);
|
||||
|
||||
gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
|
||||
gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
|
||||
|
@ -383,11 +382,9 @@ gimple_gen_ic_func_profiler (void)
|
|||
counter_ptr = force_gimple_operand_gsi (&gsi, ic_gcov_type_ptr_var,
|
||||
true, NULL_TREE, true,
|
||||
GSI_SAME_STMT);
|
||||
add_referenced_var (ic_gcov_type_ptr_var);
|
||||
ptr_var = force_gimple_operand_gsi (&gsi, ic_void_ptr_var,
|
||||
true, NULL_TREE, true,
|
||||
GSI_SAME_STMT);
|
||||
add_referenced_var (ic_void_ptr_var);
|
||||
tree_uid = build_int_cst (gcov_type_node, current_function_funcdef_no);
|
||||
stmt1 = gimple_build_call (tree_indirect_call_profiler_fn, 4,
|
||||
counter_ptr, tree_uid, cur_func, ptr_var);
|
||||
|
|
|
@ -630,7 +630,6 @@ build_one_array (gimple swtch, int num, tree arr_index_type, gimple phi,
|
|||
DECL_ARTIFICIAL (decl) = 1;
|
||||
TREE_CONSTANT (decl) = 1;
|
||||
TREE_READONLY (decl) = 1;
|
||||
add_referenced_var (decl);
|
||||
varpool_finalize_decl (decl);
|
||||
|
||||
fetch = build4 (ARRAY_REF, value_type, decl, tidx, NULL_TREE,
|
||||
|
|
|
@ -458,7 +458,6 @@ add_new_static_var (tree type)
|
|||
DECL_ABSTRACT (new_decl) = 0;
|
||||
lang_hooks.dup_lang_specific_decl (new_decl);
|
||||
new_node = varpool_node (new_decl);
|
||||
add_referenced_var (new_decl);
|
||||
varpool_finalize_decl (new_decl);
|
||||
|
||||
return new_node->symbol.decl;
|
||||
|
|
Loading…
Add table
Reference in a new issue