[PATCH, PR 43141] Create ABSTRACT_ORIGIN for decls changed by IPA-SRA
Richard Guenther
rguenther@suse.de
Fri Mar 12 10:49:00 GMT 2010
On Fri, 12 Mar 2010, Martin Jambor wrote:
> Hi,
>
> the patch below (a bit simpler than the one attached in bugzilla)
> fixes PR 43141 by building an ABSTRACT_ORIGIN decl for it. This does
> lead to emitting deleted parameters in debug info and is easier than
> creating a decl for the function that we actually use and update all
> calls. Obviously it is a bit of a hack, but I hope it is an
> acceptable one.
>
> The patch successfully bootstraps and tests with no regressions on
> x86_64-linux. OK for trunk?
Ok with ...
> Thanks,
>
> Martin
>
>
> 2010-03-11 Martin Jambor <mjambor@suse.cz>
>
> PR tree/optimization/43141
> * tree-sra.c (create_abstract_origin): New function.
> (modify_function): Call create_abstract_origin.
>
> Index: mine/gcc/tree-sra.c
> ===================================================================
> --- mine.orig/gcc/tree-sra.c
> +++ mine/gcc/tree-sra.c
> @@ -4048,6 +4048,26 @@ convert_callers (struct cgraph_node *nod
> return;
> }
>
> +/* Create an abstract origin declaration for OLD_DECL and make it an anbstract
Extra horizontal space after /* removed
> + 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,8 @@ modify_function (struct cgraph_node *nod
> 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. */
> +
Extra vertical space removed.
Thanks,
Richard.
> + 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);
>
>
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex
More information about the Gcc-patches
mailing list