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

--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to ishikawa,chiaki from comment #14)
> (In reply to Andrew Pinski from comment #13)
> > (In reply to ishikawa,chiaki from comment #11)
> > > What is exactly the compiler-defined macro when "-Og" is used on the 
> > > command
> > > line?
> > 
> > There is not one ...
> 
> Thank you for the information.
> I see we may have to create a protocol by creating a commonly used macro to
> handle the situation.
> 
> The bugzilla I created at mozilla is
> https://bugzilla.mozilla.org/show_bug.cgi?id=1817565
> 
> And the code seems to be a third party code and I was advised to report the
> issue to the originating github also.
> I will.
> 
> Thank you again.
> 
> PS: Given the manual description, it could be gcc-10 and gcc-11 may not have
> inlined the functions, but the errors were not reported as such. Oh well.

It is generally not possible to compute all indirect call sites to an
always_inline function.  It would be possible to simply disallow taking
the address of an always_inline function but we rejected that based on
the use of indirect calls to always_inline functions in the wild but instead
opted to document that we do not really support this usage.  A weaker
option to never emit the body of an always_inline function out-of-line
was rejected as well (you'd then a least get linker errors for missed
[indirect] calls).

We could opt to _not_ diagnose such missed inlines iff the function had
its address taken at some point, but then you won't notice missed inlines
of always-inline either.

Reply via email to