3 ms·
I'm pretty sure in some compilers (eg llvm) there's no such thing as "no optimizations". -O0 means "I'm politely asking not to spend extra time making my progra
by iudqnolq 5y ago
I'm pretty sure in some compilers (eg llvm) there's no such thing as "no optimizations". -O0 means "I'm politely asking not to spend extra time making my program more efficient", but it's sometimes less efficient to compile the more obvious slower version of something, plus "the less efficient more obvious version" has intuitive meaning but isn't well-defined.
(But I may be wrong for C. I only know this is true for Rust. I'm pretty sure though the reason it's true for Rust has to do with the steps that happen in llvm, and thus would probably also be true for c).