https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93745
--- Comment #8 from Marc Glisse <glisse at gcc dot gnu.org> --- (In reply to Martin Sebor from comment #7) > But regardless of what language might have even looser rules than C/C++ in > this area, it would seem like a rather unfortunate design limitation for GCC > not to be able to analyze and optimize C/C++ code as well as other compilers > can because it supports languages others don't (LLVM supports most of the > languages GCC does). LLVM seems to miscompile the testcase from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69776#c8 , which may explain why it is able to optimize in more cases.