如何获得的gcc -O1优化不指定-O1 [英] How to get gcc -O1 optimization without specifying -O1

查看:434
本文介绍了如何获得的gcc -O1优化不指定-O1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道-O1自动打开某些标志。这些标志可以手动,虽然开启。如果我不指定-O1,应该还是可以通过指定所有-O1开启的标志,以获得-O1优化。

I know that -O1 automatically turns on certain flags. These flags can be turned on manually though. If I don't specify -O1, it should still be possible to get -O1 optimization by specifying all the flags that -O1 turns on.

我试过

-fthread-jumps -fcprop-registers -fguess-branch-probability

但它仍然没有做-O1优化。当我使用gprof的,因为表现并不好,我可以告诉。

but it still does not do -O1 optimization. I can tell when I use gprof because the performance is not as good.

我打开哪个标志,以获得-O1优化?

Which flags do I turn on to get -O1 optimization?

推荐答案

要找出一个方法:

gcc -O1 -c -Q -v dummy.c

(其中dummy.c是你的文件名)。这将导致GCC喷涌用来在命令行标志。

(where dummy.c is your filename.) This causes gcc to spew the flags used to the command line.

编辑:请参阅<一个href=\"http://stackoverflow.com/questions/1778655/how-to-get-gcc-o1-optimization-without-specifying-o1/1782219#1782219\">kastauyra's回答这一点。看样子你不能模拟满 -O1 优化与 -f 单独标志。

Please see kastauyra's answer on this. It appears you cannot simulate full -O1 optimization with -f flags alone.

这篇关于如何获得的gcc -O1优化不指定-O1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆