I suggest also using -fverbose-asm
because then the generated assembler has some generated comments which "explains" the code. For example:
gcc -S -fverbose-asm -O2 foo.c
would generate in foo.s
(with some comments) the assembler code produced by compiling foo.c
And to understand what the GCC optimizations are doing one could even try -fdump-tree-all
(but this produces hundreds of files!).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…