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

--- Comment #7 from Matthias Kretz (Vir) <mkretz at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #5)
> Note, always_inline is not a guarantee out of line copy will not be emitted.
> Either because address of the always_inline function is taken and not
> optimized in all places into a direct call, or when using
> -fkeep-inline-functions.

Right. But would this warrant a new attribute? FWIW, maybe? Because besides
always_inline I also use template parameters as a kind of ABI-tagging so that
functions with different psabi get a different mangled name. GCC can't know
that my template parameter does that. So if I had a function attribute to turn
of psabi warnings ...

> So, not emitting -Wpsabi in those cases looks wrong (sure, perhaps it could
> be somehow restricted to the cases where the function body is actually
> emitted, so for DECL_DISREGARD_INLINE_LIMITS don't warn when processing the
> function declaration and repeat the diagnostics for
> DECL_DISREGARD_INLINE_LIMITS functions when emitting the body.
> Though wonder if that would cover the always_inline,gnu_inline extern inline
> cases where we emit a call to the external definition.

I guess we would need a good test case that covers all the corner cases?

Reply via email to