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

--- Comment #5 from David Blaikie <dblaikie at gmail dot com> ---
(In reply to Andrew Pinski from comment #4)
> (In reply to David Blaikie from comment #2)
> > (In reply to Richard Biener from comment #1)
> > > We produce an abstract copy for use by repeated inline copies.
> > 
> > Yep! Is it still reasonable to consider it a bug (or at least a feature
> > request) that this is still produced even when no inline copies are emitted?
> 
> Not really. 
> 
> Sounds like what you are aiming for is the nodebug attribute that you can
> use with always_inline. Basically in dwarf inline functions are still
> represented as functions (calls) and most folks want that for their
> debugability of their program but in this case you specific inlined
> functions not to have debug info which is exactly what nodebug would do ...

Not sure I follow. I'm not suggesting this function should be `nodebug`.

Specifically: If an abstract origin is unreferenced, it seems like it
should/could be omitted, for brevity.

If the abstract origin is referenced - if there was some remnant of the inlined
code that then caused an inlined_subroutine to be emitted, that would need to
reference the abstract origin and so the latter should be emitted.

This is what clang does, at least - thought it might be nice for gcc to do that
to, to have more compact DWARF output.

https://godbolt.org/z/3doWWK4G4

(though, interestingly, since this bug was filed - in GCC 9, GCC started
putting NOPs in for the inlined code, which is a nice touch - so at -O0 you can
still step into/out of a no-op (or presumably otherwise optimized away? if you
had some optimizations forced on at -O0 somehow) inlined function - but with
optimizations enabled you still see the behavior of an abstract origin emitted
without any uses/references to it)

Reply via email to