How to disable compiler optimizations in gcc?

后端 未结 7 839
误落风尘
误落风尘 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:50

    Use the command-line option -O0 (-[capital o][zero]) to disable optimization, and -S to get assembly file. Look here to see more gcc command-line options.

提交回复
热议问题