The manual on the '-fverbose-asm' option isn't quite clear:
`-fverbose-asm'
Put extra commentary information in the generated assembly code to
make it more readable. This option is generally only of use to
those who actually need to read the generated assembly code
(perhaps while debugging the compiler itself).
`-fno-verbose-asm', the default, causes the extra information to
be omitted and is useful when comparing two assembler files.
Along with other potentially interesting debugging information, it also tells gcc to print the optimization flags into the assembly file like this:
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed: -fpreprocessed -auxbase -fverbose-asm
# options enabled: -feliminate-unused-debug-types -fpeephole
# -ffunction-cse -fkeep-static-consts -fpcc-struct-return -fgcse-lm
# -fgcse-sm -fgcse-las -fsched-interblock -fsched-spec
# -fsched-stalled-insns -fsched-stalled-insns-dep -fbranch-count-reg
# -fcommon -fverbose-asm -fargument-alias -fzero-initialized-in-bss -fident
# -fmath-errno -ftrapping-math -fframe-base-loclist -m80387 -mhard-float
# -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone
# -mtls-direct-seg-refs -mtune=i386 -march=i386
Interestingly "GGC" is not a type, it means GCC's internal garbage collector.
Obviously you will need --save-temps or -S to keep the assembly file.