The attached test case produces this warning: $ gcc -save-temps -O2 shortened.c -o shortened shortened.s: Assembler messages: shortened.s:21: Warning: 00000003fffffffc shortened to 00000000fffffffc
This only happens with -O2, not with -O0 or -O1. I can reproduce this on the following versions (these are all from prebuilt Debian packages): gcc-4.0 (GCC) 4.0.4 20060507 (prerelease) (Debian 4.0.3-3) gcc-4.1 (GCC) 4.1.2 20061028 (prerelease) (Debian 4.1.1-19) The following versions seem to be unaffected: gcc-3.4 (GCC) 3.4.6 (Debian 3.4.6-5) gcc-4.2 (GCC) 4.2.1 20070627 (prerelease) (Debian 4.2-20070627-1) -- Summary: Bogus warning "00000003fffffffc shortened to 00000000fffffffc" Product: gcc Version: 4.0.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hlinnaka at iki dot fi GCC build triplet: i486-pc-linux-gnu GCC host triplet: i486-pc-linux-gnu GCC target triplet: i486-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32750