https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120559
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- >1. Does it affect the caller due to LTO being used? LTO just exposes the issue as now the compiler has aliasing info from the functions of all Translational units. GCC 12 (or was it 13) added IPA based aliasing to functions (modref) which allows more optimizations to happen and expose your bad code. Also the aliasing and undefined behavior is documented in many places and there are many papers about it which you should read up on. This is not the correct place of asking questions about it though since this is not related to GCC bug as it is about the C/C++ language rather than GCC implementation. If you have questions about GCC implementation on why it gets exposed in some cases; even bugzilla is not the right place either.