The compiler phases

A typical compiler invocation executes some or all of these activities in sequence. For link time optimizations, some activities are executed more than once during a compilation. As each compilation component runs, the results are sent to the next step in the sequence.

  1. Preprocessing of source files
  2. Compilation, which may consist of the following phases, depending on what compiler options are specified:
    1. Front-end parsing and semantic analysis
    2. Loop transformations
    3. High-level optimization
    4. Low-level optimization
    5. Register allocation
    6. Final assembly
  3. Assemble the assembly (.s) files, and the unpreprocessed assembler (.S) files after they are preprocessed
  4. Object linking to create an executable application

To see the compiler step through these phases, specify the -v compiler option when you compile your application. To see the amount of time the compiler spends in each phase, specify -qphsinfo.