aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-05-24 12:33:49 +0000
committerRichard Guenther <rguenther@suse.de>2012-05-24 12:33:49 +0000
commitae33aa78ea33415dcc9452d2944b4ec14538e885 (patch)
tree75e0e3fd63130e66ee5ef53fc1590ec6a8160b24 /gcc/tree-inline.c
parent71ca2ff2bbea25ffc0c97d977845f696b4e9abc0 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@187829 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 3055d936687..a987ff0f8ae 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -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);