[LLVMbugs] [Bug 12578] New: Optimizer deduces wrong facts, causing different run of code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 17 11:49:06 PDT 2012


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

             Bug #: 12578
           Summary: Optimizer deduces wrong facts, causing different run
                    of code
           Product: clang
           Version: 3.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: olivier.dumont at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Compile the attached test.cpp file with 
"clang++ -O0 -o test-O0 test.cpp" and 
"clang++ -O3 -o test-O3 test.cpp"

test-O3 (and test-O2 if compiled) result in an exit being called immediately
from main:
---
00000000004007a0 <main>:
  4007a0:       55                      push   %rbp
  4007a1:       48 89 e5                mov    %rsp,%rbp
  4007a4:       bf ff ff ff ff          mov    $0xffffffff,%edi
  4007a9:       e8 0a fe ff ff          callq  4005b8 <exit at plt>
  4007ae:       66 90                   xchg   %ax,%ax
---

wheras test-O0 (and test-O1 if compiled) result in a 0 being printed to stdout
(the expected result).

-- 
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