[LLVMbugs] [Bug 9604] New: likely wrong code bug

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 31 20:59:01 PDT 2011


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: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu, chenyang at cs.utah.edu


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

regehr at home:~/volatile/bugs/tmp009$ clang -O0 small.c -o small
regehr at home:~/volatile/bugs/tmp009$ ./small
1
regehr at home:~/volatile/bugs/tmp009$ clang -O small.c -o small
regehr at home:~/volatile/bugs/tmp009$ ./small
0
regehr at home:~/volatile/bugs/tmp009$ clang -v
clang version 3.0 (trunk 128681)
Target: i386-pc-linux-gnu
Thread model: posix
regehr at 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.



More information about the llvm-bugs mailing list