Re: Some functions are not inlined by gcc 3.2, resulting code is

Alan Cox (alan@lxorguk.ukuu.org.uk)
03 Nov 2002 20:28:32 +0000


On Mon, 2002-11-04 at 00:20, Denis Vlasenko wrote:
> __constant_c_and_count_memset *has to* be inlined.
> There is large switch statement which meant to be optimized out.
> It does optimize out *only if* count is compile-time constant.

gcc already allows you to check for constants that means you can
generate

(is a constant ? inline: noninline)(to, from, len)

and I would hope gcc does the right thing. Similarly your switch will
be optimised out so the default case for the constant one can be the
invocation of uninlined code and it should optimise back to the straight
expected call.

Alan

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