Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22051

What does gcc (and clang) do if you specify more than one optimization flag together? [duplicate]

$
0
0

The build system is impossible to figure out, although it IS possible to configure an additional flag: In trying to do some quick-and-dirty tests, I'm able to inject an additional -O3 flag to see how the program's performance is under -O3 optimization.

However, -O2 is also specified, and is specified afterwards.

The question is, is it well-defined that for the compiler only the last optimization flag will stick? Or will it (I hope) go with the highest-specified optimization level? Or is it undefined? It is definitely not complaining or erroring out, that's for sure.


Viewing all articles
Browse latest Browse all 22051

Trending Articles