[llvm-bugs] [Bug 31614] New: possible bad code generation

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 11 17:00:37 PST 2017


https://llvm.org/bugs/show_bug.cgi?id=31614

            Bug ID: 31614
           Summary: possible bad code generation
           Product: clang
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: clay.trychta at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17832
  --> https://llvm.org/bugs/attachment.cgi?id=17832&action=edit
repro

When compiling the attached code with -O2 -std=c++14 the generated assembly
seems to be incorrect (I tried to rule out undefined behavior, but if I missed
something please let me know).

Specifically, test_function starts with some code that seems like it can
randomly set al to 0 or 1 depending on rax:
test    rax, rax
setns   al  

The other instance of test/setns also seems suspicious.

Some more details can be found here:
http://stackoverflow.com/questions/41597341/mapping-c-to-assembly
https://godbolt.org/g/ccrV7m

Please let me know if you need any other information.

-- 
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/20170112/e08063f1/attachment.html>


More information about the llvm-bugs mailing list