RFC: #pragma optimization_level
Andi Kleen
ak@muc.de
Fri Apr 1 16:05:00 GMT 2005
Dale Johannesen <dalej@apple.com> writes:
> I've currently got the job of implementing pragma(s) to change
> optimization level in the middle of a file. This has come up a few
> times before,
Would it be possible to make it a function attribute? I would
really like to have
void __attribute__((optimization("Os"))) slow_init_function(void)
{
}
to let slow_init_function be compiled as space efficient as possible.
I think that would be very useful for the Linux kernel at least.
There is already a __init modifier for functions that ought to be
freed after initialization and it would be nice to just add a one
liner to make them smaller too.
In addition letting the compiler do that automatically based
on profile feedback for "cold" functions would be very cool.
-Andi
More information about the Gcc
mailing list