我怎么能看到一个由海湾合作委员会(任何味道)编译器生成的C / C ++程序装配code? [英] How can I see the assembly code that is generated by a gcc (any flavor) compiler for a C/C++ program?
本文介绍了我怎么能看到一个由海湾合作委员会(任何味道)编译器生成的C / C ++程序装配code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图优化了很多乘法和指针算术,并希望看到编译器做什么时,下面我把优化标志。
I am trying to optimize a lot of multiplications and pointer arithmetics and would like to see what the compiler does underneath when I put in optimization flags.
- 编辑 -
如何将其限制于特定功能或code座?
How to restrict it to a specific function or a code block?
- Edit_2 -
如何让GCC生成一个更简洁了汇编code?
How to let gcc generate a less verbose assembly-code?
推荐答案
-S开关添加到您的命令行。
Add -S switch to your command line.
编辑:不要忘了,它会组装的地方,你-o开关下指定的文件
Do not forget that it will place the assembly to the files you specified under -o switch.
这篇关于我怎么能看到一个由海湾合作委员会(任何味道)编译器生成的C / C ++程序装配code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文