ref1

官网的一个链接

gcc -O0 -O1 -O2 -O3 四级优化选项及每级分别做什么优化

gcc编译优化-O0 -O1 -O2 -O3 -OS解析

Options That Control Optimization-出自官方

gcc  -Q --help=optimizers
These options control various sorts of optimizations.
这些选项控制各种各样的优化。Without any optimization option, the compiler's goal is to reduce the cost
of compilation and to make debugging produce the expected results. Statements
are independent: if you stop the program with a breakpoint between statements,
you can then assign a new value to any variable or change the program counter
to any other statement in the function and get exactly the results you expect
from the source code.
没有任何优化选项,编译器的目标是降低编译成本,并使调试产生预期的结果。语句是独立的:
如果您在语句之间使用断点停止程序,那么您可以为任何变量分配一个新值,或者将程序计数器
更改为函数中的任何其他语句,并从源代码中获得您期望的结果。Turning on optimization flags makes the compiler attempt to improve the performance
and/or code size at the expense of compilation time and possibly the ability to debug
the program.
打开优化标志使编译器试图以编译时间和调试程序的能力为代价来提高性能和/或代码大小。The compiler performs optimization based on the knowledge it has of the program.
Compiling multiple files at once to a single output file mode allows the compiler
to use information gained from all of the files when compiling each of them.
编译器根据对程序的了解执行优化。将多个文件同时编译为一个输出文件模式允许编译器在编译每个文
件时使用从所有文件获得的信息。Not all optimizations are controlled directly by a flag. Only optimizations
that have a flag are listed in this section.
不是所有的优化都直接由一个标志控制。本节只列出具有标志的优化。Most optimizations are only enabled if an -O level is set on the command line.
Otherwise they are disabled, even if individual optimization flags are specified.
大多数优化仅在命令行上设置- O级别时启用。否则将禁用它们,即使指定了各个优化标志。Depending on the target and how GCC was configured, a slightly different set of
optimizations may be enabled at each -O level than those listed here. You can
invoke GCC with -Q --help=optimizers to find out the exact set of optimizations
that are enabled at each level. See Overall Options, for examples.
根据目标和 GCC 的配置方式,可以在每个- O 级别启用一组与本文列出的优化略有不同的优化。
可以使用-Q --help=optimizers 查找在每个级别启用的优化的确切集合.有关示例,请参见总体选项。

关于-O0、O1、O2、O3优化相关推荐

  1. #gcc笔记01#gcc编译选项 -O0 -O1 -O2 -O3

    -O0 -O1 -O2 -O3 编译器的优化选项的4个级别,-O0表示没有优化,-O1为缺省值,-O3优化级别最(此处为大写字母O) 优化选项(来源:http://blog.csdn.net/Sodi ...

  2. C++手动开启O2优化(以及-O -O1 -O2 -O3优化的知识点)(竞赛可用)

    O1优化会消耗少多的编译时间,它主要对代码的分支,常量以及表达式等进行优化. O2会尝试更多的寄存器级的优化以及指令级的优化,它会在编译期间占用更多的内存和编译时间. O3在O2的基础上进行更多的优化 ...

  3. Makefile 中 -wl ,rpath 以及 O0 O1 O2 O3 Os 的用法

    再makefile中一般默认的 lib 的加载路径是/lib /usr/lib  如果想要改变程序运行时的libs的加载路径 就需要用到 -wl , rpath 参数来添加lib 加载路径. O0 O ...

  4. makefile工作笔记0002---gcc -O0 -O1 -O2 -O3 四级优化选项及每级分别做什么优化

    技术交流QQ群[JAVA,C++,Python,.NET,BigData,AI]:170933152 相关博客http://blog.chinaunix.net/uid-24954950-id-295 ...

  5. gcc -O0 -O1 -O2 -O3 四级优化选项及每级分别做什么优化【转】

    转自:http://blog.csdn.net/qinrenzhi/article/details/78334677 相关博客http://blog.chinaunix.net/uid-2495495 ...

  6. gcc -O0 -O1 -O2 -O3 四级优化选项及每级分别做什么优化

    相关博客http://blog.chinaunix.net/uid-24954950-id-2956476.html 相关博客http://blog.csdn.net/misiter/article/ ...

  7. gcc 优化选项 -O1 -O2 -O3 -Os 优先级

    Gcc 编译优化简介 gcc 提供了为了满足用户不同程度的的优化需要,提供了近百种优化选项,用来对{编译时间,目标文件长度,执行效率}这个三维模型进行不同的取舍和平衡.优化的方法不一而足,总体上将有以 ...

  8. gcc 优化选项 -O1 -O2 -O3 -Os 优先级,-fomit-frame-pointer(不积跬步无以至千里)

    -fomit-frame-pointer 在优化时候被启用,带来了效率的提升.看到一篇比较详细记录编译选项的文章,转发一下,同时给自己作一下备忘. 少优化->多优化: O0 -->> ...

  9. 【gcc】gcc优化等级 -O1 -O2 -O3 -Os -Ofast -Og

    目录 优化等级 -O1 -O2 -O3 -Os -Ofast -Og cmake 生成 debug和 release 版|Cmake设置优化等级 优化等级 -O1 -O2 -O3 -Os -Ofast ...

  10. c++ -O1,-O2,-O3资料整理

    原文:http://blog.csdn.net/xinianbuxiu/article/details/51844994 1.从.c文件到可执行文件,其间经历了几步? 高级语言是偏向人,按照人的思维方 ...

最新文章

  1. 中国大陆光伏中上游触底反弹 台湾省亦酝酿涨势
  2. OpenGL中的Shader
  3. mysqlbinlog: unknown variable 'default-character-set=gbk'错误
  4. 爬虫应对银行安全控件-实践
  5. 有什么好用的windows PDF阅读器?答案在这里面
  6. awwwards环形动画_我在参加awwwards设计事宜和figma配置时学到的东西
  7. php orc 验证码,百度图片识别orc实现普通验证码识别
  8. 【font-spider】网页中引用字体文件过大的解决办法,网页字体文件压缩
  9. 医疗人工智能前景——医学影像
  10. 开发者笑疯了! LLaMa惊天泄露引爆ChatGPT平替狂潮,开源LLM领域变天
  11. stream、lamda、optional
  12. 学校校园学生寝室管理查寝打分系统 毕业设计毕设源码毕业论文开题报告参考(3)宿舍管理员功能
  13. 系统中flvplayer.swf播放器的使用及配置
  14. Star CCM+如何修改默认单位
  15. 产业合作打造中国云计算实践通途
  16. 抖音程序员HTML相册,快手抖音程序员表白女朋友3D立体相册源码html网页相册代码...
  17. ArcGIS水文分析实战教程(7)细说流域提取 1
  18. 小李的电商日记 22.10.14
  19. 卡巴可以用的激活工具分享大家需要的拿去
  20. 重启计算机后ip丢失,电脑重启后网关丢失怎么办

热门文章

  1. linux如何上传数据到百度网盘,Linux命令行上传文件到百度网盘
  2. leetcode 1033. Moving Stones Until Consecutive 解法 python
  3. 2020大学研究生计算机排名,美国大学研究生计算机专业排名2020情况如何?
  4. XP系统清理优化工具箱
  5. 生成带二维码图片并通过微信分享
  6. 如何给女朋友解释什么是面向对象编程?
  7. 9.ansible变量之fact
  8. 数学不好学python难吗_英语和数学不好的人能学会Python编程吗?
  9. 推荐书籍 《半小时漫画经济学1--生活常识篇》
  10. 程序员应该知道的经济学常识