This is the mail archive of the gcc-help@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: Optimization across translation units


On Wed, Apr 27, 2011 at 7:34 PM, richard Cavell <richardcavell@mail.com> wrote:
> Hi everyone.
>
> For manageability, I have broken up one source file that was 1500 lines long into several that are each a couple of hundred lines long.? Now my executable is bigger.? In order to make it work I had to take some functions that were static and make them non-static (and extern them in a .h file).? It is obvious that the compiler is no longer able to optimize as much.
>
> Does anyone have any ideas on how to get decent optimization where a function is calling a function in a different translation unit?
>
> Richard
>


You should look into link-time optimization (LTO).  I think this is
supported in the more recent versions of gcc.

  Brian


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