From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16937 invoked by alias); 5 Jul 2010 22:52:21 -0000 Received: (qmail 16909 invoked by uid 48); 5 Jul 2010 22:52:10 -0000 Date: Mon, 05 Jul 2010 22:52:00 -0000 Subject: [Bug c/44828] New: possible integer wrong code bug X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "regehr at cs dot utah dot edu" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg00507.txt.bz2 regehr@john-home:~$ current-gcc -v Using built-in specs. COLLECT_GCC=current-gcc COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r161813-install/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper Target: i686-pc-linux-gnu Configured with: ../configure --with-libelf=/usr/local --enable-lto --prefix=/home/regehr/z/compiler-install/gcc-r161813-install --program-prefix=r161813- --enable-languages=c,c++ Thread model: posix gcc version 4.6.0 20100704 (experimental) (GCC) regehr@john-home:~$ current-gcc -O1 small.c -o small regehr@john-home:~$ ./small checksum g_40 = 274686410 regehr@john-home:~$ current-gcc -O2 small.c -o small regehr@john-home:~$ ./small checksum g_40 = -1 regehr@john-home:~$ cat small.c extern int printf (__const char *__restrict __format, ...); static char foo (char si1, char si2) { return si1* si2; } const volatile unsigned int g_2[8][3] = {{0L, 0L, 0L}, {0L, 0L, 0L}, {0L, 0L, 0L}, {0L, 0L, 0L}, {0L, 0L, 0L}, {0L, 0L, 0L}, {0L, 0L, 0L}, {0L, 0L, 0L}}; long long g_29 = 1; int g_40 = 0x105F61CAL; int *g_39 = &g_40; volatile int * volatile g_88[1] = {0}; volatile int g_429[5] = {1L, 1L, 1L, 1L, 1L}; int main(void) { int * const l_353 = &g_40; int l_414 = 0xF5B296C2L; if (!(g_2[5][2])) { int l_420 = 0x0332F5C8L; if (((foo (l_420, (*l_353))) > (!-10L))) { for (l_414 = 0; l_414 < 1; l_414 += 1) { g_88[l_414] = &g_429[2]; } (*g_39) = -1; } } printf("checksum g_40 = %d\n", g_40); return g_29; } -- Summary: possible integer wrong code bug Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: regehr at cs dot utah dot edu GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44828