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

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Sun Nov 03 2002 - 15:28:32 EST


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/



This archive was generated by hypermail 2b29 : Thu Nov 07 2002 - 22:00:30 EST