[llvm-bugs] [Bug 43923] New: Clang asserts with coroutines in EmitScalarExpr: E && hasScalarEvaluationKind(E->getType()) && "Invalid scalar expression to emit"

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 6 11:20:09 PST 2019


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

            Bug ID: 43923
           Summary: Clang asserts with coroutines in EmitScalarExpr: E &&
                    hasScalarEvaluationKind(E->getType()) && "Invalid
                    scalar expression to emit"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pirama at google.com
                CC: blitzrakete at gmail.com, danalbert at google.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk, srhines at google.com

Created attachment 22781
  --> https://bugs.llvm.org/attachment.cgi?id=22781&action=edit
repro input

This was originally reported in the Android NDK bugtracker at
https://github.com/android/ndk/issues/1119.

Godbolt link: https://godbolt.org/z/InGxJi
Source file attached.

To repro:
clang++ -std=c++2a shop-fac221.cpp
Stack trace:
 #0 0x0000000007ff30b9 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/ssd2/pirama/llvm-monorepo/monorepo/llvm/lib/Support/Unix/Signals.inc:532:11    
 #1 0x0000000007ff3269 PrintStackTraceSignalHandler(void*)
/ssd2/pirama/llvm-monorepo/monorepo/llvm/lib/Support/Unix/Signals.inc:593:1
 #2 0x0000000007ff1b36 llvm::sys::RunSignalHandlers()
/ssd2/pirama/llvm-monorepo/monorepo/llvm/lib/Support/Signals.cpp:67:5
 #3 0x0000000007ff39cb SignalHandler(int)
/ssd2/pirama/llvm-monorepo/monorepo/llvm/lib/Support/Unix/Signals.inc:384:1
 #4 0x00007fc102e8f3a0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x123a0)
 #5 0x00007fc102130cfb raise (/lib/x86_64-linux-gnu/libc.so.6+0x36cfb)
 #6 0x00007fc10211b8ad abort (/lib/x86_64-linux-gnu/libc.so.6+0x218ad)
 #7 0x00007fc10211b77f (/lib/x86_64-linux-gnu/libc.so.6+0x2177f)
 #8 0x00007fc102129542 (/lib/x86_64-linux-gnu/libc.so.6+0x2f542)
 #9 0x000000000881afc9
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CGExprScalar.cpp:4444:
35                  
#10 0x0000000008877b03
clang::CodeGen::CodeGenFunction::EmitCoroutineBody(clang::CoroutineBodyStmt
const&) /ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CGCoroutine.
cpp:568:9
#11 0x00000000086f6f76 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGe
n/CGStmt.cpp:151:5
#12 0x00000000086bbed5
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CodeGenFunction.cpp:1059:1
#13 0x00000000086bc93a
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
/ssd2/pirama/llvm-monorepo/mo
norepo/clang/lib/CodeGen/CodeGenFunction.cpp:1222:3
#14 0x000000000858a1c4
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) /ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeG
en/CodeGenModule.cpp:4423:3
#15 0x00000000085812db
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) /ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CodeG
enModule.cpp:0:9
#16 0x0000000008577cc7 clang::CodeGen::CodeGenModule::EmitDeferred()
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CodeGenModule.cpp:2132:5
#17 0x000000000857632f clang::CodeGen::CodeGenModule::Release()
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CodeGenModule.cpp:393:3
#18 0x0000000008edd832 (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/ModuleBuilde
r.cpp:0:18
#19 0x0000000008ed7797
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CodeGenAction.cpp:242:14
#20 0x000000000afc307c clang::ParseAST(clang::Sema&, bool, bool)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/Parse/ParseAST.cpp:178:12
#21 0x0000000008d2bc72 clang::ASTFrontendAction::ExecuteAction()
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/Frontend/FrontendAction.cpp:1044:1
#22 0x0000000008ed51cc clang::CodeGenAction::ExecuteAction()
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CodeGenAction.cpp:1089:1
#23 0x0000000008d2b621 clang::FrontendAction::Execute()
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/Frontend/FrontendAction.cpp:939:7
#24 0x0000000008c59591
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/Frontend/CompilerInstance.cpp:964:23
#25 0x0000000008ebf66f
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:29
0:8
#26 0x000000000514b78e cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/ssd2/pirama/llvm-monorepo/monorepo/clang/tools/driver/cc1_main.cpp:250:13
#27 0x000000000513f49f ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/ssd2/pirama/llvm-monorepo/monorepo/clang/tools/driver/driver.cpp:309:5
#28 0x000000000513e832 main
/ssd2/pirama/llvm-monorepo/monorepo/clang/tools/driver/driver.cpp:382:5
#29 0x00007fc10211d52b __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2352b)
#30 0x000000000513e02a _start
(/ssd2/pirama/llvm-monorepo/debug/bin/clang-10+0x513e02a)

-- 
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/20191106/334a77d2/attachment-0001.html>


More information about the llvm-bugs mailing list