This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/44858] New: likely integer wrong code bug


regehr@john-home:~$ current-gcc -O0 small.c -o small
regehr@john-home:~$ ./small
checksum g_610 = 1
regehr@john-home:~$ current-gcc -O1 small.c -o small
regehr@john-home:~$ ./small
checksum g_610 = 0
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:~$ cat small.c
extern int printf (__const char *__restrict __format, ...);

int g_33 = 3;
int g_610 = 1;

long long foo(int i1, int i2)
{
    return (i1 / i2);
}

int main(void)
{
    int l_2 = 2;
    l_2 &= foo(1, g_610) > g_610;
    g_610 = (g_33 != 0) | l_2;
    printf("checksum g_610 = %d\n", g_610);
    return l_2;
}


-- 
           Summary: likely 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=44858


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]