来自 Optimization Compiler在维基百科上,
Compiler optimization is generally implemented using a sequence of optimizing transformations, algorithms which take a program and transform it to produce a semantically equivalent output program that uses fewer resources.
GCC 有一个 lot优化选项。
我想研究生成的程序集(-S
给出的)在使用不同的标志编译时 GCC 执行每次优化后,如 -O1
, -O2
, -O3
等
我该怎么做?
编辑:我的输入将是 C 代码。
最佳答案
中间表示 可以使用 -fdump-tree-all
开关保存到文件中。
有更多可用的细粒度 -fdump
开关。
有关详细信息,请参阅 gcc 手册。
为了能够阅读这些表示,take a look into GCC internals manual .
关于c - 在 GCC 进行的每次优化后获取汇编代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15226668/