a question about code optimization

John Love-Jensen eljay@adobe.com
Sat Jan 5 14:25:00 GMT 2008


> So my questions is:
> is gcc *smart* enough that she can determine when to do the optimization?


GCC can do the optimization when the optimizer has sufficient information to
be certain that there are no side effects.

GCC can not do the optimization when there is a black-box routine involved.
Although there may be some aspects outside of the black-box routine that may
be optimized.

There is another compiler, LLVM, that does holistic optimizations.  If I
recall correct, there is an effort to add (or perhaps merely to investigate
adding) holistic optimizations into GCC.


More information about the Gcc-help mailing list