https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121146
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Adding: x = (B*)__builtin_assume_aligned (x, 16); y = (B*)__builtin_assume_aligned (y, 16); At the begining of the function fixes the issue ... There might be another bug about memcpy with arguments too ...