public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Do not generate special PARM_DECL in LTO mode
@ 2012-10-22  8:20 Eric Botcazou
  2012-10-22  8:50 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Botcazou @ 2012-10-22  8:20 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

We generate a special PARM_DECL for Out parameters passed by copy at -O0, but 
it doesn't play nice with LTO so this patch removes it when LTO is enabled.

Tested on x86_64-suse-linux, applied on the mainline and 4.7 branch.


2012-10-22  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Out_Parameter>: Do not
	generate the special PARM_DECL for an Out parameter in LTO mode.


-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 741 bytes --]

Index: gcc-interface/decl.c
===================================================================
--- gcc-interface/decl.c	(revision 192648)
+++ gcc-interface/decl.c	(working copy)
@@ -1503,7 +1503,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entit
 	   the VAR_DECL.  Suppress debug info for the latter but make sure it
 	   will live on the stack so that it can be accessed from within the
 	   debugger through the PARM_DECL.  */
-	if (kind == E_Out_Parameter && definition && !optimize && debug_info_p)
+	if (kind == E_Out_Parameter
+	    && definition
+	    && debug_info_p
+	    && !optimize
+	    && !flag_generate_lto)
 	  {
 	    tree param = create_param_decl (gnu_entity_name, gnu_type, false);
 	    gnat_pushdecl (param, gnat_entity);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Ada] Do not generate special PARM_DECL in LTO mode
  2012-10-22  8:20 [Ada] Do not generate special PARM_DECL in LTO mode Eric Botcazou
@ 2012-10-22  8:50 ` Richard Biener
  2012-10-22 11:50   ` Eric Botcazou
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2012-10-22  8:50 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc-patches

On Mon, Oct 22, 2012 at 10:04 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> We generate a special PARM_DECL for Out parameters passed by copy at -O0, but
> it doesn't play nice with LTO so this patch removes it when LTO is enabled.
>
> Tested on x86_64-suse-linux, applied on the mainline and 4.7 branch.

Shouldn't it be simply the abstract origin for the VAR_DECL?  Or be
not 'lowered'
here but be a 'proper' PARM_DECL with DECL_VALUE_EXPR?  That said,
how is debug info emitted in the optimize case?

No objection to the patch as-is, but guarding sth with flag_generate_lto always
makes me suspicious ;)

Richard.

> 2012-10-22  Eric Botcazou  <ebotcazou@adacore.com>
>
>         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Out_Parameter>: Do not
>         generate the special PARM_DECL for an Out parameter in LTO mode.
>
>
> --
> Eric Botcazou

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Ada] Do not generate special PARM_DECL in LTO mode
  2012-10-22  8:50 ` Richard Biener
@ 2012-10-22 11:50   ` Eric Botcazou
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Botcazou @ 2012-10-22 11:50 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

> Shouldn't it be simply the abstract origin for the VAR_DECL?  Or be
> not 'lowered'
> here but be a 'proper' PARM_DECL with DECL_VALUE_EXPR?  That said,
> how is debug info emitted in the optimize case?

This is a PARM_DECL with DECL_VALUE_EXPR set to the VAR_DECL emitted in the 
outermost function scope.  It doesn't survive with optimization enabled so we 
don't bother generating it in this case.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-22 10:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-22  8:20 [Ada] Do not generate special PARM_DECL in LTO mode Eric Botcazou
2012-10-22  8:50 ` Richard Biener
2012-10-22 11:50   ` Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).