Simon Marlow wrote:
>You should either compile the whole lot with -O, or not at all.
Really? What are the consequences if you don't? It doesn't lead to incorrectly
linked code, does it?
I can see that, even if you compiled module A with -O, and then tried to call some
functions of A from module B, B being compiled without -O , then the lack of inlining,
etc. would render some of the optimization useless. But suppose I have a collection
of modules which form a library A, which I'm using from some larger application B, and
A is optimized with -O since it's stable, but B is in development so I'm not using -O.
Then the calls to the library interface functions won't be optimized, but I would
still get good performance from the calls that the the library makes to itself
internally, right?
Should -O be specified when linking code?
--FC