https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87123
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- Use -fsanitize=undefined to diagnose the undefined behaviour at runtime, or use -fwrapv to make the negation well-defined (both options are suggested by https://gcc.gnu.org/bus/ which you were asked to read before creating a new bug report).