[Bug ada/83765] LTO bootstrap with Ada fails

2018-01-10 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83765

--- Comment #3 from rguenther at suse dot de  ---
On Wed, 10 Jan 2018, ebotcazou at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83765
> 
> Eric Botcazou  changed:
> 
>What|Removed |Added
> 
>  Status|UNCONFIRMED |NEW
>Last reconfirmed||2018-01-10
>  CC||ebotcazou at gcc dot gnu.org
>  Ever confirmed|0   |1
> 
> --- Comment #2 from Eric Botcazou  ---
> The combination Ada + LTO + debug has always been a recipe for problems.

Yes...  the patch seems to fix it though (ha!).  It would be interesting
as well to know if the early LTO debug work helps in debugging Ada
programs compiled with LTO ;)

[Bug ada/83765] LTO bootstrap with Ada fails

2018-01-10 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83765

Eric Botcazou  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-01-10
 CC||ebotcazou at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Eric Botcazou  ---
The combination Ada + LTO + debug has always been a recipe for problems.

[Bug ada/83765] LTO bootstrap with Ada fails

2018-01-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83765

--- Comment #1 from Richard Biener  ---
Doesn't seem to work :/

I guess making the old_die && declaration more prevalent might work.

Index: gcc/dwarf2out.c
===
--- gcc/dwarf2out.c (revision 256378)
+++ gcc/dwarf2out.c (working copy)
@@ -22044,6 +22044,11 @@ gen_subprogram_die (tree decl, dw_die_re
   int declaration = (current_function_decl != decl
 || class_or_namespace_scope_p (context_die));

+  /* A declaration that has been previously dumped needs no
+ additional information.  */
+  if (old_die && declaration)
+return;
+
   /* Now that the C++ front end lazily declares artificial member fns, we
  might need to retrofit the declaration into its class.  */
   if (!declaration && !origin && !old_die
@@ -22084,11 +22089,6 @@ gen_subprogram_die (tree decl, dw_die_re
  much as possible.  */
   else if (old_die)
 {
-  /* A declaration that has been previously dumped needs no
-additional information.  */
-  if (declaration)
-   return;
-
   if (!get_AT_flag (old_die, DW_AT_declaration)
  /* We can have a normal definition following an inline one in the
 case of redefinition of GNU C extern inlines.