[llvm] [IR] Store Metadata attachments in vector (PR #189551)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 14:50:59 PDT 2026


cmtice wrote:

There seems to be some kind of bad interaction between this change and casting with global aliases, which causes compiler crashes.  I have a very simple reproducer here:

$ cat repro.cc
extern "C" void e() {}
void __attribute__((alias("e"))) __cat_op0();
void r() { __cat_op0(); }

$ llvm-project/build/bin/clang -cc1 -triple bpfel -O2 -emit-llvm-bc -Wno-parentheses-equality -Wno-unused-value -debug-info-kind=constructor -o repro.bc repro.cc

ality -Wno-unused-value -debug-info-kind=constructor -o repro.bc repro.cc
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang -cc1 -triple bpfel -O2 -emit-llvm-bc -Wno-parentheses-equality -Wno-unused-value -debug-info-kind=constructor -o repro.bc repro.cc
1.	<eof> parser at end of file
 #0 0x000055b4277d9f58 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x785bf58)
 #1 0x000055b4277d71e5 llvm::sys::RunSignalHandlers() (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x78591e5)
 #2 0x000055b4277dad31 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x000055b4277dabc8 SignalHandlerTerminate(int, siginfo_t*, void*) Signals.cpp:0:0
 #4 0x00007fb389c40a70 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x40a70)
 #5 0x000055b4272883dc llvm::Function::setSubprogram(llvm::DISubprogram*) (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x730a3dc)
 #6 0x000055b427b93cb3 clang::CodeGen::CGDebugInfo::EmitFunctionDecl(clang::GlobalDecl, clang::SourceLocation, clang::QualType, llvm::Function*) (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x7c15cb3)
 #7 0x000055b4297488e8 clang::Sema::ActOnEndOfTranslationUnit() (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x97ca8e8)
 #8 0x000055b429621ae7 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x96a3ae7)
 #9 0x000055b42961701e clang::ParseAST(clang::Sema&, bool, bool) (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x969901e)
#10 0x000055b42847be6d clang::FrontendAction::Execute() (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x84fde6d)
#11 0x000055b4283e44c4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x84664c4)
#12 0x000055b428557429 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x85d9429)
#13 0x000055b425266573 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x52e8573)
#14 0x000055b425262e97 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#15 0x000055b4252620f7 clang_main(int, char**, llvm::ToolContext const&) (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x52e40f7)
#16 0x000055b4252711ed main (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x52f31ed)
#17 0x00007fb389c29f75 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#18 0x00007fb389c2a027 call_init ./csu/../csu/libc-start.c:128:20
#19 0x00007fb389c2a027 __libc_start_main ./csu/../csu/libc-start.c:347:5
#20 0x000055b425260ae1 _start (/usr/local/google3/cmtice/llvm-project.clean/build.opt.r612985/bin/clang+0x52e2ae1)


https://github.com/llvm/llvm-project/pull/189551


More information about the llvm-commits mailing list