How to disable compiler optimizations in gcc?

后端 未结 7 838
误落风尘
误落风尘 2020-12-07 11:07

I am trying to learn assembly language. I have searched and found how to disassemble a .c file but I think it produces some optimized version of the program. Is

7条回答
  •  孤城傲影
    2020-12-07 11:42

    You can disable optimizations if you pass -O0 with the gcc command-line.

    E.g. to turn a .C file into a .S file call:

    gcc -O0 -S test.c

提交回复
热议问题