aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2010-03-15 12:43:04 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2010-03-15 12:43:04 +0100
commit932e2e64b1f6bcdca46f9a65362a91e4147e3435 (patch)
tree3887c1c1af1adf0159a6d687d5efc3f1d8d37e1b /gcc
parenta45816680990b39659093d4cd0a04b9a3be9f7da (diff)
downloadgcc-932e2e64b1f6bcdca46f9a65362a91e4147e3435.zip
gcc-932e2e64b1f6bcdca46f9a65362a91e4147e3435.tar.gz
gcc-932e2e64b1f6bcdca46f9a65362a91e4147e3435.tar.bz2
PR tree/optimization/43141
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. From-SVN: r157456
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-sra.c21
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 437c606..fcb5452 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2010-03-15 Chris Demetriou <cgd@google.com>
* Makefile.in (stmp-int-hdrs): Don't chmod include/stdint.h if it
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index d32ef38..984260f 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);