4 Replies Latest reply on Nov 15, 2018 10:28 AM by dribbroc

    AOCC Error: Loc.isValid() && "point of instantiation must be valid!

    dribbroc

      Hi

       

      when  using AOCC-1.2.1 on a centos 7.5 machine, the compiler crashes with the following error message.

      When compiling the same code with clang 6 pure, no error occurs at all

       

      Thanks in Advance

      Dirk

       

      clang-6.0: /home/amd/JENKINS/workspace/CPUPC_AMD_LLVM-6-0-0-M7_Branch/llvm/tools/clang/include/clang/AST/DeclTemplate.h:1769: void clang::ClassTemplateSpecializationDecl::setPointOfInstantiation(clang::SourceLocation): Assertion `Loc.isValid() && "point of instantiation must be valid!"' failed.

      #0 0x00002b3652b64eca llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/../lib/libLLVM-6.0.so+0x711eca)

      #1 0x00002b3652b62fae llvm::sys::RunSignalHandlers() (/sfw/aocc/AOCC-1.2.1-Compiler/bin/../lib/libLLVM-6.0.so+0x70ffae)

      #2 0x00002b3652b63112 SignalHandler(int) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/../lib/libLLVM-6.0.so+0x710112)

      #3 0x00002b36522466d0 __restore_rt (/lib64/libpthread.so.0+0xf6d0)

      #4 0x00002b3656086277 __GI_raise (/lib64/libc.so.6+0x36277)

      #5 0x00002b3656087968 __GI_abort (/lib64/libc.so.6+0x37968)

      #6 0x00002b365607f096 __assert_fail_base (/lib64/libc.so.6+0x2f096)

      #7 0x00002b365607f142 (/lib64/libc.so.6+0x2f142)

      #8 0x000000000150bb33 clang::Sema::InstantiateClass(clang::SourceLocation, clang::CXXRecordDecl*, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind, bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x150bb33)

      #9 0x000000000150bcdb clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind, bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x150bcdb)

      #10 0x000000000155a011 clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::TypeDiagnoser*) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x155a011)

      #11 0x00000000011d17fa clang::Sema::IsDerivedFrom(clang::SourceLocation, clang::QualType, clang::QualType) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x11d17fa)

      #12 0x00000000014afa6c CheckOriginalCallArgDeduction(clang::Sema&, clang::sema::TemplateDeductionInfo&, clang::Sema::OriginalCallArg, clang::QualType) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x14afa6c)

      #13 0x00000000014e2e96 clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, llvm::SmallVectorImpl<clang::Sema::OriginalCallArg> const*, bool, llvm::function_ref<bool ()>) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x14e2e96)

      #14 0x00000000014e6e4f clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool, llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x14e6e4f)

      #15 0x00000000014008c9 clang::Sema::AddTemplateOverloadCandidate(clang::FunctionTemplateDecl*, clang::DeclAccessPair, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x14008c9)

      #16 0x0000000001401449 AddOverloadedCallCandidate(clang::Sema&, clang::DeclAccessPair, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x1401449)

      #17 0x00000000014016e4 clang::Sema::AddOverloadedCallCandidates(clang::UnresolvedLookupExpr*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x14016e4)

      #18 0x00000000014018c6 clang::Sema::buildOverloadedCallSet(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::OverloadCandidateSet*, clang::ActionResult<clang::Expr*, true>*) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x14018c6)

      #19 0x0000000001415f06 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x1415f06)

      #20 0x0000000001294285 clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x1294285)

      #21 0x00000000014fa434 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x14fa434) #22 0x00000000014f477a clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x14f477a)

      #23 0x0000000001516452 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x1516452)

      #24 0x00000000015177f0 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x15177f0)

      #25 0x000000000151791b clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x151791b)

      #26 0x00000000015164f2 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x15164f2)

      #27 0x00000000015189c1 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformForStmt(clang::ForStmt*) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x15189c1) #28 0x0000000001516425 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x1516425)

      #29 0x00000000015177f0 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x15177f0)

      #30 0x000000000151791b clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x151791b) #31 0x00000000015164f2 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x15164f2) #32 0x000000000151bc58 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x151bc58) #33 0x0000000001531697 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x1531697) #34 0x0000000001531b1b clang::Sema::PerformPendingInstantiations(bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x1531b1b) #35 0x0000000001530fa5 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x1530fa5) #36 0x0000000001531b1b clang::Sema::PerformPendingInstantiations(bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x1531b1b) #37 0x0000000001530fa5 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x1530fa5) #38 0x0000000001531b1b clang::Sema::PerformPendingInstantiations(bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x1531b1b) #39 0x00000000010ae026 clang::Sema::ActOnEndOfTranslationUnit() (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x10ae026) #40 0x0000000000edc7bb clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0xedc7bb) #41 0x0000000000ed4a1b clang::ParseAST(clang::Sema&, bool, bool) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0xed4a1b) #42 0x0000000000cf38bf clang::CodeGenAction::ExecuteAction() (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0xcf38bf) #43 0x0000000000c5b3e6 clang::FrontendAction::Execute() (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0xc5b3e6) #44 0x0000000000c2fd9e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0xc2fd9e) #45 0x0000000000cede2b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0xcede2b) #46 0x000000000083b308 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x83b308) #47 0x00000000008354ab main (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x8354ab) #48 0x00002b3656072445 __libc_start_main (/lib64/libc.so.6+0x22445) #49 0x00000000008366fe _start (/sfw/aocc/AOCC-1.2.1-Compiler/bin/clang-6.0+0x8366fe)

        • Re: AOCC Error: Loc.isValid() && "point of instantiation must be valid!
          jesse_amd

          Hi dribbroc,

           

          Would you be able to share the testcase, please?

            • Re: AOCC Error: Loc.isValid() && "point of instantiation must be valid!
              dribbroc

              Hi

               

              I sent to you a repro case.

              Additionally, the error is gone with AOCC 1.3.0

                • Re: AOCC Error: Loc.isValid() && "point of instantiation must be valid!
                  dribbroc

                  Another similar error arose with AOCC 1.3.0

                   

                  But this time, its 'easy' to reproduce, as it happens while compiling a library called alglib.

                  http://www.alglib.net/translator/re/alglib-3.13.0.cpp.gpl.zip

                  in folder alglib/cpp/src you need to call

                  clang++ -I. linalg.cpp -c -std=c++11  -O3 -march=znver1

                  and get

                   

                  summergames: src>$ clang++ -I. linalg.cpp -c -std=c++11  -O3

                  Stack dump:

                  0.      Program arguments: /sfw/aocc/AOCC-1.3.0-Compiler/bin/clang-7 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name linalg.cpp -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -coverage-notes-file /home/user/dribbroc/feat/trunk/thirdparty/alglib/cpp/src/linalg.gcno -resource-dir /sfw/aocc/AOCC-1.3.0-Compiler/lib/clang/7.0.0 -I . -c-isystem /sfw/aocc/AOCC-1.3.0-Compiler/include -cxx-isystem /sfw/aocc/AOCC-1.3.0-Compiler/include -internal-isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5 -internal-isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux -internal-isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward -internal-isystem /usr/local/include -internal-isystem /sfw/aocc/AOCC-1.3.0-Compiler/lib/clang/7.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home/user/dribbroc/feat/trunk/thirdparty/alglib/cpp/src -ferror-limit 19 -fmessage-length 189 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-loops -vectorize-slp -itodcalls -itodcallsbyclone -o linalg.o -x c++ linalg.cpp -faddrsig

                  1.      <eof> parser at end of file

                  2.      Per-module optimization passes

                  3.      Running pass 'CallGraph Pass Manager' on module 'linalg.cpp'.

                  4.      Running pass 'Loop Pass Manager' on function '@_ZN11alglib_impl16rmatrixrighttrsmEllPNS_9ae_matrixEllbblS1_llPNS_8ae_stateE'

                  5.      Running pass 'Loop Invariant Code Motion' on basic block '%inner.loop'

                  #0 0x00002ad79750e80a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/sfw/aocc/AOCC-1.3.0-Compiler/bin/../lib/libLLVM-7.so+0x6ca80a)

                  #1 0x00002ad79750cdc9 llvm::sys::RunSignalHandlers() (/sfw/aocc/AOCC-1.3.0-Compiler/bin/../lib/libLLVM-7.so+0x6c8dc9)

                  #2 0x00002ad79750cefd SignalHandler(int) (/sfw/aocc/AOCC-1.3.0-Compiler/bin/../lib/libLLVM-7.so+0x6c8efd)

                  #3 0x00002ad796c376d0 __restore_rt (/lib64/libpthread.so.0+0xf6d0)

                  #4 0x00002ad797e3fb25 llvm::SSAUpdaterImpl<llvm::SSAUpdater>::FindAvailableVals(llvm::SmallVectorImpl<llvm::SSAUpdaterImpl<llvm::SSAUpdater>::BBInfo*>*) (/sfw/aocc/AOCC-1.3.0-Compiler/bin/../lib/libLLVM-7.so+0xffbb25)