is it possible to disable all types of optimization for GHS compiler ? I have a problem that local variables cannot be seen in debugger (Lauterbach). It makes impossible to understand problems being debugged (On Renesas RH850).
Current flags that are used are
CFLAGS = -g -G -dual_debug -D_BUILD_SWDEV_=1 -D_BUILD_SWPRO_
CFLAGS += -g -c -dwarf2
CFLAGS += -cpu=rh850g3k -fsoft -ignore_callt_state_in_interrupts -misalign_pack -no_callt -Osize
CFLAGS += -prepare_dispose -registermode=32 -reserve_r2 -shorten_loads -sda=all -Wshadow -Wundef --no_commons --prototype_errors --short_enum
CFLAGS += -large_sda -Ospace -inline_prologue
CFLAGS += -bsp generic
If the variable is set to static within the function the situation remains the same.
Thanks in advance.
According to FrodeTennebo in this thread https://stackoverflow.com/a/41370425
#pragma ghs ZO
disables all optimizations, starting from the next function.
If you want a compiler flag
-Onone
will disable all optimizations globally.