[LLVMbugs] [Bug 8670] New: Optimization causes incorrect output.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Nov 22 20:30:00 PST 2010


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: unassignedclangbugs at nondot.org
        ReportedBy: joelteichroeb at gmail.com
                CC: llvmbugs at cs.uiuc.edu


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.

[joel at joel-pc list]$ clang list.c -o list
[joel at joel-pc list]$ ./list
6
[joel at joel-pc list]$ clang -O list.c -o list
[joel at joel-pc list]$ ./list
16474128
[joel at 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.



More information about the llvm-bugs mailing list