[llvm-bugs] [Bug 35157] New: Crash in ARM backend for VST1d64TPseudoWB_fixed instruction

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 31 21:34:39 PDT 2017


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

            Bug ID: 35157
           Summary: Crash in ARM backend for VST1d64TPseudoWB_fixed
                    instruction
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: ARM
          Assignee: unassignedbugs at nondot.org
          Reporter: srhines at google.com
                CC: chh at google.com, kongy.dev at gmail.com,
                    kristof.beyls at arm.com, llozano at chromium.org,
                    llvm-bugs at lists.llvm.org, pirama at google.com

Created attachment 19367
  --> https://bugs.llvm.org/attachment.cgi?id=19367&action=edit
preprocessed input file that crashes in ARM backend

To reproduce, just use TOT:
$ clang -target arm-linux-androideabi -mcpu=cortex-a7 -c ref_vldX.i

This results in an assertion failure where there is a mismatch between the
number of operands used for the VST1d64TPseudoWB_fixed instruction (6 vs. 7). I
was able to narrow it down to this using gdb, but I don't really know this part
of the ARM backend well enough to spot/fix the error (and/or write a smaller
test for it). The crash is as follows:

clang-6.0: /a/llvm/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp:802: void
llvm::InstrEmitter::EmitMachineNode(llvm::SDNode*, bool, bool,
llvm::DenseMap<llvm::SDValue, unsigned int>&): Assertion `NumMIOperands >=
II.getNumOperands() && NumMIOperands <= II.getNumOperands() +
II.getNumImplicitDefs() + NumImpUses && "#operands for dag node doesn't match
.td file!"' failed.
#0 0x0000000003fffeb3 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/a/llvm/llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x0000000003ffff44 PrintStackTraceSignalHandler(void*)
/a/llvm/llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x0000000003ffe356 llvm::sys::RunSignalHandlers()
/a/llvm/llvm/lib/Support/Signals.cpp:49:0
#3 0x0000000003fff84a SignalHandler(int)
/a/llvm/llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007fd547ef2330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#5 0x00007fd546ceac37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#6 0x00007fd546cee028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#7 0x00007fd546ce3bf6 __assert_fail_base
/build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0
#8 0x00007fd546ce3ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#9 0x0000000004d7f560 llvm::InstrEmitter::EmitMachineNode(llvm::SDNode*, bool,
bool, llvm::DenseMap<llvm::SDValue, unsigned int,
llvm::DenseMapInfo<llvm::SDValue>, llvm::detail::DenseMapPair<llvm::SDValue,
unsigned int> >&) /a/llvm/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp:806:0
#10 0x0000000004d7543b llvm::InstrEmitter::EmitNode(llvm::SDNode*, bool, bool,
llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo<llvm::SDValue>,
llvm::detail::D
enseMapPair<llvm::SDValue, unsigned int> >&)
/a/llvm/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.h:121:0
#11 0x0000000004d73705
llvm::ScheduleDAGSDNodes::EmitSchedule(llvm::MachineInstrBundleIterator<llvm::MachineInstr,
false>&) /a/llvm/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG
SDNodes.cpp:848:0
#12 0x0000000004ce1702 llvm::SelectionDAGISel::CodeGenAndEmitDAG()
/a/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:880:0
#13 0x0000000004cdfc54
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
true, false, void>, false, true>, ll
vm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true,
false, void>, false, true>, bool&)
/a/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:66
5:0
#14 0x0000000004ce5329
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
/a/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1610:0
#15 0x0000000004cde8de
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
/a/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:467:0
#16 0x000000000265c5b4 (anonymous
namespace)::ARMDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
/a/llvm/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:71:0
#17 0x00000000034b173d
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/a/llvm/llvm/lib/CodeGen/MachineFunctionPass.cpp:62:0
#18 0x00000000038fc674 llvm::FPPassManager::runOnFunction(llvm::Function&)
/a/llvm/llvm/lib/IR/LegacyPassManager.cpp:1514:0
#19 0x00000000038fc807 llvm::FPPassManager::runOnModule(llvm::Module&)
/a/llvm/llvm/lib/IR/LegacyPassManager.cpp:1535:0
#20 0x00000000038fcba2 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/a/llvm/llvm/lib/IR/LegacyPassManager.cpp:1591:0
#21 0x00000000038fd2f2 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/a/llvm/llvm/lib/IR/LegacyPassManager.cpp:1694:0
#22 0x00000000038fd533 llvm::legacy::PassManager::run(llvm::Module&)
/a/llvm/llvm/lib/IR/LegacyPassManager.cpp:1726:0
#23 0x000000000429e13c (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_p
write_stream> >) /a/llvm/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:794:0
#24 0x00000000042a08b2 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> >)
 /a/llvm/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:1145:0
#25 0x0000000004dbd85e
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/a/llvm/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:294:0
#26 0x0000000005a53e91 clang::ParseAST(clang::Sema&, bool, bool)
/a/llvm/llvm/tools/clang/lib/Parse/ParseAST.cpp:161:0
#27 0x00000000048e0bfe clang::ASTFrontendAction::ExecuteAction()
/a/llvm/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1000:0
#28 0x0000000004dbb91c clang::CodeGenAction::ExecuteAction()
/a/llvm/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1032:0
#29 0x00000000048e066f clang::FrontendAction::Execute()
/a/llvm/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:901:0
#30 0x0000000004882adf
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/a/llvm/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#31 0x0000000004a18d3a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/a/llvm/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#32 0x00000000020392d9 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /a/llvm/llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#33 0x000000000202eea9 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) /a/llvm/llvm/tools/clang/tools/driver/driver.cpp:309:0
#34 0x000000000202fb91 main
/a/llvm/llvm/tools/clang/tools/driver/driver.cpp:388:0
#35 0x00007fd546cd5f45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#36 0x000000000202c719 _start (/a/llvm/new_llvm_build/bin/clang-6.0+0x202c719)
Stack dump:
0.      Program arguments: /a/llvm/new_llvm_build/bin/clang-6.0 -cc1 -triple
armv7--linux-android -emit-obj -mrelax-all -disable-free -main-file-name
ref_vldX.i -mrelocation
-model pic -pic-level 1 -mthread-model posix -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu cortex-a7
-target-feature +soft-
float-abi -target-feature -crc -target-feature +dsp -target-feature -ras
-target-feature -dotprod -target-feature +hwdiv-arm -target-feature +hwdiv
-target-abi aapcs-linux -
mfloat-abi soft -fallow-half-arguments-and-returns -dwarf-column-info
-debugger-tuning=gdb -coverage-notes-file /c/android_trees/master/ref_vldX.gcno
-resource-dir /a/llvm/new_llvm_build/lib/clang/6.0.0 -fdebug-compilation-dir
/c/android_trees/master -ferror-limit 19 -fmessage-length 173 -femulated-tls
-fno-signed-char -fobjc-runtime=gcc -fdiag
nostics-show-option -fcolor-diagnostics -o ref_vldX.o -x cpp-output ref_vldX.i 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module
'external/arm-neon-tests/ref_vldX.c'.
4.      Running pass 'ARM Instruction Selection' on function '@exec_vldX'
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 317035) (llvm/trunk 317042)
Target: arm--linux-android
Thread model: posix
InstalledDir: /a/llvm/new_llvm_build/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.0: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.


When it crashes in gdb, I can inspect some of the relevant variables variables:

II is:
$8 = (const llvm::MCInstrDesc &) @0xbf682e0: {
  Opcode = 2209,
  NumOperands = 6,
  NumDefs = 1 '\001',
  Size = 4 '\004',
  SchedClass = 646,
  Flags = 67305472,
  TSFlags = 65542,
  ImplicitUses = 0x0,
  ImplicitDefs = 0x0,
  OpInfo = 0x79863c0 <_ZN4llvmL14OperandInfo275E>,
  DeprecatedFeature = -1,
  ComplexDeprecationInfo = 0x0
}

The SDNode is as follows:
t16637: i32,ch = <<Unknown Machine Node #63326>><Mem:ST24[%525](align=8)>
t1795, TargetConstant:i32<8>, t23, t16636, TargetConstant:i32<14>, Register:i32
%noreg, t12405

-- 
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/20171101/8f084723/attachment.html>


More information about the llvm-bugs mailing list