diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2011-02-17 16:18:24 +0000 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2011-02-17 16:18:24 +0000 |
commit | bb7e6d55dac07daafb45645002be2798f78c87b2 (patch) | |
tree | a5366c0ffa8ef61e2d0da52de00aa6d5a7cf2871 /gcc/tree-inline.c | |
parent | f181a8a73f8b1e0a36659eddcdd94f89ce897561 (diff) | |
download | gcc-bb7e6d55dac07daafb45645002be2798f78c87b2.zip gcc-bb7e6d55dac07daafb45645002be2798f78c87b2.tar.gz gcc-bb7e6d55dac07daafb45645002be2798f78c87b2.tar.bz2 |
re PR debug/47106 (-fcompare-debug failure (length) with -fpartial-inlining -flto -fconserve-stack)
PR debug/47106
PR debug/47402
* cfgexpand.c (account_used_vars_for_block): Remove.
(estimated_stack_frame_size): Use referenced vars.
* tree-inline.c (remap_decl): Only mark VAR_DECLs as referenced
that were referenced in the original function. Test src_fn
rather than cfun. Drop redundant get_var_ann.
(setup_one_parameter): Drop redundant get_var_ann.
(declare_return_variable): Likewise.
(copy_decl_for_dup_finish): Mark VAR_DECLs referenced in src_fn.
(copy_arguments_for_versioning): Drop redundant get_var_ann.
* ipa-inline.c (compute_inline_parameters): Do not compute
disregard_inline_limits here.
are not available.
(compute_inlinable_for_current, pass_inlinable): New.
(pass_inline_parameters): Require PROP_referenced_vars.
* cgraphunit.c (cgraph_process_new_functions): Don't run
compute_inline_parameters explicitly unless function is in
SSA form.
(cgraph_analyze_function): Set .disregard_inline_limits.
* tree-sra.c (convert_callers): Compute inliner parameters
only for functions already in SSA form.
* g++.dg/debug/pr47106.C: New.
Co-Authored-By: Jan Hubicka <jh@suse.cz>
From-SVN: r170249
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 8cfdb28..de30cfd 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -312,13 +312,17 @@ remap_decl (tree decl, copy_body_data *id) walk_tree (&DECL_QUALIFIER (t), copy_tree_body_r, id, NULL); } - if (cfun && gimple_in_ssa_p (cfun) - && (TREE_CODE (t) == VAR_DECL - || TREE_CODE (t) == RESULT_DECL || TREE_CODE (t) == PARM_DECL)) - { - get_var_ann (t); - add_referenced_var (t); - } + if ((TREE_CODE (t) == VAR_DECL + || TREE_CODE (t) == RESULT_DECL + || TREE_CODE (t) == PARM_DECL) + && id->src_fn && DECL_STRUCT_FUNCTION (id->src_fn) + && gimple_referenced_vars (DECL_STRUCT_FUNCTION (id->src_fn)) + /* We don't want to mark as referenced VAR_DECLs that were + not marked as such in the src function. */ + && (TREE_CODE (decl) != VAR_DECL + || referenced_var_lookup (DECL_STRUCT_FUNCTION (id->src_fn), + DECL_UID (decl)))) + add_referenced_var (t); return t; } @@ -2547,10 +2551,7 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn, /* We're actually using the newly-created var. */ if (gimple_in_ssa_p (cfun) && TREE_CODE (var) == VAR_DECL) - { - get_var_ann (var); - add_referenced_var (var); - } + add_referenced_var (var); /* Declare this new variable. */ DECL_CHAIN (var) = *vars; @@ -2857,10 +2858,7 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest, var = copy_result_decl_to_var (result, id); if (gimple_in_ssa_p (cfun)) - { - get_var_ann (var); - add_referenced_var (var); - } + add_referenced_var (var); DECL_SEEN_IN_BIND_EXPR_P (var) = 1; @@ -2896,10 +2894,7 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest, { tree temp = create_tmp_var (TREE_TYPE (result), "retvalptr"); if (gimple_in_ssa_p (id->src_cfun)) - { - get_var_ann (temp); - add_referenced_var (temp); - } + add_referenced_var (temp); insert_decl_map (id, result, temp); /* When RESULT_DECL is in SSA form, we need to use it's default_def SSA_NAME. */ @@ -4753,6 +4748,14 @@ copy_decl_for_dup_finish (copy_body_data *id, tree decl, tree copy) new function. */ DECL_CONTEXT (copy) = id->dst_fn; + if (TREE_CODE (decl) == VAR_DECL + /* C++ clones functions during parsing, before + referenced_vars. */ + && gimple_referenced_vars (DECL_STRUCT_FUNCTION (id->src_fn)) + && referenced_var_lookup (DECL_STRUCT_FUNCTION (id->src_fn), + DECL_UID (decl))) + add_referenced_var (copy); + return copy; } @@ -4864,7 +4867,6 @@ copy_arguments_for_versioning (tree orig_parm, copy_body_data * id, as temporary variable later in function, the uses will be replaced by local variable. */ tree var = copy_decl_to_var (arg, id); - get_var_ann (var); add_referenced_var (var); insert_decl_map (id, arg, var); /* Declare this new variable. */ |