https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117457 --- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So the generated code on the gimple level looks fine, which means maybe _M_end is incorrect and got over-written somehow.