[LLVMbugs] [Bug 7786] New: probable clang 64-bit wrong code bug

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Aug 1 21:15:15 PDT 2010


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

           Summary: probable clang 64-bit 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 gamow work016]$ clang -O1 small.c -o small
[regehr at gamow work016]$ ./small
9
[regehr at gamow work016]$ clang -O2 small.c -o small
[regehr at gamow work016]$ ./small
255
[regehr at gamow work016]$ clang -v
clang version 2.8 (trunk 110016)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[regehr at gamow work016]$ cat small.c
extern int printf (__const char *__restrict __format, ...);

signed char foo (signed char si1, signed char si2)
{
  return si1 - si2;
}

int g_21[1] = {0x97341720L};
int g_39 = 0x05DE082AL;
int *g_38 = &g_39;
unsigned char g_43 = 0L;
int *l_40[6];

int main(void)
{
  const int l_42 = 1L;
  int **l_250 = &l_40[3];
  int x = (g_21[0] == 6) && (*g_38);
  g_43 = foo (x, l_42) & 9L;
  if (*g_38) {
    *l_250 = g_38;
  }
  printf("%u\n", g_43);
  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