[LLVMbugs] [Bug 18808] New: clang -O4 drops other -mavx2 and possibly other flags

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 11 18:56:47 PST 2014


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

            Bug ID: 18808
           Summary: clang -O4 drops other -mavx2 and possibly other flags
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: misc at shiftleft.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12047
  --> http://llvm.org/bugs/attachment.cgi?id=12047&action=edit
A terminal transcript with a test case

I found that

clang -O4 -mavx2 *.c

sets AVX2 in the frontend, but not during link-time optimization.  The same may
be true for other flags.  This causes problems with code that tries to detect
whether AVX2 (or possibly other features) are supported, since it will emit
code designed for those features but they will not be present during link-time
optimization.

The terminal transcript shows the bug in action.  When compiled with -O3, AVX2
instructions are emitted, and when compiled with -O4, they are not.  The
transcript does not show that __AVX2__ is defined in the C file, but in fact it
is.

-- 
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/20140212/9618da1c/attachment.html>


More information about the llvm-bugs mailing list