https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77689
--- Comment #4 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #3) > (In reply to Markus Trippelsdorf from comment #2) > > Clang is pretty impressive using libc++ and -Ofast: > > Looks like they can remove all stores from the loop. Though it does not > remove the empty loop afterwards though. Yes. with "return a[s];" added clang actually generates worse code than gcc.