I have a project rather large project using STM32F4, which works OK with no optimization. When I optimize to speed, it starts to misbehave. It does not crash, but there are some glitches on LCD display, some other variables display incorrect etc.
I assume ARM GCC is a very well tested compiler, so it is probably due to my poor programming style. In particular I suspect forgetting to declare global and static as volatile when needed. I wonder what should I be looking for, and if there is some tool to scan the code (it is a lot of lines) and point on possible problems.
Thanks