https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109896
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I suspect the overflow code was added before __builtin_*_overflow were added which is why the generated code is this way.
pinskia at gcc dot gnu.org via Gcc-bugs Wed, 17 May 2023 11:45:43 -0700
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109896
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I suspect the overflow code was added before __builtin_*_overflow were added which is why the generated code is this way.