This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: #pragma optimization_level


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]