[llvm-bugs] [Bug 32241] New: Incorrect result with -march=skx -O0 -m32

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Mar 11 11:17:30 PST 2017


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

            Bug ID: 32241
           Summary: Incorrect result with -march=skx -O0 -m32
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: Vsevolod.Livinskij at frtk.ru
                CC: llvm-bugs at lists.llvm.org

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

Clang generates incorrect code with -m32 -O0 -march=skx options (same problem
for knl). Everything works fine with -m64 and other optimizations levels.

Reproducer:
#include <iostream>

int main () {
    unsigned short aa = 10959;
    unsigned short bb = 50038;
    short cc = 19417;
    bb = ~(aa < (cc || 0)) || 0;
    std::cout << bb << std::endl;
    return 0;
}

>$ clang++ -m32 -w -O0 -march=skx repr.cpp ; sde -skx -- ./a.out
0
>$ clang++ -m32 -w -O0 repr.cpp ; ./a.out
1

LLVM version:
clang version 5.0.0 (trunk 297270)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/vsevolod/workspace/llvm/bin-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

-- 
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/20170311/62a8e2d9/attachment.html>


More information about the llvm-bugs mailing list