[PATCH] D45962: [MC] Use local MCSubtargetInfo in writeNops

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 01:28:09 PDT 2021


peter.smith added a comment.

In D45962#2988712 <https://reviews.llvm.org/D45962#2988712>, @mstorsjo wrote:

> This broke llvm-ml for assembling real-world files:
>
>   $ bin/llvm-ml -D_M_IA32 -DOMPT_SUPPORT=0 -c -Fo out.obj ../../openmp/runtime/src/z_Windows_NT-586_asm.asm
>   PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
>   Stack dump:
>   0.      Program arguments: bin/llvm-ml -D_M_IA32 -DOMPT_SUPPORT=0 -c -Fo out.obj ../../openmp/runtime/src/z_Windows_NT-586_asm.asm
>    #0 0x000055f22ac9ab1c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/martin/code/llvm-project/llvm/build-debug/../lib/Support/Unix/Signals.inc:565:0
>    #1 0x000055f22ac9abd3 PrintStackTraceSignalHandler(void*) /home/martin/code/llvm-project/llvm/build-debug/../lib/Support/Unix/Signals.inc:632:0
>    #2 0x000055f22ac98887 llvm::sys::RunSignalHandlers() /home/martin/code/llvm-project/llvm/build-debug/../lib/Support/Signals.cpp:97:0
>    #3 0x000055f22ac9a49d SignalHandler(int) /home/martin/code/llvm-project/llvm/build-debug/../lib/Support/Unix/Signals.inc:407:0
>    #4 0x00007f0ff42e3980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
>    #5 0x000055f22a777efc llvm::FeatureBitset::operator[](unsigned int) const /home/martin/code/llvm-project/llvm/build-debug/../include/llvm/MC/SubtargetFeature.h:87:0
>    #6 0x000055f22a920116 (anonymous namespace)::X86AsmBackend::writeNopData(llvm::raw_ostream&, unsigned long, llvm::MCSubtargetInfo const*) const /home/martin/code/llvm-project/llvm/build-debug/../lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp:1145:0
>    #7 0x000055f22a9fb58b writeFragment(llvm::raw_ostream&, llvm::MCAssembler const&, llvm::MCAsmLayout const&, llvm::MCFragment const&) /home/martin/code/llvm-project/llvm/build-debug/../lib/MC/MCAssembler.cpp:548:0
>    #8 0x000055f22a9fc778 llvm::MCAssembler::writeSectionData(llvm::raw_ostream&, llvm::MCSection const*, llvm::MCAsmLayout const&) const /home/martin/code/llvm-project/llvm/build-debug/../lib/MC/MCAssembler.cpp:780:0
>    #9 0x000055f22aad17fd (anonymous namespace)::WinCOFFObjectWriter::writeSectionContents(llvm::MCAssembler&, llvm::MCAsmLayout const&, llvm::MCSection const&) /home/martin/code/llvm-project/llvm/build-debug/../lib/MC/WinCOFFObjectWriter.cpp:614:0
>   #10 0x000055f22aad1965 (anonymous namespace)::WinCOFFObjectWriter::writeSection(llvm::MCAssembler&, llvm::MCAsmLayout const&, (anonymous namespace)::COFFSection const&, llvm::MCSection const&) /home/martin/code/llvm-project/llvm/build-debug/../lib/MC/WinCOFFObjectWriter.cpp:635:0
>   #11 0x000055f22aad4363 (anonymous namespace)::WinCOFFObjectWriter::writeObject(llvm::MCAssembler&, llvm::MCAsmLayout const&) /home/martin/code/llvm-project/llvm/build-debug/../lib/MC/WinCOFFObjectWriter.cpp:1152:0
>   #12 0x000055f22a9fd579 llvm::MCAssembler::Finish() /home/martin/code/llvm-project/llvm/build-debug/../lib/MC/MCAssembler.cpp:937:0
>   #13 0x000055f22aa68b5e llvm::MCObjectStreamer::finishImpl() /home/martin/code/llvm-project/llvm/build-debug/../lib/MC/MCObjectStreamer.cpp:888:0
>   #14 0x000055f22aa9eaca llvm::MCWinCOFFStreamer::finishImpl() /home/martin/code/llvm-project/llvm/build-debug/../lib/MC/MCWinCOFFStreamer.cpp:368:0
>   #15 0x000055f22a916966 (anonymous namespace)::X86WinCOFFStreamer::finishImpl() /home/martin/code/llvm-project/llvm/build-debug/../lib/Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp:65:0
>   #16 0x000055f22aa89d3c llvm::MCStreamer::Finish(llvm::SMLoc) /home/martin/code/llvm-project/llvm/build-debug/../lib/MC/MCStreamer.cpp:1005:0
>   #17 0x000055f22ab53df0 (anonymous namespace)::MasmParser::Run(bool, bool) /home/martin/code/llvm-project/llvm/build-debug/../lib/MC/MCParser/MasmParser.cpp:1435:0
>   #18 0x000055f22a701374 AssembleInput(llvm::StringRef, llvm::Target const*, llvm::SourceMgr&, llvm::MCContext&, llvm::MCStreamer&, llvm::MCAsmInfo&, llvm::MCSubtargetInfo&, llvm::MCInstrInfo&, llvm::MCTargetOptions&, llvm::opt::ArgList const&) /home/martin/code/llvm-project/llvm/build-debug/../tools/llvm-ml/llvm-ml.cpp:186:0
>   #19 0x000055f22a703135 main /home/martin/code/llvm-project/llvm/build-debug/../tools/llvm-ml/llvm-ml.cpp:433:0
>
> @epastor Apparently it would be good with a llvm-ml specific testcase that triggers writing nops.

My apologies, will take a look. If I can spot the problem early I'll fix, otherwise will need to revert as it may be Friday before I can spend a lot of time on it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D45962/new/

https://reviews.llvm.org/D45962



More information about the llvm-commits mailing list