https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103699
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Petr from comment #8) > So yeah, we can talk about breaking strict aliasing here, but it's just > inconsistent. I would just expect all functions return the same value. inconsistent because the behavior is undefined .... In the case of the local array, GCC decides the store to array + 6 is not needed and is removed. It is inconsistent due to the inlining choices really. This is why in my simplified example in comment #7, -fno-early-inlining is needed and all. GCC 11+ is even more picky about strict aliasing than before really. That is the basic thing here.