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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


[reg...@gamow work016]$ clang -O1 small.c -o small
[reg...@gamow work016]$ ./small
9
[reg...@gamow work016]$ clang -O2 small.c -o small
[reg...@gamow work016]$ ./small
255
[reg...@gamow work016]$ clang -v
clang version 2.8 (trunk 110016)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[reg...@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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to