<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Declare reduction assertion "Trying to aggregate-copy a type without a trivial copy/move constructor or assignment operator""
   href="https://bugs.llvm.org/show_bug.cgi?id=47529">47529</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Declare reduction assertion "Trying to aggregate-copy a type without a trivial copy/move constructor or assignment operator"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Clang Compiler Support
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>cchen@cray.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23960" name="attach_23960" title="reduced test case from Kokkos without template code">attachment 23960</a> <a href="attachment.cgi?id=23960&action=edit" title="reduced test case from Kokkos without template code">[details]</a></span>
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 <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> 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
```</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>