Optimization level
The -O0 through -O3 flags and their siblings, each switching on a preset bundle of optimization passes so users don't have to pick from hundreds.
In GCC and Clang, -O0 means no optimization at all: every variable lives in memory and every line can be stepped through in a debugger. -O1 takes the cheap wins, -O2 is what most distributions build with, and -O3 adds aggressive inlining, loop unrolling and vectorization that sometimes makes code bigger without making it faster. -Os and -Oz optimize for size, while -Og, added in GCC 4.8, tries to stay debuggable. MSVC has its own /Od, /O1 and /O2.
The odd one out is -Ofast, which enables -ffast-math and thereby breaks IEEE 754. Clang started warning about it in 2024. A program that only works at -O0 almost always has undefined behavior in it, not a compiler bug.