Clang 11 Changes -O To Match GCC Behavior
Clang 11.0 has changed its "-O" optimization flag to match the defaults of GCC.
LLVM Clang currently treats the -O option as matching the -O2 optimization level as that was chosen back when Clang didn't differ between -O1 and -O2 optimization levels. GCC meanwhile has treated -O as the -O1 optimization level.
But now with Clang's -O1 and -O2 behavior differing, Clang has changed its -O behavior to -O1 in matching the characteristics of the GNU Compiler Collection.
The change is in Clang Git for the 11.0 milestone this autumn. No changes were made to any of the optimization levels with this commit but simply the behavior of "-O" should you be using that for any of your compiler flag optimization levels it will now be slightly less aggressive.
LLVM Clang currently treats the -O option as matching the -O2 optimization level as that was chosen back when Clang didn't differ between -O1 and -O2 optimization levels. GCC meanwhile has treated -O as the -O1 optimization level.
But now with Clang's -O1 and -O2 behavior differing, Clang has changed its -O behavior to -O1 in matching the characteristics of the GNU Compiler Collection.
The change is in Clang Git for the 11.0 milestone this autumn. No changes were made to any of the optimization levels with this commit but simply the behavior of "-O" should you be using that for any of your compiler flag optimization levels it will now be slightly less aggressive.
13 Comments