summaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-15 11:43:04 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-15 11:43:04 +0000
commitf8cf223596213553238104cc8f04caaedf165b40 (patch)
tree3887c1c1af1adf0159a6d687d5efc3f1d8d37e1b /gcc/tree-sra.c
parent4c6d05aad6a2d9c290ae1b480688ae3da55ef795 (diff)
downloadgcc-f8cf223596213553238104cc8f04caaedf165b40.tar.gz
2010-03-15 Martin Jambor <mjambor@suse.cz>
PR tree/optimization/43141 * tree-sra.c (create_abstract_origin): New function. (modify_function): Call create_abstract_origin. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157456 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index d32ef387d19..984260f4155 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -4048,6 +4048,26 @@ convert_callers (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments)
return;
}
+/* Create an abstract origin declaration for OLD_DECL and make it an abstract
+ origin of the provided decl so that there are preserved parameters for debug
+ information. */
+
+static void
+create_abstract_origin (tree old_decl)
+{
+ if (!DECL_ABSTRACT_ORIGIN (old_decl))
+ {
+ tree new_decl = copy_node (old_decl);
+
+ DECL_ABSTRACT (new_decl) = 1;
+ SET_DECL_ASSEMBLER_NAME (new_decl, NULL_TREE);
+ SET_DECL_RTL (new_decl, NULL);
+ DECL_STRUCT_FUNCTION (new_decl) = NULL;
+ DECL_ARTIFICIAL (old_decl) = 1;
+ DECL_ABSTRACT_ORIGIN (old_decl) = new_decl;
+ }
+}
+
/* Perform all the modification required in IPA-SRA for NODE to have parameters
as given in ADJUSTMENTS. */
@@ -4059,6 +4079,7 @@ modify_function (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments)
ipa_modify_formal_parameters (alias->decl, adjustments, "ISRA");
/* current_function_decl must be handled last, after same_body aliases,
as following functions will use what it computed. */
+ create_abstract_origin (current_function_decl);
ipa_modify_formal_parameters (current_function_decl, adjustments, "ISRA");
scan_function (sra_ipa_modify_expr, sra_ipa_modify_assign,
replace_removed_params_ssa_names, false, adjustments);