What compiler optimization flags actually enable under the hood:
-O2: Enables standard optimizations (instruction scheduling, register allocation, inlining, common subexpression elimination).-O3: Adds aggressive loop unrolling, SIMD auto-vectorization, and function cloning (can increase binary code size).-Os/-Oz: Prioritizes code compactness, disabling loop unrolling to maximize CPU L1 Instruction Cache hits.-Ofast: Enables-O3plus-ffast-math(breaks IEEE 754 floating point standard compliance and NaN/Infinity guarantees!).