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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to