https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109717
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- It's not actually broken, it's just paranoid, and the overflow detection triggers for dead code. The optimizer analyzes different paths through the code separately, and fails to detect that some of those paths are unreachable, and then warns that they would overflow if those paths were taken.