https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58195
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note the loop based one is a little more complex due to the way GCC IR handles overflow being wrapping or undefined; I am just going to fix the case where overflow is defined as wrapping. The other case needs more work and maybe even a huge change in the IR handling.