Re: Unimpressed with pg_attribute_always_inline - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Unimpressed with pg_attribute_always_inline
Date
Msg-id CAH2-WzkSkCK8kHhGfGs5ZNEcFYCJxO8V9cVB-8-ppQ0X+t=pCw@mail.gmail.com
Whole thread Raw
In response to Re: Unimpressed with pg_attribute_always_inline  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: Unimpressed with pg_attribute_always_inline
List pgsql-hackers
On Mon, Jan 8, 2018 at 5:09 PM, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> However, at <https://gcc.gnu.org/onlinedocs/gcc/Inline.html> it says,
> "GCC does not inline any functions when not optimizing unless you
> specify the ‘always_inline’ attribute for the function".  So,
> apparently, if the goal is to turn off inlining when not optimizing,
> then we should just use the normal inline attribute.

The compiler isn't obligated to inline anything with the normal inline
attribute. The whole point of always_inline is that the programmer may
know better than the compiler about inlining in some specific cases,
and may therefore want to make inlining absolutely mandatory. IIUC,
that's almost what we want, except that it also inlines with -O0,
which we do not want.

Have I missed the point here?

--
Peter Geoghegan


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Unimpressed with pg_attribute_always_inline
Next
From: Michael Paquier
Date:
Subject: Re: Enhance pg_stat_wal_receiver view to display connected host