[LLVMbugs] [Bug 23484] New: Clang fail: Assertion `!Old || Old->getCachedLinkage() == D->getCachedLinkage()' failed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 11 13:26:54 PDT 2015


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

            Bug ID: 23484
           Summary: Clang fail: Assertion `!Old || Old->getCachedLinkage()
                    == D->getCachedLinkage()' failed
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: anton.mitrokhin at phystech.edu
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Reproducer:

// test.cpp:
namespace {
struct l_array_0 {
  static l_array_0 init(int v0) {
    l_array_0 ret;
    ret.array = v0;
    return ret;
  }
  int array;
} ;

};


extern "C" {
void incXY___un_3C_vyi_3C_4_3E__3E_(l_array_0 (*v_));
}


void incXY___un_3C_vyi_3C_4_3E__3E_(l_array_0 (*v_)) {
  int a = 0;
  return;
}

Compile like (clang 3.4, 3.5, 3.6 and trunk):
clang++ -O2 -m64 -c test.cpp


Output:
clang: /export/users/nightly/llvm/llvm-trunk/tools/clang/lib/AST/Decl.cpp:1341:
static clang::LinkageInfo clang::LinkageComputer::getLVForDecl(const
clang::NamedDecl *, LVComputationKind): Assertion `!Old ||
Old->getCachedLinkage() == D->getCachedLinkage()' failed.
#0 0x244775a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(llvm/bin-trunk/bin/clang+0x244775a)
#1 0x2448aeb (llvm/bin-trunk/bin/clang+0x2448aeb)
#2 0x3a4820f750 __restore_rt (/lib64/libpthread.so.0+0x3a4820f750)
#3 0x3a47a35c39 __GI_raise (/lib64/libc.so.6+0x3a47a35c39)
#4 0x3a47a37348 __GI_abort (/lib64/libc.so.6+0x3a47a37348)
#5 0x3a47a2eb96 __assert_fail_base (/lib64/libc.so.6+0x3a47a2eb96)
#6 0x3a47a2ec42 (/lib64/libc.so.6+0x3a47a2ec42)
#7 0x1561d89 (llvm/bin-trunk/bin/clang+0x1561d89)
#8 0x1553adb clang::NamedDecl::getLinkageInternal() const
(llvm/bin-trunk/bin/clang+0x1553adb)
#9 0xc3dada clang::Sema::ActOnFunctionDeclarator(clang::Scope*,
clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*,
clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
bool&) (llvm/bin-trunk/bin/clang+0xc3dada)
#10 0xc38045 clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&,
llvm::MutableArrayRef<clang::TemplateParameterList*>)
(llvm/bin-trunk/bin/clang+0xc38045)
#11 0xc54979 clang::Sema::ActOnStartOfFunctionDef(clang::Scope*,
clang::Declarator&) (llvm/bin-trunk/bin/clang+0xc54979)
#12 0xad0b00 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(llvm/bin-trunk/bin/clang+0xad0b00)
#13 0xae2613 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned
int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(llvm/bin-trunk/bin/clang+0xae2613)
#14 0xad0271
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(llvm/bin-trunk/bin/clang+0xad0271)
#15 0xacfcbc
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(llvm/bin-trunk/bin/clang+0xacfcbc)
#16 0xacedd0
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (llvm/bin-trunk/bin/clang+0xacedd0)
#17 0xace43b
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(llvm/bin-trunk/bin/clang+0xace43b)
#18 0xaca2e6 clang::ParseAST(clang::Sema&, bool, bool)
(llvm/bin-trunk/bin/clang+0xaca2e6)
#19 0x6c475e clang::FrontendAction::Execute()
(llvm/bin-trunk/bin/clang+0x6c475e)
#20 0x6950ec clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(llvm/bin-trunk/bin/clang+0x6950ec)
#21 0x678018 clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(llvm/bin-trunk/bin/clang+0x678018)
#22 0x66f3fe cc1_main(llvm::ArrayRef<char const*>, char const*, void*)
(llvm/bin-trunk/bin/clang+0x66f3fe)
#23 0x676830 main (llvm/bin-trunk/bin/clang+0x676830)
#24 0x3a47a21d65 __libc_start_main (/lib64/libc.so.6+0x3a47a21d65)
#25 0x66f0ed _start (llvm/bin-trunk/bin/clang+0x66f0ed)
Stack dump:
0.      Program arguments: llvm/bin-trunk/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name test.cpp
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-target-linker-version 2.23.2 -momit-leaf-frame-pointer -dwarf-column-info
-fno-unique-section-names -coverage-file test_dir/test.cpp -resource-dir
llvm/bin-trunk/bin/../lib/clang/3.7.0
-I/opt/intel/composer_xe_2015.2.164/ipp/include
-I/opt/intel/composer_xe_2015.2.164/mkl/include
-I/opt/intel/composer_xe_2015.2.164/tbb/include -internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../include/c++/4.8.2
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../include/c++/4.8.2/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../include/c++/4.8.2/backward
-internal-isystem /usr/local/include -internal-isystem
llvm/bin-trunk/bin/../lib/clang/3.7.0/include -internal-externc-isystem
/include -internal-externc-isystem /usr/include -O2 -fdeprecated-macro
-fdebug-compilation-dir test_dir-ferror-limit 19 -fmessage-length 271
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o test.o -x c++ test.cpp
1.      test.cpp:20:54: current parser token '{'
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.7.0 (trunk 236959)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: 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: 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/20150511/eddf42c6/attachment.html>


More information about the llvm-bugs mailing list