[LLVMbugs] [Bug 11340] New: clang wrong code bug

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 8 12:18:40 PST 2011


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

             Bug #: 11340
           Summary: clang wrong code bug
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            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 tmp050]$ clang -O1 small.c ; ./a.out
0
[regehr at gamow tmp050]$ clang -O2 small.c ; ./a.out
1
[regehr at gamow tmp050]$ clang -v

clang version 3.1 (trunk 144028)
Target: x86_64-unknown-linux-gnu
Thread model: posix

[regehr at gamow tmp050]$ cat small.c


int printf (const char *, ...);

int func_4 (int si1)
{
  return si1;
}

int func_25 (int ui2)
{
  return 1 / ui2;
}

int g_9;

int g_190 = 1;

int main ()
{
  if (func_25 (func_4 (g_9 <= 0))) g_190 = 0;
  printf ("%d\n", g_190);
  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