[Bug c/87311] missing integer overflow detection on negation of the minimum value with -ftrapv or UB sanitizer

vincent-gcc at vinc17 dot net gcc-bugzilla@gcc.gnu.org
Mon Sep 17 11:23:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87311

--- Comment #4 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
(In reply to Richard Biener from comment #3)
> Yes, I think we have quite some opportunistic replacement of traps by
> "correct" results (according to twos complement).

Yes, that's "correct" according to two's complement, but this may also be a
real overflow that should have been caught (assuming -fwrapv hasn't been
provided).


More information about the Gcc-bugs mailing list