This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch committed: Make exact_log2 and floor_log2 static inline
Andrew Pinski <pinskia@gmail.com> writes:
> On Tue, Jun 16, 2009 at 9:58 AM, Ian Lance Taylor<iant@google.com> wrote:
>> The functions exact_log2 and floor_log2 are defined in toplev.h and
>> toplev.c as GNU89 extern inline functions. ÂThis does not work right
>> with C++ or with C99. ÂFor C99 we could use the gnu_inline attribute,
>> but there is really no advantage to doing so.
>
> GNU C++ also has the gnu_inline attribute. Have you benchmarked the
> compiler after this change? What about size difference in the
> produced cc1/cc1plus (this is the advantage for doing it this way
> really)? Does it change a lot?
It makes no difference in practice. These functions are tiny and are
always inlined (when compiling with optimization). I could make them
macros if you prefer.
Ian