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

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


The -O1 result is correct.

reg...@home:~/volatile/bugs/tmp342$ clang -O1 small.c -o small
reg...@home:~/volatile/bugs/tmp342$ ./small
1
reg...@home:~/volatile/bugs/tmp342$ clang -O2 small.c -o small
reg...@home:~/volatile/bugs/tmp342$ ./small
-1
reg...@home:~/volatile/bugs/tmp342$ cat small.c
int printf (const char *format, ...);

static int g_23 = 1;

static int func_16 (int p_19)
{
  g_23 = -1;
  return p_19;
}

int main (void) 
{
  int *l_172[1];
  int **l_176 = &l_172[0];
  int i;
  for (i = 0; i < 1; i++) {
    l_172[i] = &g_23;
  }
  **l_176 = func_16 (**l_176);
  printf ("%d\n", g_23);
  return 0;
}
reg...@home:~/volatile/bugs/tmp342$ clang -v
clang version 2.9 (trunk 120082)
Target: i386-pc-linux-gnu
Thread model: posix

-- 
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