ARM和GCC优化等级optimization level 参考链接: Arm Compiler for Embedded User Guide Optimize Options (Using the GNU Compiler Collection (GCC)) ARM优化等级参考: ARM 建议使用: 以下为STM32 CUBE IDE中的优化等级,使用的时GCC 12 工具链: 在需要进行Debug时,不建议开启任何优化: STM32CubeIDE user guide - User manual中Debug章节有以下说明
-Og: In GCC 4.8, a new general optimization level, -Og, has been introduced. It addresses the need for fast compilation and a superior debugging experience while providing a reasonable level of runtime performance. Overall experience for development should be better than the default optimization l...
如case语句没有default处理,有符号、无符号处理,未使用变量(特别是函数有大量未使用的数组,占用栈空间,测试发现,开辟一个未使用的8MB的数组,程序有coredump),用%d来打印地址,或%s打印int值,等,都可以发出警告。 -Wextra 除-Wall外其它的警告。建议加上。 在GCC编译时,加上必要的警告选项,可以避免很多低级错误引发...
将入参数组前两个元素(g_tileContentVector[0]和g_tileContentVector[1])中的urCode和levelNumber存到了{v1.h}[0]~{v1.h}[3]这四个宽度是16bit的寄存器中,使用16bit寄存器的原因是我们代码中将这两个uint32_t类型的分量(urCode和levelNumber都是uint32_t)...
可以看到每个-O level的优化选项的开关情况。 优化程度图示: -O0 default,减少编译时间,使得调试产生预期结果。 几乎不被使用。 -O1 -O即-O1。-O的default。 编译优化需要更多的时间,对大型函数来说也需要更多内存。 使用-O1, 编译器尝试减少代码大小和执行时间, 而不执行任何需要大量编译时间的优化。Optimizing...
Do not optimize. This is the default. ///===另外还有个Os选项=== http://hi.baidu.com/ah__fu/blog/item/cc9fd19b801948bdc9eaf4b3.html 在研究编译驱动的makefile的时候,发现GCC的命令行里面有一个-Os的优化选项。 遍查GCC文档,发现了-O0, -O1, -O2, -O3,就是没有发现...
The special optimization level (-Os or size) enables all -O2 optimizations that do not increase code size; it puts the emphasis on size over speed. This includes all second-level optimizations, except for the alignment optimizations. The alignment optimizations skip space to align functions, loops...
O2is the default optimization level for major Linux OS distributions, e.g., RedHat* Enterprise Linux (RHEL). Many users also preferO2to build their programs. Besides, RHEL 9 uses x86-64-v2 as the default architecture setting. For GCC 14, more effort was put into the-O2performance withx86...
performance. Overall experience for development should be better than the default optimization level -...
-Od 禁用优化(默认值) disable optimizations (default) -Ox 最大化选项。(-Ogityb2 -Gs) maximum opts. (-Ogityb1 -Gs) -Og 启用全局优化 enable global optimization -Oy[-] 启用框架指针省略 enable frame pointer omission -Oi 启用内建函数 enable intrinsic functions ...