[llvm-bugs] [Bug 30987] New: Wrong code/bug at -O2 on x86_64-unknown-freebsd11.0

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 11 08:45:17 PST 2016


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

            Bug ID: 30987
           Summary: Wrong code/bug at -O2 on x86_64-unknown-freebsd11.0
           Product: clang
           Version: trunk
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: m at mikaelsimonsson.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17581
  --> https://llvm.org/bugs/attachment.cgi?id=17581&action=edit
Test case

Using latest snapshot of Clang on FreeBSD: 4.0.d20161003

% clang++-devel -v
clang version 4.0.0
Target: x86_64-unknown-freebsd11.0
Thread model: posix
InstalledDir: /usr/local/llvm-devel/bin

% clang++39 -v
clang version 3.9.0 (tags/RELEASE_390/final)
Target: x86_64-unknown-freebsd11.0
Thread model: posix
InstalledDir: /usr/local/llvm39/bin

% clang++-devel -O2 -std=c++1z -stdlib=libc++ b.cc

-O1 or lower works on both versions, -O2 or -O3 does not. Code works on gcc7
with all optimization levels.

Sorry about the large test case, tried to simplify as much as I could.

Expected output:
1

Actual output (or similar):
-121
-120
-119
No match: -121
0

-- 
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/20161111/29998d44/attachment-0001.html>


More information about the llvm-bugs mailing list