https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102303
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- This is a known bug with -ftrapv where gcc widens everything to word mode (64bit in this case) and uses libcalls to implement-ftrapv. There are a few other bugs that say the same thing.