does #pragma GCC optimize work with gcc 4.9.2 LTO?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Starting to use -flto and have a question.

Have a medium-size program where
the majority of the code runs best
with -O2.  However a handful of
functions run _much_ better with -O3.

In the non-LTO approach this is a simple
matter of compiling each module with
the appropriate optimization flag.

With LTO, it appears the link-time
optimizer works at only one level,
either the explicitly chosen one or
the level found in the first .o

Can we use

#pragma GCC push_options
#pragma GCC optimize ("-O3")
   function() {}
#pragma GCC pop_options

To obtain the desired mixed-optimization
with -flto?

Is ok if the outcome is not perfectly
the same.  In our case the specific
optimization that matter are loop
unrolling, inlining of small functions,
and bit field access optimization.

Working with gcc/g++ 4.9.2 and binutils 2.24.

Thanks





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux