1

我发现了几个代码片段用于禁用专用代码部分的 GCC 优化。

使用编译指示 GCC 优化(0)

但我无法为 Greenhils 编译器找到类似的东西。

没有这样的选择吗?

4

1 回答 1

4

从手册:

#pragma ghs Ostring
Turns on optimizations. The optional string may contain any or all of the following letters:
L — Loop optimizations
M — Memory optimizations
S — Small (but Slow) optimizations

#pragma ghs ZO
Disables all optimizations, starting from the next function.
于 2016-12-28T22:12:25.617 回答