Overview: Optimization Levels

This section discusses the command-line options -O0, -O1, -O2, and -O3. The -O0 option disables optimizations. Each of the other three turns on several compiler capabilities. To specify one of these optimizations, take into consideration the nature and structure of your application as indicated in the more detailed description of the options. In general terms -O1, -O2, and -O3 optimize as follows:

These options behave similarly on IA-32 and Itanium® architectures, with some specifics that are detailed in the sections that follow.