In baines2016, it is mentioned that compiler optimizations can break poorly written programs, and the author expressed their general displeasure with developers writing low-quality code.
At a bare minimum, the author recommends using the -Wall and -Wextra flags when compiling, using cppcheck to lint C/C++ source code files, and using tools such as Valgrind to find runtime bugs.
The author also mentions rarely seeing security professionals use any of these tools when developing software.