[Bug debug/87362] GCC produces with LTO debug info with which gdb is not happy about

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Sep 24 13:03:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87362

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aoliva at gcc dot gnu.org

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #15)
> So with all this (the patch) LTO debuginfo looks much nicer (and is smaller)
> but that doesn't help gdb to consume less memory or be faster at startup. 
> *sigh*
> 
> I guess that the DW_TAG_imported_unit DIEs causes it to pull in everything
> up-front somehow while w/o LTO much more debuginfo is processed lazily.
> Well, wild guessing...
> 
> Anyhow, testing a patch to inlined_function_outer_scope_p for the original
> issue (looking at BLOCK_ABSTRACT_ORIGIN rather than BLOCK_SOURCE_LOCATION).

Bah - NOTE_INSN_INLINE_ENTRY throws a wrench into this...

The only option looks like assigning a proper location to the call stmt
in the first place.  The BUILTINS_LOCATION hack wouldn't work either there.
Well, just record the BLOCK directly for NOTE_INSN_INLINE_ENTRY ... somehow.

I was talking about doing the following:

Index: gcc/tree.h
===================================================================
--- gcc/tree.h  (revision 264534)
+++ gcc/tree.h  (working copy)
@@ -4749,7 +4749,8 @@ function_args_iter_next (function_args_i
 static inline bool
 inlined_function_outer_scope_p (const_tree block)
 {
- return LOCATION_LOCUS (BLOCK_SOURCE_LOCATION (block)) != UNKNOWN_LOCATION;
+ return (BLOCK_ABSTRACT_ORIGIN (block)
+        && TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block)) == FUNCTION_DECL);
 }

 /* Loop over all function arguments of FNTYPE.  In each iteration, PTR is set


The only "sensible" location for the call to the split part I can statically
come up with is DECL_SOURCE_LOCATION given we already use DECL_INITIAL for
its block ... "better" would likely be a location/block from somewhere around
the split region.


More information about the Gcc-bugs mailing list