This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/81940] [8 regression] internal compiler error: in dwarf2out_abstract_function, at dwarf2out.c:21613
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 23 Aug 2017 12:01:31 +0000
- Subject: [Bug lto/81940] [8 regression] internal compiler error: in dwarf2out_abstract_function, at dwarf2out.c:21613
- Auto-submitted: auto-generated
- References: <bug-81940-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81940
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ok, so we have no early debug but enable late debug. I suppose at some point
we want to have -g vs. -g0 set per function.
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c (revision 251275)
+++ gcc/dwarf2out.c (working copy)
@@ -21609,7 +21578,10 @@ dwarf2out_abstract_function (tree decl)
return;
old_die = lookup_decl_die (decl);
- /* With early debug we always have an old DIE. */
+ /* With early debug we always have an old DIE unless we are in LTO
+ and the user did not compile but only link with debug. */
+ if (in_lto_p && ! old_die)
+ return;
gcc_assert (old_die != NULL);
if (get_AT (old_die, DW_AT_inline)
|| get_AT (old_die, DW_AT_abstract_origin))
mixing -g0 at compile-time with -g at link time might uncover more surprises.