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

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 29 13:06:57 PDT 2011


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

           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


[regehr at gamow ~]$ clang -O0 small.c
[regehr at gamow ~]$ ./a.out 
0
0
0
0
1
1
1
[regehr at gamow ~]$ clang -O1 small.c
[regehr at gamow ~]$ ./a.out 
0
0
0
0
1
1
0
[regehr at gamow ~]$ clang -v
clang version 3.0 (trunk 130512)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[regehr at gamow ~]$ cat small.c
int printf (const char *, ...);

int g_50[] = {
  0, 0, 0, 0, 1, 0, 0
};

int main (void)
{
  int i;

  for (i = 0; i <= 1; i++) 
    g_50[i + 5] = g_50[i + 4];

  for (i = 0; i < 7; i++)
    printf ("%d\n", g_50[i]);

  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