ccompiler-optimizationgreenhills

greenhills compiler turn off optimization for file or part of


I found several code snippets for disabling GCC optimization for dedicated code parts.

with pragma GCC optimize(0)

But I could not found something like that for Greenhils compiler.

Is there no such option?


Solution

  • From the manual:

    #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.