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

           Summary: likely 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]


This is an odd one and I cannot seem to reduce it more.

regehr@home:~/volatile/bugs/tmp009$ clang -O0 small.c -o small
regehr@home:~/volatile/bugs/tmp009$ ./small
1
regehr@home:~/volatile/bugs/tmp009$ clang -O small.c -o small
regehr@home:~/volatile/bugs/tmp009$ ./small
0
regehr@home:~/volatile/bugs/tmp009$ clang -v
clang version 3.0 (trunk 128681)
Target: i386-pc-linux-gnu
Thread model: posix
regehr@home:~/volatile/bugs/tmp009$ cat small.c


#include <stdio.h>

int g_3 = 0;

void func_57 (int **p_58)
{
  *p_58 = 0;
}

int main (void)
{
  int *l_4 = &g_3;

  if (g_3)
    {
      func_57 (&l_4);
    }

  int x,y;

  for (x = 0; x < 5; x++)
    {
      for (y = 0; y < 5; y++)
    {
      g_3 = 0;
      *l_4 = 1;
    }
    }

  printf ("%d\n", g_3);
  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