[llvm-bugs] [Bug 47529] New: Declare reduction assertion "Trying to aggregate-copy a type without a trivial copy/move constructor or assignment operator"

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 14 14:17:21 PDT 2020


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

            Bug ID: 47529
           Summary: Declare reduction assertion "Trying to aggregate-copy
                    a type without a trivial copy/move constructor or
                    assignment operator"
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: cchen at cray.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 23960
  --> https://bugs.llvm.org/attachment.cgi?id=23960&action=edit
reduced test case from Kokkos without template code

Not sure if this is a bug or what we expect, however, this asserts only happens
when `-fopenmp-targets` is set.

Command for running the code:
clang++ -fopenmp -fopenmp-targets=nvptx64 -emit-llvm -S no_template.cpp

```
Assertion failed: ((Record->hasTrivialCopyConstructor() ||
Record->hasTrivialCopyAssignment() || Record->hasTrivialMoveConstructor() ||
Record->hasTrivialMoveAssignment() || Record->isUnion()) && "Trying to
aggregate-copy a type without a trivial copy/move " "constructor or assignment
operator"), function EmitAggregateCopy, file
/Users/cchen/workspace/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp, line 1950.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /Users/cchen/llvm/bin/clang-10 -cc1 -triple nvptx64
-aux-triple x86_64-apple-darwin18.7.0 -Wundef-prefix=TARGET_OS_
-Werror=undef-prefix -Wdeprecated-objc-isa-usage
-Werror=deprecated-objc-isa-usage -emit-llvm -disable-free -main-file-name
no_template.cpp -mrelocation-model static -mframe-pointer=all
-fno-rounding-math -fno-verbose-asm -no-integrated-as
-fcompatibility-qualified-id-block-type-checking -target-cpu sm_35
-fno-split-dwarf-inlining -debugger-tuning=gdb -target-linker-version 512.4
-resource-dir /Users/cchen/llvm/lib/clang/12.0.0 -internal-isystem
/Users/cchen/llvm/lib/clang/12.0.0/include/openmp_wrappers -include
__clang_openmp_device_functions.h -internal-isystem
/Users/cchen/llvm/bin/../include/c++/v1 -internal-isystem /usr/include/c++/v1
-internal-isystem /Users/cchen/llvm/bin/../include/c++/v1 -internal-isystem
/usr/include/c++/v1 -internal-isystem /usr/local/include -internal-isystem
/Users/cchen/llvm/lib/clang/12.0.0/include -internal-externc-isystem
/usr/include -internal-isystem /usr/local/include -internal-isystem
/Users/cchen/llvm/lib/clang/12.0.0/include -internal-externc-isystem
/usr/include -fdeprecated-macro -fno-dwarf-directory-asm
-fdebug-compilation-dir /Users/cchen/workspace/declare__reduction -ferror-limit
19 -fopenmp -fopenmp-cuda-parallel-target-regions -fgnuc-version=4.2.1
-fcxx-exceptions -fexceptions -fcolor-diagnostics -fopenmp-is-device
-fopenmp-host-ir-file-path
/var/folders/rx/8phxx7k53pqghv8kjxkbv2ch006fcl/T/no_template-40edfc.bc -o
/var/folders/rx/8phxx7k53pqghv8kjxkbv2ch006fcl/T/no_template-5bef9d.ll -x c++
no_template.cpp
1.      <eof> parser at end of file
2.      no_template.cpp:44:5: LLVM IR generation of declaration 'main'
0  clang-10                 0x000000010361dd9f
llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 63
1  clang-10                 0x000000010361e36b
PrintStackTraceSignalHandler(void*) + 27
2  clang-10                 0x000000010361bc76 llvm::sys::RunSignalHandlers() +
118
3  clang-10                 0x00000001036200e0 SignalHandler(int) + 208
4  libsystem_platform.dylib 0x00007fff7ad2fb5d _sigtramp + 29
5  clang-10                 0x000000010a87af22
llvm::DenseMapInfo<llvm::codeview::GloballyHashedType>::Tombstone + 3018530
6  libsystem_c.dylib        0x00007fff7abe96a6 abort + 127
7  libsystem_c.dylib        0x00007fff7abb220d basename_r + 0
8  clang-10                 0x0000000103e7b142
clang::CodeGen::CodeGenFunction::EmitAggregateCopy(clang::CodeGen::LValue,
clang::CodeGen::LValue, clang::QualType,
clang::CodeGen::AggValueSlot::Overlap_t, bool) + 546
9  clang-10                 0x000000010408e020 emitReductionListCopy((anonymous
namespace)::CopyAction, clang::CodeGen::CodeGenFunction&, clang::QualType,
llvm::ArrayRef<clang::Expr const*>, clang::CodeGen::Address,
clang::CodeGen::Address, CopyOptionsTy) + 5344
10 clang-10                 0x00000001040787dc
emitShuffleAndReduceFunction(clang::CodeGen::CodeGenModule&,
llvm::ArrayRef<clang::Expr const*>, clang::QualType, llvm::Function*,
clang::SourceLocation) + 5484
11 clang-10                 0x0000000104076617
clang::CodeGen::CGOpenMPRuntimeGPU::emitReduction(clang::CodeGen::CodeGenFunction&,
clang::SourceLocation, llvm::ArrayRef<clang::Expr const*>,
llvm::ArrayRef<clang::Expr const*>, llvm::ArrayRef<clang::Expr const*>,
llvm::ArrayRef<clang::Expr const*>,
clang::CodeGen::CGOpenMPRuntime::ReductionOptionsTy) + 3015
12 clang-10                 0x00000001040d4ff9
clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseFinal(clang::OMPExecutableDirective
const&, llvm::omp::Directive) + 1401
13 clang-10                 0x000000010412996f
emitTargetParallelRegion(clang::CodeGen::CodeGenFunction&,
clang::OMPTargetParallelDirective const&,
clang::CodeGen::PrePostActionTy&)::$_154::operator()(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&) const + 383
14 clang-10                 0x00000001041297e5 void
clang::CodeGen::RegionCodeGenTy::CallbackFn<emitTargetParallelRegion(clang::CodeGen::CodeGenFunction&,
clang::OMPTargetParallelDirective const&,
clang::CodeGen::PrePostActionTy&)::$_154>(long,
clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&) + 37
15 clang-10                 0x0000000103fad786
clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&)
const + 118
16 clang-10                 0x0000000103ffa208 (anonymous
namespace)::CGOpenMPRegionInfo::EmitBody(clang::CodeGen::CodeGenFunction&,
clang::Stmt const*) + 88
17 clang-10                 0x00000001040cc161
clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(clang::CapturedStmt
const&, clang::SourceLocation) + 1313
18 clang-10                 0x0000000103fb4326
emitParallelOrTeamsOutlinedFunction(clang::CodeGen::CodeGenModule&,
clang::OMPExecutableDirective const&, clang::CapturedStmt const*,
clang::VarDecl const*, llvm::omp::Directive, llvm::StringRef,
clang::CodeGen::RegionCodeGenTy const&) + 998
19 clang-10                 0x0000000103fb3e47
clang::CodeGen::CGOpenMPRuntime::emitParallelOutlinedFunction(clang::OMPExecutableDirective
const&, clang::VarDecl const*, llvm::omp::Directive,
clang::CodeGen::RegionCodeGenTy const&) + 167
20 clang-10                 0x000000010407168a
clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelOutlinedFunction(clang::OMPExecutableDirective
const&, clang::VarDecl const*, llvm::omp::Directive,
clang::CodeGen::RegionCodeGenTy const&) + 138
21 clang-10                 0x00000001040d69d5
emitCommonOMPParallelDirective(clang::CodeGen::CodeGenFunction&,
clang::OMPExecutableDirective const&, llvm::omp::Directive,
clang::CodeGen::RegionCodeGenTy const&, llvm::function_ref<void
(clang::CodeGen::CodeGenFunction&, clang::OMPExecutableDirective const&,
llvm::SmallVectorImpl<llvm::Value*>&)> const&) + 149
22 clang-10                 0x00000001041296dc
emitTargetParallelRegion(clang::CodeGen::CodeGenFunction&,
clang::OMPTargetParallelDirective const&, clang::CodeGen::PrePostActionTy&) +
172
23 clang-10                 0x0000000104129628
clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelDeviceFunction(clang::CodeGen::CodeGenModule&,
llvm::StringRef, clang::OMPTargetParallelDirective
const&)::$_102::operator()(clang::CodeGen::CodeGenFunction&,
clang::CodeGen::PrePostActionTy&) const + 40
24 clang-10                 0x00000001041295f5 void
clang::CodeGen::RegionCodeGenTy::CallbackFn<clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelDeviceFunction(clang::CodeGen::CodeGenModule&,
llvm::StringRef, clang::OMPTargetParallelDirective const&)::$_102>(long,
clang::CodeGen::CodeGenFunction&, clang::CodeGen::PrePostActionTy&) + 37
25 clang-10                 0x0000000103fad786
clang::CodeGen::RegionCodeGenTy::operator()(clang::CodeGen::CodeGenFunction&)
const + 118
26 clang-10                 0x0000000103ffa208 (anonymous
namespace)::CGOpenMPRegionInfo::EmitBody(clang::CodeGen::CodeGenFunction&,
clang::Stmt const*) + 88
27 clang-10                 0x00000001040cc161
clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(clang::CapturedStmt
const&, clang::SourceLocation) + 1313
28 clang-10                 0x0000000103fddb71
clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(clang::OMPExecutableDirective
const&, llvm::StringRef, llvm::Function*&, llvm::Constant*&, bool,
clang::CodeGen::RegionCodeGenTy const&) + 673
29 clang-10                 0x000000010406f4d5
clang::CodeGen::CGOpenMPRuntimeGPU::emitSPMDKernel(clang::OMPExecutableDirective
const&, llvm::StringRef, llvm::Function*&, llvm::Constant*&, bool,
clang::CodeGen::RegionCodeGenTy const&) + 725
30 clang-10                 0x0000000104070d37
clang::CodeGen::CGOpenMPRuntimeGPU::emitTargetOutlinedFunction(clang::OMPExecutableDirective
const&, llvm::StringRef, llvm::Function*&, llvm::Constant*&, bool,
clang::CodeGen::RegionCodeGenTy const&) + 327
31 clang-10                 0x00000001040efe2a
clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelDeviceFunction(clang::CodeGen::CodeGenModule&,
llvm::StringRef, clang::OMPTargetParallelDirective const&) + 170
32 clang-10                 0x0000000103fe2f20
clang::CodeGen::CGOpenMPRuntime::scanForTargetRegionsFunctions(clang::Stmt
const*, llvm::StringRef) + 496
33 clang-10                 0x0000000103fe3363
clang::CodeGen::CGOpenMPRuntime::scanForTargetRegionsFunctions(clang::Stmt
const*, llvm::StringRef) + 1587
34 clang-10                 0x0000000103fe3bb0
clang::CodeGen::CGOpenMPRuntime::emitTargetFunctions(clang::GlobalDecl) + 320
35 clang-10                 0x0000000103fe4e3e
clang::CodeGen::CGOpenMPRuntime::emitTargetGlobal(clang::GlobalDecl) + 142
36 clang-10                 0x000000010418d74e
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 926
37 clang-10                 0x0000000104197c9a
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 266
38 clang-10                 0x0000000104382b62 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) + 146
39 clang-10                 0x0000000104146ede
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 222
40 clang-10                 0x0000000107503844 clang::ParseAST(clang::Sema&,
bool, bool) + 548
41 clang-10                 0x00000001048c95e2
clang::ASTFrontendAction::ExecuteAction() + 322
42 clang-10                 0x0000000104146087
clang::CodeGenAction::ExecuteAction() + 2391
43 clang-10                 0x00000001048c8b71 clang::FrontendAction::Execute()
+ 129
44 clang-10                 0x000000010480f627
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 2087
45 clang-10                 0x0000000104a20ac1
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1761
46 clang-10                 0x0000000100ce611c cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 1388
47 clang-10                 0x0000000100cd9632
ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) + 434
48 clang-10                 0x0000000100cd8305 main + 1509
49 libdyld.dylib            0x00007fff7ab443d5 start + 1
clang-10: error: unable to execute command: Abort trap: 6
```

-- 
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/20200914/5aab8ae1/attachment-0001.html>


More information about the llvm-bugs mailing list