[Bug c/68971] -Woverflow false alarm in code unreachable after __builtin_mul_overflow
eggert at gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Feb 15 23:50:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971
--- Comment #10 from Paul Eggert <eggert at gnu dot org> ---
Unfortunately, the patch for Bug#68120 does not seem to have addressed the
problem here. For example, although the following code uses the new feature
enabled by that patch:
int f (void) {
return (__builtin_mul_overflow (0x7fffffff, 0x7fffffff, (int *) 0)
? 2
: 0x7fffffff * 0x7fffffff);
}
I still get the following warning with GCC 6.3.1 20161221 (Red Hat 6.3.1-1)
x86-64:
t.c: In function ‘f’:
t.c:4:19: warning: integer overflow in expression [-Woverflow]
: 0x7fffffff * 0x7fffffff);
^
More information about the Gcc-bugs
mailing list