<div dir="ltr"><div dir="ltr">On Thu, Oct 21, 2021 at 8:49 AM stan li <<a href="mailto:python3kgae@outlook.com">python3kgae@outlook.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="gmail-m_8712917621872849428WordSection1">
<p class="MsoNormal">Hi Alex,</p>
<p class="MsoNormal">I tried compile your repro on Windows with</p>
<p class="MsoNormal">clang -S</p>
<p class="MsoNormal">But it didn’t crash.</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Could you share the command line and environment to repro the crash?</p></div></div></blockquote><div><br></div><div>I'm seeing the crash on linux on x86 with just `clang q.cc`. However, on other platforms one may need cc1 arguments. The important ones seem to be:</div><div>$ clang++ -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mconstructor-aliases q.cc<br>PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash backtrace, preprocessed source, and associated run script.<br>Stack dump:<br>0. Program arguments: clang++ -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mconstructor-aliases q.cc<br>1. <eof> parser at end of file<br>2. Optimizer<br> #0 0x0000000004d910ec llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /usr/local/google/home/alexfh/work/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:11<br> #1 0x0000000004d912bb PrintStackTraceSignalHandler(void*) /usr/local/google/home/alexfh/work/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:1<br> #2 0x0000000004d8f826 llvm::sys::RunSignalHandlers() /usr/local/google/home/alexfh/work/llvm-project/llvm/lib/Support/Signals.cpp:96:5<br> #3 0x0000000004d91a47 SignalHandler(int) /usr/local/google/home/alexfh/work/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1<br> #4 0x00007f76f967d8e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x138e0)<br> #5 0x00000000014c09dc llvm::Value::getValueID() const /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/IR/Value.h:533:12<br> #6 0x00000000014c0be5 llvm::isa_impl<llvm::Constant, llvm::Value, void>::doit(llvm::Value const&) /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/IR/Value.h:952:29<br> #7 0x00000000014c0bc5 llvm::isa_impl_cl<llvm::Constant, llvm::Value const*>::doit(llvm::Value const*) /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/Support/Casting.h:105:5<br> #8 0x00000000014c0b28 llvm::isa_impl_wrap<llvm::Constant, llvm::Value const*, llvm::Value const*>::doit(llvm::Value const* const&) /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/Support/Ca<br>sting.h:131:5<br> #9 0x00000000014c0b02 llvm::isa_impl_wrap<llvm::Constant, llvm::Value* const, llvm::Value const*>::doit(llvm::Value* const&) /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/Support/Casting.<br>h:121:5<br>#10 0x00000000014c0ab5 bool llvm::isa<llvm::Constant, llvm::Value*>(llvm::Value* const&) /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/Support/Casting.h:142:3<br>#11 0x00000000014c0a15 llvm::cast_retty<llvm::Constant, llvm::Value*>::ret_type llvm::cast<llvm::Constant, llvm::Value>(llvm::Value*) /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/Support/<br>Casting.h:0:3<br>#12 0x0000000003494a39 llvm::LazyCallGraph::visitReferences(llvm::SmallVectorImpl<llvm::Constant*>&, llvm::SmallPtrSetImpl<llvm::Constant*>&, llvm::function_ref<void (llvm::Function&)>) /usr/local/google/home<br>/alexfh/work/llvm-project/llvm/lib/Analysis/LazyCallGraph.cpp:2000:19<br>#13 0x00000000034952c4 llvm::LazyCallGraph::LazyCallGraph(llvm::Module&, llvm::function_ref<llvm::TargetLibraryInfo& (llvm::Function&)>) /usr/local/google/home/alexfh/work/llvm-project/llvm/lib/Analysis/LazyC<br>allGraph.cpp:208:1<br>#14 0x0000000006a03ed9 llvm::LazyCallGraphAnalysis::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/Analysis/LazyCallGraph.h:1257:12<br>#15 0x0000000006a03d58 llvm::detail::AnalysisPassModel<llvm::Module, llvm::LazyCallGraphAnalysis, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>::Invalidator>::run(llvm::Module&, llvm::AnalysisM<br>anager<llvm::Module>&) /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:323:12<br>#16 0x000000000412519b llvm::AnalysisManager<llvm::Module>::getResultImpl(llvm::AnalysisKey*, llvm::Module&) /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/IR/PassManagerImpl.h:73:35<br>#17 0x00000000033b8c43 llvm::LazyCallGraphAnalysis::Result& llvm::AnalysisManager<llvm::Module>::getResult<llvm::LazyCallGraphAnalysis>(llvm::Module&) /usr/local/google/home/alexfh/work/llvm-project/llvm/incl<br>ude/llvm/IR/PassManager.h:786:21<br>#18 0x00000000033adc08 llvm::InnerAnalysisManagerProxy<llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::Module>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /usr/local<br>/google/home/alexfh/work/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp:673:30<br>#19 0x0000000006a73537 llvm::detail::AnalysisPassModel<llvm::Module, llvm::InnerAnalysisManagerProxy<llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::Module>, llvm::PreservedAnalys<br>es, llvm::AnalysisManager<llvm::Module>::Invalidator>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:324:1<br>4<br>#20 0x000000000412519b llvm::AnalysisManager<llvm::Module>::getResultImpl(llvm::AnalysisKey*, llvm::Module&) /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/IR/PassManagerImpl.h:73:35<br>#21 0x00000000033b8b73 llvm::InnerAnalysisManagerProxy<llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::Module>::Result& llvm::AnalysisManager<llvm::Module>::getResult<llvm::InnerA<br>nalysisManagerProxy<llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::Module> >(llvm::Module&) /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/IR/PassManager.h:786<br>:21<br>#22 0x00000000033ab373 llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /usr/local/google/home/alexfh/work/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp:<br>144:56<br>#23 0x0000000004302e9b llvm::detail::PassModel<llvm::Module, llvm::ModuleToPostOrderCGSCCPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<l<br>lvm::Module>&) /usr/local/google/home/alexfh/work/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:88:17<br>#24 0x0000000004121eab llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /usr/local/google/home/alexfh/work/llvm-project/llvm/incl<br>ude/llvm/IR/PassManager.h:525:16<br>#25 0x0000000005260440 (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >&, std::u<br>nique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile> >&) /usr/local/google/home/alexfh/work/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1473:3<br>#26 0x00000000052587d9 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) /usr/local/google/<br>home/alexfh/work/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1536:22<br>#27 0x0000000005256f48 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::String<br>Ref, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) /usr/local/google/home/alexfh/work/llvm-project/clang/lib/CodeGen/BackendUtil<br>.cpp:1697:5<br>#28 0x00000000068d0c7f clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) /usr/local/google/home/alexfh/work/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:370:7<br>#29 0x0000000008738c0c clang::ParseAST(clang::Sema&, bool, bool) /usr/local/google/home/alexfh/work/llvm-project/clang/lib/Parse/ParseAST.cpp:178:12<br>#30 0x0000000005d50ba2 clang::ASTFrontendAction::ExecuteAction() /usr/local/google/home/alexfh/work/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1071:1<br>#31 0x00000000068cc319 clang::CodeGenAction::ExecuteAction() /usr/local/google/home/alexfh/work/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1108:5<br>#32 0x0000000005d50551 clang::FrontendAction::Execute() /usr/local/google/home/alexfh/work/llvm-project/clang/lib/Frontend/FrontendAction.cpp:966:7<br>#33 0x0000000005c8468a clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /usr/local/google/home/alexfh/work/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:1030:23<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US" style="overflow-wrap: break-word;"><div class="gmail-m_8712917621872849428WordSection1">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks</p>
<p class="MsoNormal">Xiang</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986" target="_blank">
Mail</a> for Windows</p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_8712917621872849428divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Alexander Kornienko via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>><br>
<b>Sent:</b> Wednesday, October 20, 2021 4:10:42 PM<br>
<b>To:</b> <a href="mailto:python3kgae@outlook.com" target="_blank">python3kgae@outlook.com</a> <<a href="mailto:python3kgae@outlook.com" target="_blank">python3kgae@outlook.com</a>>; <a href="mailto:mizvekov@gmail.com" target="_blank">mizvekov@gmail.com</a> <<a href="mailto:mizvekov@gmail.com" target="_blank">mizvekov@gmail.com</a>>; <a href="mailto:blitzrakete@gmail.com" target="_blank">blitzrakete@gmail.com</a> <<a href="mailto:blitzrakete@gmail.com" target="_blank">blitzrakete@gmail.com</a>>; <a href="mailto:notstina@gmail.com" target="_blank">notstina@gmail.com</a> <<a href="mailto:notstina@gmail.com" target="_blank">notstina@gmail.com</a>>; <a href="mailto:shenhan@google.com" target="_blank">shenhan@google.com</a> <<a href="mailto:shenhan@google.com" target="_blank">shenhan@google.com</a>>; <a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a> <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>>;
<a href="mailto:bhuvanendra.kumarn@amd.com" target="_blank">bhuvanendra.kumarn@amd.com</a> <<a href="mailto:bhuvanendra.kumarn@amd.com" target="_blank">bhuvanendra.kumarn@amd.com</a>>; <a href="mailto:mlekena@skidmore.edu" target="_blank">mlekena@skidmore.edu</a> <<a href="mailto:mlekena@skidmore.edu" target="_blank">mlekena@skidmore.edu</a>>; <a href="mailto:jlerouge@apple.com" target="_blank">jlerouge@apple.com</a> <<a href="mailto:jlerouge@apple.com" target="_blank">jlerouge@apple.com</a>>; <a href="mailto:chris.bieneman@me.com" target="_blank">chris.bieneman@me.com</a> <<a href="mailto:chris.bieneman@me.com" target="_blank">chris.bieneman@me.com</a>>; <a href="mailto:aaron.ballman@gmail.com" target="_blank">aaron.ballman@gmail.com</a> <<a href="mailto:aaron.ballman@gmail.com" target="_blank">aaron.ballman@gmail.com</a>><br>
<b>Cc:</b> <a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a> <<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>>; <a href="mailto:ndesaulniers@google.com" target="_blank">ndesaulniers@google.com</a> <<a href="mailto:ndesaulniers@google.com" target="_blank">ndesaulniers@google.com</a>>; <a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a> <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>>; <a href="mailto:david.green@arm.com" target="_blank">david.green@arm.com</a> <<a href="mailto:david.green@arm.com" target="_blank">david.green@arm.com</a>>; <a href="mailto:ruiling.song@amd.com" target="_blank">ruiling.song@amd.com</a> <<a href="mailto:ruiling.song@amd.com" target="_blank">ruiling.song@amd.com</a>><br>
<b>Subject:</b> [PATCH] D111109: AddGlobalAnnotations for function with or without function body.</font>
<div> </div>
</div>
<div><font size="2"><span style="font-size:11pt">
<div>alexfh added a comment.<br>
<br>
Reduced the test further to:<br>
<br>
struct k {<br>
~k() __attribute__((annotate(""))) {}<br>
};<br>
void m() { k(); }<br>
<br>
<br>
Repository:<br>
rG LLVM Github Monorepo<br>
<br>
CHANGES SINCE LAST ACTION<br>
<a href="https://reviews.llvm.org/D111109/new/" target="_blank">https://reviews.llvm.org/D111109/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D111109" target="_blank">https://reviews.llvm.org/D111109</a><br>
<br>
</div>
</span></font></div>
</div>
</blockquote></div></div>