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.

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

Some separation of these phases is observable with the -v compiler option. To see the amount of time the compiler spends in various phases, specify -ftime-report.