To get maximum optimization, use:
cc +Oall
The +Oall option performs the maximum optimization.
Use +Oall with stable, well-structured, ANSI-conforming
code. These types of optimizations give you the fastest code, but
are riskier than the default optimizations.
You can use +Oall at optimization levels 2, 3, and 4. The default
is +Onoall.
The +Oall option by itself (specified without the +02, +03, or +04 options) combines the +O4 +Oaggressive +Onolimit options. This combination performs aggressive
optimizations with unrestricted compile time at the highest level
of optimization.