I've been getting bus faults & usage faults when compiling in -O2 that I think are the compiler's fault but haven't proven yet (code works fine in O1, no clear cause).
Don't get me wrong, but in 100.00% of the cases where someone suspects a compiler error, it finally turns out to be a code error (unless we are talking about bleeding-edge features of C++20) (;
I've actually reported bugs in MS's STL and compiler and gotten them acknowledged before, this was back when C++11 was bleeding edge though, so true enough
. Probably 90% of the time it is my fault, 5% OS's (one comical bug in a commercial port of OpenRTOS that I was rather irritated I had to fix for them), and maybe 5% the compiler. It happens... really annoying when you spend a month thinking you must be a horrible programmer only to finally prove its something else. Kind of feels like a pyrrhic victory.
What is weird is I thought unaligned access is supposed to be valid on the cortex-m7. I'll spend some more time poking at it next month probably, try to get a minimal reproducible case.