-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Medium
-
Code Generation Tools
-
CODEGEN-13751
-
-
ARMCLANG_5.0.0.LTS*
-
default
-
When the compiler is invoked with multiple optimization flags on the command line, the goal of linktime optimization may not agree with the goal of the first optimization.
Expectation
When multiple optimization options are passed to the compiler, the last one seen takes precedence for both the initial compilation as well as LTO
Observation
-O1, -O2, -O3, -Os, -Oz, and -Og always take precedence over any other optimization options
-O0 takes precedence over -Ofast
Example
tiarmclang -O3 -O0 -flto project.c -Wl,lnk.cmd
Correctly compiles project.c with no optimization (-O0)
Incorrectly recompiles project.c as part of link-time optimization with speed-focused optimization (-O3)