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

--- Comment #7 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 1 Dec 2022, me at xenu dot pl wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107931
> 
> --- Comment #5 from Tomasz Konojacki <me at xenu dot pl> ---
> To sum this thread up, there are undocumented rules that can cause a
> semantically identical program to be rejected by the compiler under certain
> optimisation levels (with an uninformative error message) and users are
> expected to know them.
> 
> Thank you.

It's even documented (I've marked the relevant sentence with
---> ... <---):

@item always_inline
@cindex @code{always_inline} function attribute
Generally, functions are not inlined unless optimization is specified.
For functions declared inline, this attribute inlines the function
independent of any restrictions that otherwise apply to inlining.
Failure to inline such a function is diagnosed as an error.
---> Note that if such a function is called indirectly the compiler may
or may not inline it depending on optimization level and a failure
to inline an indirect call may or may not be diagnosed. <---

Reply via email to