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

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 9 12:56:14 PST 2012


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

             Bug #: 11964
           Summary: likely wrong code bug
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: chenyang at cs.utah.edu, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


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

int a, b;
long c;

void func_37 () {
  --c;
  a = 0 || c;
}

int main ()
{
  func_37 ();
  printf ("%ld\n", c);
}

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