[llvm-bugs] [Bug 31985] New: lib/IR/Instructions.cpp:263: void llvm::CallInst::init(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, const llvm::Twine&): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 16 15:15:43 PST 2017


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

            Bug ID: 31985
           Summary: lib/IR/Instructions.cpp:263: void
                    llvm::CallInst::init(llvm::FunctionType*,
                    llvm::Value*, llvm::ArrayRef<llvm::Value*>,
                    llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*>
                    >, const llvm::Twine&): Assertion `(i >=
                    FTy->getNumParams() || FTy->getParamType(
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: andrey.vul at gmail.com
                CC: llvm-bugs at lists.llvm.org

The following code is derived from a testcase used to test firstprivate clause
for OpenMP 4.5 "teams" directive.
Tested on Gentoo using the clang-9999 / llvm-9999 package with a svn pull date
of Feb 15.

SOURCE: cat t.cc
int main() {
        constexpr int x_outer = 1;
        constexpr int x_inner = 2;
        int x = x_outer;
        int fpfail;
        #pragma omp target map(tofrom:fpfail) map(tofrom:x)
        #pragma omp teams shared(fpfail) private(x)
        {
                x = x_inner;
        }
}

INVOCATION: clang++ -v -std=c++11 -fopenmp t.cc
clang version 5.0.0 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
 "/usr/bin/clang-5.0" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all
-disable-free -main-file-name t.cc -mrelocation-model static -mthread-model
posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -v -dwarf-column-info
-debugger-tuning=gdb -resource-dir /usr/bin/../lib/clang/5.0.0
-internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/5.0.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 192 -fopenmp
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/t-fe0897.o -x c++ t.cc
clang -cc1 version 5.0.0 based upon LLVM 5.0.0svn default target
x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6
 /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/x86_64-pc-linux-gnu
 /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/backward
 /usr/bin/../lib/clang/5.0.0/include
 /usr/include
End of search list.
clang-5.0:
/var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999/lib/IR/Instructions.cpp:263:
void llvm::CallInst::init(llvm::FunctionType*, llvm::Value*,
llvm::ArrayRef<llvm::Value*>,
llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, const llvm::Twine&):
Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) ==
Args[i]->getType()) && "Calling a function with a bad signature!"' failed.
#0 0x00007f280fd9334a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/bin/../lib64/libLLVMSupport.so.5+0xfe34a)
#1 0x00007f280fd90f6e llvm::sys::RunSignalHandlers()
(/usr/bin/../lib64/libLLVMSupport.so.5+0xfbf6e)
#2 0x00007f280fd912ec (/usr/bin/../lib64/libLLVMSupport.so.5+0xfc2ec)
#3 0x00007f280d73f220 (/lib64/libc.so.6+0x33220)
#4 0x00007f280d73f1bf gsignal (/lib64/libc.so.6+0x331bf)
#5 0x00007f280d7405ba abort (/lib64/libc.so.6+0x345ba)
#6 0x00007f280d737ff7 (/lib64/libc.so.6+0x2bff7)
#7 0x00007f280d7380a2 (/lib64/libc.so.6+0x2c0a2)
#8 0x00007f28119675e8 llvm::CallInst::init(llvm::FunctionType*, llvm::Value*,
llvm::ArrayRef<llvm::Value*>,
llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&)
(/usr/bin/../lib64/libLLVMCore.so.5+0x1535e8)
#9 0x00007f280ebcd066
clang::CodeGen::CGOpenMPRuntime::emitTargetCall(clang::CodeGen::CodeGenFunction&,
clang::OMPExecutableDirective const&, llvm::Value*, llvm::Value*, clang::Expr
const*, clang::Expr const*, llvm::ArrayRef<llvm::Value*>)
(/usr/bin/../lib64/libclangCodeGen.so.5+0x224066)
#10 0x00007f280ec0b4d9 (/usr/bin/../lib64/libclangCodeGen.so.5+0x2624d9)
#11 0x00007f280ec0b77c
clang::CodeGen::CodeGenFunction::EmitOMPTargetDirective(clang::OMPTargetDirective
const&) (/usr/bin/../lib64/libclangCodeGen.so.5+0x26277c)
#12 0x00007f280ebf223b clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*) (/usr/bin/../lib64/libclangCodeGen.so.5+0x24923b)
#13 0x00007f280ebf2647
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/usr/bin/../lib64/libclangCodeGen.so.5+0x249647)
#14 0x00007f280ec30b34
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) (/usr/bin/../lib64/libclangCodeGen.so.5+0x287b34)
#15 0x00007f280ec3b967
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/usr/bin/../lib64/libclangCodeGen.so.5+0x292967)
#16 0x00007f280ec5cca9
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/bin/../lib64/libclangCodeGen.so.5+0x2b3ca9)
#17 0x00007f280ec6dd99
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/bin/../lib64/libclangCodeGen.so.5+0x2c4d99)
#18 0x00007f280ec6ec71
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(/usr/bin/../lib64/libclangCodeGen.so.5+0x2c5c71)
#19 0x00007f280ec6f4ba
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
(/usr/bin/../lib64/libclangCodeGen.so.5+0x2c64ba)
#20 0x00007f280ecc4e97 (/usr/bin/../lib64/libclangCodeGen.so.5+0x31be97)
#21 0x00007f280ec2595f (/usr/bin/../lib64/libclangCodeGen.so.5+0x27c95f)
#22 0x00007f28087890c2 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/bin/../lib64/../lib64/libclangParse.so.5+0x2e0c2)
#23 0x00007f280ec2d7d9 clang::CodeGenAction::ExecuteAction()
(/usr/bin/../lib64/libclangCodeGen.so.5+0x2847d9)
#24 0x00007f280e38a43e clang::FrontendAction::Execute()
(/usr/bin/../lib64/libclangFrontend.so.5+0xce43e)
#25 0x00007f280e34c836
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/bin/../lib64/libclangFrontend.so.5+0x90836)
#26 0x00007f280e0b8e97
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/bin/../lib64/libclangFrontendTool.so.5+0x3e97)
#27 0x0000000000410b98 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/bin/clang-5.0+0x410b98)
#28 0x000000000040c192 main (/usr/bin/clang-5.0+0x40c192)
#29 0x00007f280d72c2c1 __libc_start_main (/lib64/libc.so.6+0x202c1)
#30 0x000000000040d63a _start (/usr/bin/clang-5.0+0x40d63a)
Stack dump:
0.      Program arguments: /usr/bin/clang-5.0 -cc1 -triple x86_64-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -main-file-name t.cc -mrelocation-model
static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -v
-dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/bin/../lib/clang/5.0.0 -internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6 -internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/5.0.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 192 -fopenmp
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/t-fe0897.o -x c++ t.cc 
1.      <eof> parser at end of file
2.      t.cc:1:5: LLVM IR generation of declaration 'main'
3.      t.cc:1:5: Generating code for declaration 'main'
clang-5.0: error: unable to execute command: Aborted
clang-5.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 5.0.0 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-5.0: note: diagnostic msg: PLEASE submit a bug report to  and include the
crash backtrace, preprocessed source, and associated run script.
clang-5.0: note: diagnostic msg: 
********************

-- 
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/20170216/f592741b/attachment-0001.html>


More information about the llvm-bugs mailing list