Re: 2.2.0 and egcs 1.1 was Re: Sorry, wrong gcc-version

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Mon, 26 Oct 1998 16:12:57 +0000


On Mon, Oct 26, 1998 at 10:20:24AM +0100, Andi Kleen wrote:
> The reason is that macros generate better code on gcc than inline functions
> (sad but true).

Is this still true for EGCS 1.1?

With GCC the two main complaints I've had about inline functions
vs. macros are:

1. Pass by reference. You need to pass the address of a variable to
an inline function, which makes the compiler assume the variable may
alias with memory. You can just pass the name to a macro.

-> I've heard about the "addressof" optimisation in EGCS. That sounds
as though it removes the addressing in `*&var', so that accessing
a value by reference in an inline function should be as fast as
the macro form. But I'm not sure.

2. __builtin_constant_p(), Linux uses it extensively. Doesn't work in
inline functions (always returns 0).

-> I've been told that EGCS incorporated something similar to my
change to make this work in inline functions.

My original change to GCC 2.7.2 worked very well (you get even
better results than with macros and plain GCC 2.7.2, as the
constantness is propagated through variable assignments as well as
syntactically in direct expressions).

These changes would seem like rather positive reasons to switch to EGCS
officially for 2.3.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/