GNU project C and C++ compiler
-O
-O1 Optimize.  Optimizing compilation takes somewhat more time, and a lot more memory for a large
    function.

    With -O, the compiler tries to reduce code size and execution time, without performing any
    optimizations that take a great deal of compilation time.

    -O turns on the following optimization flags:

    -fauto-inc-dec -fcompare-elim -fcprop-registers -fdce -fdefer-pop -fdelayed-branch -fdse
    -fguess-branch-probability -fif-conversion2 -fif-conversion -fipa-pure-const -fipa-profile
    -fipa-reference -fmerge-constants -fsplit-wide-types -ftree-bit-ccp -ftree-builtin-call-dce
    -ftree-ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop
    -ftree-fre -ftree-phiprop -ftree-sra -ftree-pta -ftree-ter -funit-at-a-time

    -O also turns on -fomit-frame-pointer on machines where doing so does not interfere with debugging.
source manpages: gcc