Цитата(gotty @ Apr 24 2011, 12:05)

Цитата(belen @ Apr 25 2011, 13:05)

Я работаю с GCC уже не первый год и знаю какие флаги изменяют режим оптимизации, но режим оптимизации прменяется ко всему файлу(ам).
__attribute__ ((optimize("Os")))
Цитата
optimize
The optimize attribute is used to specify that a function is to be compiled with different optimization options than specified on the command line. Arguments can either be numbers or strings. Numbers are assumed to be an optimization level. Strings that begin with O are assumed to be an optimization option, while other options are assumed to be used with a -f prefix. You can also use the `#pragma GCC optimize' pragma to set the optimization options that affect more than one function. See Function Specific Option Pragmas, for details about the `#pragma GCC optimize' pragma.
This can be used for instance to have frequently executed functions compiled with more aggressive optimization options that produce faster and larger code, while other functions can be called with less aggressive options.
Работает с начиная с версии GCC 4.4.