1

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.

Jeremy
  • 45
  • 11

1 Answers1

1

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.

Spike69
  • 26
  • 5
  • 1
    Thanks for the reply, I saw the answer from the FrodeTennebo in thread https://stackoverflow.com/a/41370425 and it was very heplfull. However the -Onone hint that you provided is the one that i need. Thank you very match! – Jeremy Nov 23 '18 at 08:48