[LLVMbugs] [Bug 7768] New: likely integer wrong code bug

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 30 16:37:31 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7768

           Summary: likely integer wrong code bug
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu, jxyang at cs.utah.edu


regehr at john-home:~/work014$ clang -O1 small.c -o small
regehr at john-home:~/work014$ ./small
-7
regehr at john-home:~/work014$ clang -O2 small.c -o small
regehr at john-home:~/work014$ ./small
-1
regehr at john-home:~/work014$ clang -v
clang version 2.8 (trunk 109858)
Target: i386-pc-linux-gnu
Thread model: posix
regehr at john-home:~/work014$ cat small.c
extern int printf (__const char *__restrict __format, ...);

int g_13 = -7L;
int g_81 = 0x249DD628L;
int *g_125 = &g_81;
int *g_188 = &g_81;
int **g_303 = &g_188;
int *l_337 = &g_81;
int **l_352[2];

int main(void)
{
  int i;
  for (i = 0; i < 2; i++) {
    l_352[i] = &l_337;
  }
  int x = (g_81 != (*g_125)) <= (0x6749929EL <= (*g_125));
  int z = !(l_352[1] == 0);
  int y = -7L * z;
  g_81 = x * y;
  printf("%d\n", g_81);
  return 0;
}

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list