[llvm-bugs] [Bug 45997] New: "Trying to aggregate-copy a type without a trivial copy/move " "constructor or assignment operator" fails on arc code

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 19 16:25:26 PDT 2020


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

            Bug ID: 45997
           Summary: "Trying to aggregate-copy a type without a trivial
                    copy/move " "constructor or assignment operator" fails
                    on arc code
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

thakis at thakis:~/src/llvm-project$ cat invalid_url_tab_helper-108cf6.reduced.mm 
@class a;
struct d { a *e; };
struct l {
  virtual d g();
};
struct i {
  virtual ~i();
};
class k : i, l {
  d g();
};
d k::g() {}
thakis at thakis:~/src/llvm-project$ out/gn/bin/clang -cc1 -triple
arm64-apple-ios12.0.0 -fobjc-arc -emit-llvm
invalid_url_tab_helper-108cf6.reduced.mm
invalid_url_tab_helper-108cf6.reduced.mm:12:11: warning: non-void function does
not return a value [-Wreturn-type]
d k::g() {}
          ^
clang: ../../clang/lib/CodeGen/CGExprAgg.cpp:1943: void
clang::CodeGen::CodeGenFunction::EmitAggregateCopy(clang::CodeGen::LValue,
clang::CodeGen::LValue, clang::QualType, AggValueSlot::Overlap_t, bool):
Assertion `(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"' failed.
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: out/gn/bin/clang -cc1 -triple arm64-apple-ios12.0.0
-fobjc-arc -emit-llvm invalid_url_tab_helper-108cf6.reduced.mm 
1.      <eof> parser at end of file
2.      invalid_url_tab_helper-108cf6.reduced.mm:12:6: LLVM IR generation of
declaration 'k::g'
3.      invalid_url_tab_helper-108cf6.reduced.mm:12:6: Generating code for
declaration 'k::g'
 #0 0x0000000002f8311d PrintStackTraceSignalHandler(void*)
(out/gn/bin/clang+0x2f8311d)
 #1 0x0000000002f80ede llvm::sys::RunSignalHandlers()
(out/gn/bin/clang+0x2f80ede)
 #2 0x0000000002f832d5 SignalHandler(int) (out/gn/bin/clang+0x2f832d5)
 #3 0x00007fef6e097520 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x13520)
 #4 0x00007fef6dbb3f61 raise
/build/glibc-oCLvUT/glibc-2.29/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007fef6db9f535 abort /build/glibc-oCLvUT/glibc-2.29/stdlib/abort.c:81:7
 #6 0x00007fef6db9f40f _nl_load_domain
/build/glibc-oCLvUT/glibc-2.29/intl/loadmsgcat.c:1177:9
 #7 0x00007fef6dbacb92 (/lib/x86_64-linux-gnu/libc.so.6+0x32b92)
 #8 0x00000000021a1df9 (out/gn/bin/clang+0x21a1df9)
 #9 0x000000000210a509
clang::CodeGen::CodeGenFunction::EmitReturnOfRValue(clang::CodeGen::RValue,
clang::QualType) (out/gn/bin/clang+0x210a509)
#10 0x00000000020f9970
clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(llvm::FunctionCallee,
clang::ThunkInfo const*, bool) (out/gn/bin/clang+0x20f9970)
#11 0x00000000020fa20f
clang::CodeGen::CodeGenFunction::generateThunk(llvm::Function*,
clang::CodeGen::CGFunctionInfo const&, clang::GlobalDecl, clang::ThunkInfo
const&, bool) (out/gn/bin/clang+0x20fa20f)
#12 0x00000000020fa7c1
clang::CodeGen::CodeGenVTables::maybeEmitThunk(clang::GlobalDecl,
clang::ThunkInfo const&, bool) (out/gn/bin/clang+0x20fa7c1)
#13 0x00000000020fab74
clang::CodeGen::CodeGenVTables::EmitThunks(clang::GlobalDecl)
(out/gn/bin/clang+0x20fab74)
#14 0x0000000002071562
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (out/gn/bin/clang+0x2071562)
#15 0x000000000207bd5b
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
(out/gn/bin/clang+0x207bd5b)
#16 0x000000000266c69f (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(out/gn/bin/clang+0x266c69f)
#17 0x000000000266acbd
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(out/gn/bin/clang+0x266acbd)
#18 0x0000000003c7b685 clang::ParseAST(clang::Sema&, bool, bool)
(out/gn/bin/clang+0x3c7b685)
#19 0x00000000025c02f0 clang::FrontendAction::Execute()
(out/gn/bin/clang+0x25c02f0)
#20 0x0000000002521b62
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(out/gn/bin/clang+0x2521b62)
#21 0x00000000026651b1
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(out/gn/bin/clang+0x26651b1)
#22 0x0000000001f85beb cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (out/gn/bin/clang+0x1f85beb)
#23 0x0000000001f937d8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(out/gn/bin/clang+0x1f937d8)
#24 0x0000000001f9358d main (out/gn/bin/clang+0x1f9358d)




Happens with today's clang, but also happens with clangs from a few weeks ago.
Looks like this code hasn't been touched in a while.


We see this in chromium (https://crbug.com/1084623), but it doesn't look like a
new regression in clang.

-- 
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/20200519/7511d617/attachment.html>


More information about the llvm-bugs mailing list