Steps for problem diagnosis using optimization levels

Before you begin: For diagnostic purposes, you should always begin by using the simplest optimization level on your program. Once you address all problems at your current level, progress toward the more complex levels of optimization.

Perform the following steps to progress through the various levels of optimization:

  1. Begin with a non-IPA compile and link using progressively higher levels of optimization:
    • OPT(0)
    • OPT(2)
    • OPT(3)

    If your program works successfully at OPT(0) and fails at OPT(2), try rebuilding the program specifying the compiler option NOANSIALIAS and re-running. You may suffer a performance penalty for this as the optimizer has to make worst-case aliasing assumptions but it may resolve the problem.

    _______________________________________________________________

  2. Use IPA(OBJECT,NOLINK) and OPT(2). This adds the IPA compile-time optimizations and often locates the problematic source file before you invest a lot of time and effort diagnosing problems in your code at IPA Link time.

    _______________________________________________________________

  3. Use the full IPA Compile and IPA(Level(1)) Link path. IPA Compile-time optimizations are performed on the IPA object. IPA Link-time optimizations are performed on the entire application.

    _______________________________________________________________

  4. Use the full IPA Compile and IPA(Level(2)) Link path. IPA Level 2 performs additional link-time optimizations.

    _______________________________________________________________

You know you are done when you have exploited all optimizations offered by the compiler.