There is a problem in this implementation. At Line#302 of 
lib/Frontend/CompilerInvocation.cpp:
Opts.OptimizationLevel = getOptimizationLevel(Args, IK, Diags);

Notice that Opts.OptimizationLevel is a 3-bit bitfield, so any optimization 
bigger than 8 are truncated, so
for example, in test/Driver/invalid-o-level.c, you have checked that you get a 
nice diagnostic for -O900, but
if you try -O899, you will not get any diagnostics.

I think one needs to diagnose on the unsigned optimization level before 
assigning it to the bitfield.

http://reviews.llvm.org/D2152



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to