[LLVMbugs] [Bug 21339] New: Inline assembly triggers assertion failure: `OutputTy->isFloatingPointTy() && "Unexpected output type"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 22 08:00:35 PDT 2014


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

            Bug ID: 21339
           Summary: Inline assembly triggers assertion failure:
                    `OutputTy->isFloatingPointTy() && "Unexpected output
                    type"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: admin at chys.info
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13234
  --> http://llvm.org/bugs/attachment.cgi?id=13234&action=edit
a-db05b6.c

Minimal test-case:

#include <x86intrin.h>
__m128 foo(float x)
{
        __m128 r;
        asm ("" : "=x"(r) : "0"(x));
        return r;
}

The above function compiles fine with GCC, but crashes clang (I have tested
3.4.2, 3.5.0 and trunk - all failed):

/tmp % /usr/local/llvm-svn/bin/clang -O2 -S a.c
clang-3.6: /home/x/prog/P/llvm/tools/clang/lib/CodeGen/CGStmt.cpp:1978: void
clang::CodeGen::CodeGenFunction::EmitAsmStmt(const clang::AsmStmt &): Assertion
`OutputTy->isFloatingPointTy() && "Unexpected output type"' failed.
#0 0x145629a llvm::sys::PrintStackTrace(_IO_FILE*)
(/usr/local/llvm-svn/bin/clang-3.6+0x145629a)
#1 0x14579cb SignalHandler(int) (/usr/local/llvm-svn/bin/clang-3.6+0x14579cb)
#2 0x7f0223ccf4e0 (/lib64/libpthread.so.0+0x104e0)
#3 0x7f022313c5d7 gsignal (/lib64/libc.so.6+0x385d7)
#4 0x7f022313d8f8 abort (/lib64/libc.so.6+0x398f8)
#5 0x7f0223135706 (/lib64/libc.so.6+0x31706)
#6 0x7f02231357b2 (/lib64/libc.so.6+0x317b2)
#7 0x18b2033 clang::CodeGen::CodeGenFunction::EmitAsmStmt(clang::AsmStmt
const&) (/usr/local/llvm-svn/bin/clang-3.6+0x18b2033)
#8 0x18aa632 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*)
(/usr/local/llvm-svn/bin/clang-3.6+0x18aa632)
#9 0x18b36db
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/usr/local/llvm-svn/bin/clang-3.6+0x18b36db)
#10 0x18c6717
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) (/usr/local/llvm-svn/bin/clang-3.6+0x18c6717)
#11 0x18c6d6c clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/usr/local/llvm-svn/bin/clang-3.6+0x18c6d6c)
#12 0x18d6266
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/local/llvm-svn/bin/clang-3.6+0x18d6266)
#13 0x18d316f
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/local/llvm-svn/bin/clang-3.6+0x18d316f)
#14 0x18d7cd1 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
(/usr/local/llvm-svn/bin/clang-3.6+0x18d7cd1)
#15 0x18779bf (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(/usr/local/llvm-svn/bin/clang-3.6+0x18779bf)
#16 0x186e807 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/usr/local/llvm-svn/bin/clang-3.6+0x186e807)
#17 0x1e23e33 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/llvm-svn/bin/clang-3.6+0x1e23e33)
#18 0x15ee38e clang::FrontendAction::Execute()
(/usr/local/llvm-svn/bin/clang-3.6+0x15ee38e)
#19 0x15c083c clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/llvm-svn/bin/clang-3.6+0x15c083c)
#20 0x1670d62 clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/llvm-svn/bin/clang-3.6+0x1670d62)
#21 0x6eee4b cc1_main(llvm::ArrayRef<char const*>, char const*, void*)
(/usr/local/llvm-svn/bin/clang-3.6+0x6eee4b)
#22 0x6edbb8 main (/usr/local/llvm-svn/bin/clang-3.6+0x6edbb8)
#23 0x7f0223128dc5 __libc_start_main (/lib64/libc.so.6+0x24dc5)
#24 0x6ea9a9 _start (/usr/local/llvm-svn/bin/clang-3.6+0x6ea9a9)
Stack dump:
0.      Program arguments: /usr/local/llvm-svn/bin/clang-3.6 -cc1 -triple
x86_64-unknown-linux-gnu -S -disable-free -main-file-name a.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-momit-leaf-frame-pointer -dwarf-column-info -coverage-file /tmp/a.c
-resource-dir /usr/local/llvm-svn/bin/../lib/clang/3.6.0 -internal-isystem
/usr/local/include -internal-isystem
/usr/local/llvm-svn/bin/../lib/clang/3.6.0/include -internal-externc-isystem
/include -internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir
/tmp -ferror-limit 19 -fmessage-length 230 -mstackrealign -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o a.s -x c a.c 
1.      <eof> parser at end of file
2.      a.c:3:8: LLVM IR generation of declaration 'foo'
3.      a.c:3:8: Generating code for declaration 'foo'
clang-3.6: error: unable to execute command: Aborted
clang-3.6: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.6.0 
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang-3.6: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.6: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.6: note: diagnostic msg: /tmp/a-db05b6.c
clang-3.6: note: diagnostic msg: /tmp/a-db05b6.sh
clang-3.6: note: diagnostic msg: 

********************

/tmp % cat /tmp/a-db05b6.sh 
 "/usr/local/llvm-svn/bin/clang-3.6" -cc1 -triple x86_64-unknown-linux-gnu -S
-disable-free -main-file-name a.c -mrelocation-model static -mthread-model
posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer
-dwarf-column-info -O2 -ferror-limit 19 -fmessage-length 230 -mstackrealign
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-loops -vectorize-slp -x c a-db05b6.c

-- 
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/20141022/59f1d375/attachment.html>


More information about the llvm-bugs mailing list