LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1143|回复: 4

gcc 4.3.3 -O3优化中的几个参数的意思

[复制链接]
发表于 2009-3-27 13:04:42 | 显示全部楼层 |阅读模式
-O3
    Optimize yet more. -O3 turns on all optimizations specified by -O2 and also turns on the -finline-functions, -funswitch-loops, -fpredictive-commoning, -fgcse-after-reload and -ftree-vectorize options.


-fpredictive-commoning -ftree-vectorize 这两个不怎么理解
-finline-functions 有好有坏
-funswitch-loops 这个参数的确是有优化的,至于副作用大家举个例子吧

for(long i=0; i < 2000000; i++)
{
         long a = 12345;
         long b = i;
}

-funswitch-loops  明显可以优化到a
        PS:至于b,gcc是那个参数去优化的?

当然这里我只是举个例子,大家举例说说-funswitch-loops副作用吧
发表于 2009-3-27 19:08:14 | 显示全部楼层
回复 支持 反对

使用道具 举报

发表于 2009-3-27 22:34:10 | 显示全部楼层
楼上推荐的这个不错
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-3-28 02:58:18 | 显示全部楼层
Post by fender010;1966397
看这个:

http://www.gentoo.org/doc/en/gcc-optimization.xml


看过! 关注我的正文吧
回复 支持 反对

使用道具 举报

发表于 2009-3-28 10:02:50 | 显示全部楼层
Post by newsky_;1966533
看过! 关注我的正文吧

不好意思了,实在抱歉,打酱油的路过。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表