[LLVMbugs] [Bug 22791] New: Assertion "Should not emit dtor epilogue for non-exported trivial dtor!" failed when building llvm trunk with clang 3.6

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 4 09:56:32 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22791

            Bug ID: 22791
           Summary: Assertion "Should not emit dtor epilogue for
                    non-exported trivial dtor!" failed when building llvm
                    trunk with clang 3.6
           Product: new-bugs
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: sami.liedes at iki.fi
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Ok, this is weird enough that I suspect there must be something wrong with my
clang 3.6 build, but I believe I built it with a 3.5 build that has worked
fine...

When building llvm r231239 with clang 3.6, I get this assertion failure when
compiling lib/Support/CommandLine.cpp:

------------------------------------------------------------
clang-3.6:
/home/sliedes/scratch/build/3.6/llvm-3.6.0.src/tools/clang/lib/CodeGen/CGClass.cpp:1524:
void clang::CodeGen::CodeGenFunction::EnterDtorCleanups(const
clang::CXXDestructorDecl *, clang::CXXDtorType): Assertion `(!DD->isTrivial()
|| DD->hasAttr<DLLExportAttr>()) && "Should not emit dtor epilogue for
non-exported trivial dtor!"' failed.
------------------------------------------------------------

Here's a CReduced test case:

------------------------------------------------------------
typedef int string;
template <class> class parser;
template <class> class basic_parser {
public:
  basic_parser(int);

protected:
  ~basic_parser() = default;
};

template <> class parser<int> : basic_parser<string> {
  int parser_O;
  parser() : basic_parser(parser_O) {}
};
template class basic_parser<string>;
------------------------------------------------------------

And here's the full output from the compiler on the above reduced test case:

------------------------------------------------------------
$ ~/local/llvm-3.6/bin/clang-3.6 -fno-crash-diagnostics -std=c++11 -c min.cpp
min.cpp:13:27: warning: field 'parser_O' is uninitialized when used here
[-Wuninitialized]
  parser() : basic_parser(parser_O) {}
                          ^
clang-3.6:
/home/sliedes/scratch/build/3.6/llvm-3.6.0.src/tools/clang/lib/CodeGen/CGClass.cpp:1524:
void clang::CodeGen::CodeGenFunction::EnterDtorCleanups(const
clang::CXXDestructorDecl *, clang::CXXDtorType): Assertion `(!DD->isTrivial()
|| DD->hasAttr<DLLExportAttr>()) && "Should not emit dtor epilogue for
non-exported trivial dtor!"' failed.
0  libLLVMSupport.so       0x00007f05e4de01c8
llvm::sys::PrintStackTrace(_IO_FILE*) + 40
1  libLLVMSupport.so       0x00007f05e4de17cb
2  libc.so.6               0x00007f05e3008180
3  libc.so.6               0x00007f05e3008107 gsignal + 55
4  libc.so.6               0x00007f05e30094e8 abort + 328
5  libc.so.6               0x00007f05e3001226
6  libc.so.6               0x00007f05e30012d2
7  libclangCodeGen.so      0x00007f05df002b24
clang::CodeGen::CodeGenFunction::EnterDtorCleanups(clang::CXXDestructorDecl
const*, clang::CXXDtorType) + 1396
8  libclangCodeGen.so      0x00007f05df002222
clang::CodeGen::CodeGenFunction::EmitDestructorBody(clang::CodeGen::FunctionArgList&)
+ 546
9  libclangCodeGen.so      0x00007f05df0f79e3
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 979
10 libclangCodeGen.so      0x00007f05defe858b
clang::CodeGen::CodeGenModule::codegenCXXStructor(clang::CXXMethodDecl const*,
clang::CodeGen::StructorType) + 283
11 libclangCodeGen.so      0x00007f05df15821a
12 libclangCodeGen.so      0x00007f05df102602
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 418
13 libclangCodeGen.so      0x00007f05df154d84
14 libclangCodeGen.so      0x00007f05df16cb6f
15 libclangCodeGen.so      0x00007f05df0f23e7
16 libclangSema.so         0x00007f05dff24ecf
clang::Sema::InstantiateClassMembers(clang::SourceLocation,
clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&,
clang::TemplateSpecializationKind) + 367
17 libclangSema.so         0x00007f05dff25704
clang::Sema::InstantiateClassTemplateSpecializationMembers(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind) +
68
18 libclangSema.so         0x00007f05dfea9bfb
clang::Sema::ActOnExplicitInstantiation(clang::Scope*, clang::SourceLocation,
clang::SourceLocation, unsigned int, clang::SourceLocation, clang::CXXScopeSpec
const&, clang::OpaquePtr<clang::TemplateName>, clang::SourceLocation,
clang::SourceLocation, llvm::MutableArrayRef<clang::ParsedTemplateArgument>,
clang::SourceLocation, clang::AttributeList*) + 2123
19 libclangParse.so        0x00007f05e02e2f74
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 4596
20 libclangParse.so        0x00007f05e02c610b
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 3195
21 libclangParse.so        0x00007f05e03386df
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 847
22 libclangParse.so        0x00007f05e0337bc4
clang::Parser::ParseExplicitInstantiation(unsigned int, clang::SourceLocation,
clang::SourceLocation, clang::SourceLocation&, clang::AccessSpecifier) + 148
23 libclangParse.so        0x00007f05e0337a91
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 337 
24 libclangParse.so        0x00007f05e02c4ff5
clang::Parser::ParseDeclaration(unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 821
25 libclangParse.so        0x00007f05e0344773
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1683
26 libclangParse.so        0x00007f05e0343faa
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 474
27 libclangParse.so        0x00007f05e02b6586 clang::ParseAST(clang::Sema&,
bool, bool) + 406
28 libclangFrontend.so     0x00007f05e3e4b83e clang::FrontendAction::Execute()
+ 62
29 libclangFrontend.so     0x00007f05e3e1c29c
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 876
30 libclangFrontendTool.so 0x00007f05e3ba10e2
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3090
31 clang-3.6               0x000000000040f0d4 cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 676
32 clang-3.6               0x000000000040da01 main + 11777
33 libc.so.6               0x00007f05e2ff4b45 __libc_start_main + 245
34 clang-3.6               0x000000000040aae4
Stack dump:
0.      Program arguments: /home/sliedes/local/llvm-3.6/bin/clang-3.6 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name min.cpp -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
-coverage-file /home/sliedes/bug/clang/cmd/min.cpp -resource-dir
/home/sliedes/local/llvm-3.6/bin/../lib/clang/3.6.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/backward
-internal-isystem /usr/local/include -internal-isystem
/home/sliedes/local/llvm-3.6/bin/../lib/clang/3.6.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-std=c++11 -fdeprecated-macro -fdebug-compilation-dir
/home/sliedes/bug/clang/cmd -ferror-limit 19 -fmessage-length 161
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o min.o -x c++ min.cpp
1.      min.cpp:15:36: current parser token ';'
2.      min.cpp:8:3: LLVM IR generation of declaration
'basic_parser<int>::~basic_parser'
3.      min.cpp:8:3: Generating code for declaration
'basic_parser<int>::~basic_parser'
clang-3.6: error: unable to execute command: Aborted
clang-3.6: error: clang frontend command failed due to signal (use -v to see
invocation)
------------------------------------------------------------

-- 
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/20150304/6373062c/attachment.html>


More information about the llvm-bugs mailing list