Migration from VisualGDB to Platformio

I am porting a project that was originally developed by a different programmer using Visual Studio 2008 with the VisualGDB extension, and migrating it to VSCode/PlatformIO. It’s written in C with a very small amount of embedded assembly language instructions here and there. It runs on a bespoke bare metal board with an STM32 mcu.

I’m to the point where it builds and runs, but I’ve encountered some issues. For example, the application behaves differently when compiled with different levels of optimization, suggesting that the code isn’t fully compliant and/or was only previously tested with certain specific optimization settings.

I’m interested to read about any issues anyone has experienced in any projects with similar characteristics.

Thanks!