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