https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94383
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- https://godbolt.org/z/BnTEsn is an example with both functions in the same translation unit, showing the generated code is different for both caller and callee. If the caller and callee are not in the same TU the differences produce garbage.