[llvm-bugs] [Bug 34925] New: [openmp] Type.h: Assertion `isa<T>(CanonicalType)' failed.
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Oct 12 05:36:11 PDT 2017
https://bugs.llvm.org/show_bug.cgi?id=34925
Bug ID: 34925
Summary: [openmp] Type.h: Assertion `isa<T>(CanonicalType)'
failed.
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: sergey.nesterov at intel.com
CC: llvm-bugs at lists.llvm.org
============main.c================
void foo();
void main() {
#pragma omp task
{
while (0) {}
#pragma omp taskgroup
{
#pragma omp task
foo();
}
}
}
==================================
$ clang -v
clang version 6.0.0 (trunk 315570)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ clang -c -O0 -fopenmp main.c
clang-6.0: .../llvm/tools/clang/include/clang/AST/Type.h:6165: const T*
clang::Type::castAs() const [with T = clang::PointerType]: Assertion
`isa<T>(CanonicalType)' failed.
#0 0x0000000003ff8725 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
.../llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x0000000003ff87b6 PrintStackTraceSignalHandler(void*)
.../llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x0000000003ff6ca2 llvm::sys::RunSignalHandlers()
.../llvm/lib/Support/Signals.cpp:49:0
#3 0x0000000003ff80bd SignalHandler(int)
.../llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007faeb8c44100 __restore_rt (/lib64/libpthread.so.0+0xf100)
#5 0x00007faeb783c5f7 __GI_raise (/lib64/libc.so.6+0x355f7)
#6 0x00007faeb783dce8 __GI_abort (/lib64/libc.so.6+0x36ce8)
#7 0x00007faeb7835566 __assert_fail_base (/lib64/libc.so.6+0x2e566)
#8 0x00007faeb7835612 (/lib64/libc.so.6+0x2e612)
#9 0x0000000004347d04 clang::PointerType const*
clang::Type::castAs<clang::PointerType>() const
.../llvm/tools/clang/include/clang/AST/Type.h:6166:0
#10 0x00000000046877b8 (anonymous
namespace)::CGOpenMPRegionInfo::getThreadIDVariableLValue(clang::CodeGen::CodeGenFunction&)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:1114:0
#11 0x0000000004689af7
clang::CodeGen::CGOpenMPRuntime::getThreadID(clang::CodeGen::CodeGenFunction&,
clang::SourceLocation)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:1447:0
#12 0x000000000469c0a4
clang::CodeGen::CGOpenMPRuntime::emitTaskInit(clang::CodeGen::CodeGenFunction&,
clang::SourceLocation, clang::OMPExecutableDirective const&, llvm::Value*,
clang::QualType, clang::CodeGen::Address, clang::CodeGen::OMPTaskDataTy const&)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:4353:0
#13 0x000000000469d542
clang::CodeGen::CGOpenMPRuntime::emitTaskCall(clang::CodeGen::CodeGenFunction&,
clang::SourceLocation, clang::OMPExecutableDirective const&, llvm::Value*,
clang::QualType, clang::CodeGen::Address, clang::Expr const*,
clang::CodeGen::OMPTaskDataTy const&)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:4432:0
#14 0x0000000004334c1d operator()
.../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:2939:0
#15 0x0000000004334c1d
clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(clang::OMPTaskDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&, llvm::Value*,
clang::CodeGen::OMPTaskDataTy
const&)#2}::operator()(clang::CodeGen::CodeGenFunction&, llvm::Value*,
clang::CodeGen::OMPTaskDataTy const&) const (.../bin/clang-6.0+0x4334c1d)
#16 0x000000000433e519 void llvm::function_ref<void
(clang::CodeGen::CodeGenFunction&, llvm::Value*, clang::CodeGen::OMPTaskDataTy
const&)>::callback_fn<clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(clang::OMPTaskDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&, llvm::Value*,
clang::CodeGen::OMPTaskDataTy const&)#2}>(long,
clang::CodeGen::CodeGenFunction&, llvm::Value*, clang::CodeGen::OMPTaskDataTy
const&) .../llvm/include/llvm/ADT/STLExtras.h:98:0
#17 0x000000000434b866 llvm::function_ref<void
(clang::CodeGen::CodeGenFunction&, llvm::Value*, clang::CodeGen::OMPTaskDataTy
const&)>::operator()(clang::CodeGen::CodeGenFunction&, llvm::Value*,
clang::CodeGen::OMPTaskDataTy const&) const
.../llvm/include/llvm/ADT/STLExtras.h:112:0
#18 0x0000000004334acc
clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(clang::OMPExecutableDirective
const&, clang::CodeGen::RegionCodeGenTy const&, llvm::function_ref<void
(clang::CodeGen::CodeGenFunction&, llvm::Value*, clang::CodeGen::OMPTaskDataTy
const&)> const&, clang::CodeGen::OMPTaskDataTy&)
.../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:2909:0
#19 0x0000000004334e7f
clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(clang::OMPTaskDirective
const&) .../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:2940:0
#20 0x0000000004306467 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:224:0
#21 0x0000000004306cc2
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:379:0
#22 0x0000000004306bfe
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:371:0
#23 0x00000000043069f3
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:344:0
#24 0x0000000004305dd5 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:53:0
#25 0x0000000004335494 operator()
.../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:2990:0
#26 0x0000000004335494
clang::CodeGen::CodeGenFunction::EmitOMPTaskgroupDirective(clang::OMPTaskgroupDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)#1}::operator()(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&) const (.../bin/clang-6.0+0x4335494)
#27 0x000000000433e54d void
clang::CodeGen::RegionCodeGenTy::CallbackFn<clang::CodeGen::CodeGenFunction::EmitOMPTaskgroupDirective(clang::OMPTaskgroupDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)#1}>(long, clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.h:75:0
#28 0x000000000468391b
clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&)
const .../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:707:0
#29 0x0000000004687858 (anonymous
namespace)::CGOpenMPRegionInfo::EmitBody(clang::CodeGen::CodeGenFunction&,
clang::Stmt const*) .../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:1127:0
#30 0x00000000046a5196
clang::CodeGen::CGOpenMPRuntime::emitInlinedDirective(clang::CodeGen::CodeGenFunction&,
clang::OpenMPDirectiveKind, clang::CodeGen::RegionCodeGenTy const&, bool)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:5559:0
#31 0x00000000046919c6
clang::CodeGen::CGOpenMPRuntime::emitTaskgroupRegion(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::RegionCodeGenTy const&, clang::SourceLocation)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:2634:0
#32 0x000000000433555a
clang::CodeGen::CodeGenFunction::EmitOMPTaskgroupDirective(clang::OMPTaskgroupDirective
const&) .../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:2992:0
#33 0x00000000043064f3 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:236:0
#34 0x0000000004306cc2
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:379:0
#35 0x0000000004306bfe
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:371:0
#36 0x00000000043069f3
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:344:0
#37 0x0000000004305dd5 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:53:0
#38 0x0000000004334b76 operator()
.../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:2932:0
#39 0x0000000004334b76
clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(clang::OMPTaskDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)#1}::operator()(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&) const (.../bin/clang-6.0+0x4334b76)
#40 0x000000000433e4bd void
clang::CodeGen::RegionCodeGenTy::CallbackFn<clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(clang::OMPTaskDirective
const&)::{lambda(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)#1}>(long, clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.h:75:0
#41 0x0000000004683945
clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&)
const .../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:710:0
#42 0x0000000004333ab9 operator()
.../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:2873:0
#43 0x0000000004333ab9
clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(clang::OMPExecutableDirective
const&, clang::CodeGen::RegionCodeGenTy const&, llvm::function_ref<void
(clang::CodeGen::CodeGenFunction&, llvm::Value*, clang::CodeGen::OMPTaskDataTy
const&)> const&,
clang::CodeGen::OMPTaskDataTy&)::{lambda(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)#1}::operator()(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&) const (.../bin/clang-6.0+0x4333ab9)
#44 0x000000000433e490 void
clang::CodeGen::RegionCodeGenTy::CallbackFn<clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(clang::OMPExecutableDirective
const&, clang::CodeGen::RegionCodeGenTy const&, llvm::function_ref<void
(clang::CodeGen::CodeGenFunction&, llvm::Value*, clang::CodeGen::OMPTaskDataTy
const&)> const&,
clang::CodeGen::OMPTaskDataTy&)::{lambda(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)#1}>(long, clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&)
.../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.h:75:0
#45 0x000000000468391b
clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&)
const .../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:707:0
#46 0x0000000004687858 (anonymous
namespace)::CGOpenMPRegionInfo::EmitBody(clang::CodeGen::CodeGenFunction&,
clang::Stmt const*) .../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:1127:0
#47 0x00000000043107b4
clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(clang::CapturedStmt
const&) .../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:2311:0
#48 0x0000000004688fcb
clang::CodeGen::CGOpenMPRuntime::emitTaskOutlinedFunction(clang::OMPExecutableDirective
const&, clang::VarDecl const*, clang::VarDecl const*, clang::VarDecl const*,
clang::OpenMPDirectiveKind, clang::CodeGen::RegionCodeGenTy const&, bool,
unsigned int&) .../llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:1331:0
#49 0x0000000004334a79
clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(clang::OMPExecutableDirective
const&, clang::CodeGen::RegionCodeGenTy const&, llvm::function_ref<void
(clang::CodeGen::CodeGenFunction&, llvm::Value*, clang::CodeGen::OMPTaskDataTy
const&)> const&, clang::CodeGen::OMPTaskDataTy&)
.../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:2908:0
#50 0x0000000004334e7f
clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(clang::OMPTaskDirective
const&) .../llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp:2940:0
#51 0x0000000004306467 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:224:0
#52 0x0000000004306cc2
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
.../llvm/tools/clang/lib/CodeGen/CGStmt.cpp:379:0
#53 0x00000000043784d5
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) .../llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:1121:0
#54 0x0000000004379044
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
.../llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:1286:0
#55 0x0000000004396ba9
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) .../llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:3253:0
#56 0x00000000043922f4
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) .../llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:2029:0
#57 0x0000000004391475
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
.../llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:1806:0
#58 0x000000000439a762
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
.../llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:3995:0
#59 0x0000000004da79d8 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
.../llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp:159:0
#60 0x0000000004da1205
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:170:0
#61 0x0000000005a1ce9a clang::ParseAST(clang::Sema&, bool, bool)
.../llvm/tools/clang/lib/Parse/ParseAST.cpp:151:0
#62 0x00000000048b97dc clang::ASTFrontendAction::ExecuteAction()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1000:0
#63 0x0000000004d9fae2 clang::CodeGenAction::ExecuteAction()
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1028:0
#64 0x00000000048b921d clang::FrontendAction::Execute()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:901:0
#65 0x000000000485b500
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
.../llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#66 0x00000000049f07b2
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
.../llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#67 0x00000000020217fb cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) .../llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#68 0x0000000002017504 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) .../llvm/tools/clang/tools/driver/driver.cpp:309:0
#69 0x000000000201818d main .../llvm/tools/clang/tools/driver/driver.cpp:388:0
#70 0x00007faeb7828b15 __libc_start_main (/lib64/libc.so.6+0x21b15)
#71 0x0000000002014d89 _start (.../bin/clang-6.0+0x2014d89)
Stack dump:
0. Program arguments: .../bin/clang-6.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
main.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-coverage-notes-file .../main.gcno -resource-dir .../lib/clang/6.0.0
-internal-isystem /usr/local/include -internal-isystem
.../lib/clang/6.0.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O0 -fdebug-compilation-dir ...
-ferror-limit 19 -fmessage-length 271 -fopenmp -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o main.o -x c main.c
1. <eof> parser at end of file
2. main.c:3:5: LLVM IR generation of declaration 'main'
3. main.c:3:5: Generating code for declaration 'main'
4. main.c:5:5: LLVM IR generation of compound statement ('{}')
5. main.c:9:9: LLVM IR generation of compound statement ('{}')
clang-6.0: error: unable to execute command: Aborted
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 315570)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: .../bin
clang-6.0: 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-6.0: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg: /tmp/main-67d38e.c
clang-6.0: note: diagnostic msg: /tmp/main-67d38e.sh
clang-6.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/20171012/f12f9e0d/attachment-0001.html>
More information about the llvm-bugs
mailing list