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

           Summary: Optimization causes incorrect output.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Created an attachment (id=5821)
 --> (http://llvm.org/bugs/attachment.cgi?id=5821)
The bug in action.

If the code attached is compiled without optimization it outputs 6 as it
should. But if -O is used the output is wrong.

[j...@joel-pc list]$ clang list.c -o list
[j...@joel-pc list]$ ./list
6
[j...@joel-pc list]$ clang -O list.c -o list
[j...@joel-pc list]$ ./list
16474128
[j...@joel-pc list]$ 

The code in list.c is derived from wayland's(http://wayland.freedesktop.org/)
linked list code.

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

Reply via email to