Programming Tools Guide
Chapter 2, C compilation system

Optimizing your program

Optimizing your program

The -O option to cc invokes the optimizer:

   $cc -O test.c 
The optimizer improves the efficiency of the assembly language code generated by the compiler. That, in turn, speeds the execution time of your object code. Use the optimizer when you have finished debugging and profiling your program.

If you know the processor your code is normally run on, you can specify that cc should generate code that is optimized specifically for that processor (for example, -Ki486). For more information, see the -K option on the cc(CP) manual page.