This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: #pragma optimization_level
- From: Andi Kleen <ak at muc dot de>
- To: Dale Johannesen <dalej at apple dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 01 Apr 2005 18:05:47 +0200
- Subject: Re: RFC: #pragma optimization_level
- References: <c2be513156e77e58189807976b82956f@apple.com>
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