From: jamborm Date: Mon, 15 Mar 2010 11:43:04 +0000 (+0000) Subject: 2010-03-15 Martin Jambor X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=f8cf223596213553238104cc8f04caaedf165b40 2010-03-15 Martin Jambor 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 437c6061a80..fcb54526627 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-03-15 Martin Jambor + + PR tree/optimization/43141 + * tree-sra.c (create_abstract_origin): New function. + (modify_function): Call create_abstract_origin. + 2010-03-15 Chris Demetriou * 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 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);