Minimal Optimization - Build options


I can set optimisation to O1, O2, O3, Os - default and Og but when I set O0 I got this error:
.pioenvs\board_XXX\libFrameworkArduino.a(Uart.cpp.o): In function HardwareSerial::HardwareSerial()': Uart.cpp:(.text._ZN14HardwareSerialC2Ev[_ZN14HardwareSerialC5Ev]+0x20): undefined reference tovtable for HardwareSerial’
collect2.exe: error: ld returned 1 exit status
*** [.pioenvs\board_XXXX\firmware.elf] Error 1
NRF51, Arduino framwork.
Reason: I’m trying to stop showing “OPTIMIZE OUT” while watching variables while in the debug.
How can I compile so the compiler won’t mess with the execution sequence of my code, any ideas?