https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113726
Bug ID: 113726 Summary: sanitizer reports signed overflow but not underflow Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: jetrull at sbcglobal dot net CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org Target Milestone: --- This code produces both a warning and a sanitizer failure: long result = std::numeric_limits<long>::max() + 1l; This code produces only a compiler warning: long result = std::numeric_limits<long>::min() - 1l; The Clang sanitizer flags both operations. This seems to be true for several versions, including 11.4 (my laptop) and trunk. https://godbolt.org/z/9nf3hhWsM