+++ This bug was initially created as a clone of Bug #38934 +++ This failure is not "worked around" by FRE unlike 38932. /* { dg-do compile } */ /* { dg-options "-O2 --std=gnu99" } */ /* This variable needed only to work around earlier optimizations than VRP. */ unsigned char g; extern void abort(); void f (long long int p) { g = 255; /* { dg-warning "constant is" "" { target *-*-* } 14 } */ /* { dg-warning "overflow" "" { target *-*-* } 14 } */ if (p >= -9223372036854775808LL - (signed char) g) p = 1; if (p) abort (); } 3.2.x issued just one warning both in 32-bit HWI i386 gcc and x86_64 -m32 gcc, haven't checked 3.3, 3.4 and later issues one extra warning in 32-bit HWI compilation.
Two warnings for 3.3.
Confirmed, then... I've tested 3.4, 4.1, and 4.3. I suppose 4.2 is the same.
Closing 4.2 branch.
GCC 4.3.4 is being released, adjusting target milestone.
GCC 4.3.5 is being released, adjusting target milestone.
4.3 branch is being closed, moving to 4.4.7 target.
Since 4.7 we have need_64bit_hwint=yes for the target the bug was reported against. But I'm confused. Do we want two warnings here? 3.3.6 and 3.4.6 say: /space/rguenther/install/gcc-3.3.6/bin/gcc -S -std=c99 t.c t.c:10:13: warning: integer constant is so large that it is unsigned t.c: In function `f': t.c:10: warning: integer overflow in expression while since 4.0.0 we say t.c:10:13: warning: integer constant is so large that it is unsigned I don't think we anywhere have a 'integer overflow in expression' warning (not by default at least) that triggers during optimization. So - is 4.7 fixed (because hwint 64 is default)? I didn't really check hwint32 builds of 4.x.
I guess we can close this for 4.7+ where we have always 64-bit HWINTs on i686.
4.4 branch is being closed, moving to 4.5.4 target.
The 4.5 branch is being closed, adjusting target milestone.
The 4.6 branch has been closed, fixed in GCC 4.7.0.