[llvm-bugs] [Bug 48867] New: regcall related fatal error when targeting msvc abi

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 24 17:14:00 PST 2021


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

            Bug ID: 48867
           Summary: regcall related fatal error when targeting msvc abi
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mizvekov at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

This one liner is enough to cause a fatal error during codegen:

´´´
[[gnu::regcall]] void a() { int b; }
´´´

Both 11 and trunk, when compiling with ´clang --target=x86_64-w64-windows-msvc
-c test.cc´

Workspace for convenience: https://godbolt.org/z/aMdG6e

This is printed:

´´´
fatal error: error in backend: stack allocation size is not a multiple of 8
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang-11 --target=x86_64-w64-windows-msvc -c test.cc
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'test.cc'.
4.      Running pass 'X86 Assembly Printer' on function '@"?a@@YwXXZ"'
 #0 0x00007f3dff92af8f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbd0f8f)
 #1 0x00007f3dff9292f0 llvm::sys::RunSignalHandlers()
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbcf2f0)
 #2 0x00007f3dff92a6dd llvm::sys::CleanupOnSignal(unsigned long)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbd06dd)
 #3 0x00007f3dff86ec4a (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xb14c4a)
 #4 0x00007f3dff86ebeb (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xb14beb)
 #5 0x00007f3dff925dbe (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbcbdbe)
 #6 0x00000000004134f2 (/usr/lib/llvm-11/bin/clang+0x4134f2)
 #7 0x00007f3dff87acaf llvm::report_fatal_error(llvm::Twine const&, bool)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xb20caf)
 #8 0x00007f3e009ddbc6 (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0x1c83bc6)
 #9 0x00007f3e00a072d9 llvm::MCStreamer::EmitWinCFIAllocStack(unsigned int,
llvm::SMLoc) (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0x1cad2d9)
#10 0x00007f3e01a824f1 (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0x2d284f1)
#11 0x00007f3dfffe4b91 llvm::AsmPrinter::emitFunctionBody()
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0x128ab91)
#12 0x00007f3e018bc126 (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0x2b62126)
#13 0x00007f3dffbfe1ae
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xea41ae)
#14 0x00007f3dffa3a059 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xce0059)
#15 0x00007f3dffa3f603 llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xce5603)
#16 0x00007f3dffa3a670 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xce0670)
#17 0x00007f3e054a76e6 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x164f6e6)
#18 0x00007f3e057649f6 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x190c9f6)
#19 0x00007f3e0482f763 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x9d7763)
#20 0x00007f3e05dfb0c8 clang::FrontendAction::Execute()
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1fa30c8)
#21 0x00007f3e05db1641
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1f59641)
#22 0x00007f3e05e61200
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x2009200)
#23 0x00000000004131bf cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib/llvm-11/bin/clang+0x4131bf)
#24 0x00000000004115fe (/usr/lib/llvm-11/bin/clang+0x4115fe)
#25 0x00007f3e05ae4732 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1c8c732)
#26 0x00007f3dff86ebcd
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xb14bcd)
#27 0x00007f3e05ae3c5f
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1c8bc5f)
#28 0x00007f3e05abba7f
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1c63a7f)
#29 0x00007f3e05abbc27
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1c63c27)
#30 0x00007f3e05acf78c
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/usr/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1c7778c)
#31 0x00000000004110a3 main (/usr/lib/llvm-11/bin/clang+0x4110a3)
#32 0x00007f3dfe88ed0a __libc_start_main ./csu/../csu/libc-start.c:308:16
´´´

-- 
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/20210125/c92bec8e/attachment.html>


More information about the llvm-bugs mailing list