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
This commit is contained in:
Martin Jambor 2010-03-15 12:43:04 +01:00 committed by Martin Jambor
parent a458166809
commit 932e2e64b1
2 changed files with 27 additions and 0 deletions

View File

@ -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

View File

@ -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);