[LLVMbugs] [Bug 16605] New: wrong code at -Os and above on x86_64-linux-gnu

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 11 20:13:28 PDT 2013


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

            Bug ID: 16605
           Summary: wrong code at -Os and above on x86_64-linux-gnu
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: su at cs.ucdavis.edu
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following code is miscompiled by clang trunk (as well as clang 3.2 and 3.3)
on x86_64-linux-gnu at -Os and above. 

$ clang-trunk -v
clang version 3.4 (trunk 186068)
Target: x86_64-pc-linux-gnu
Thread model: posix
$
$ clang-trunk -Os reduced.c
$ a.out; echo $?
1
$ clang-trunk -O1 reduced.c
$ a.out; echo $?
0
$ clang-3.3 -Os reduced.c
$ a.out; echo $?
1
$ clang-3.2 -Os reduced.c
$ a.out; echo $?
1
$ 


---------------------------------------------------


int a = -1, b;

unsigned int foo (int p) {  return p; }

int main ()
{
  if ((b = 1 % foo (a)) > a)
    return 0;
  return 1;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130712/18f4e3fb/attachment.html>


More information about the llvm-bugs mailing list