Skip to content

[AArch64][MC] Error "Implement any new match types added!" with invalid SME2 ZIP instruction #90589

Closed
@ostannard

Description

@ostannard

This invalid SME2 instruction causes an UNREACHABLE crash in the AArch64 assembly parser:

$ echo "zip {z1.q-z2.q}, z0.q, z0.q" | /work/llvm/build/bin/llvm-mc --triple aarch64 -mattr=+sme2
        .text
Implement any new match types added!
UNREACHABLE executed at /work/llvm/llvm-project/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp:6767!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /work/llvm/build/bin/llvm-mc --triple aarch64 -mattr=+sme2
 #0 0x000055a08a559aa7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/work/llvm/build/bin/llvm-mc+0xe05aa7)
 #1 0x000055a08a5577be llvm::sys::RunSignalHandlers() (/work/llvm/build/bin/llvm-mc+0xe037be)
 #2 0x000055a08a55a3fa SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f45f4a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007f45f4a969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007f45f4a969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007f45f4a969fc pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007f45f4a42476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007f45f4a287f3 abort ./stdlib/abort.c:81:7
 #9 0x000055a08a534601 (/work/llvm/build/bin/llvm-mc+0xde0601)
#10 0x000055a08a334195 (anonymous namespace)::AArch64AsmParser::MatchAndEmitInstruction(llvm::SMLoc, unsigned int&, llvm::SmallVectorImpl<std::unique_ptr<llvm::MCParsedAsmOperand, std::default_delete<llvm::MCParsedAsmOperand>>>&, llvm::MCStreamer&, unsigned long&, bool) AArch64AsmParser.cpp:0:0
#11 0x000055a08a4feb5a (anonymous namespace)::AsmParser::parseAndMatchAndEmitTargetInstruction((anonymous namespace)::ParseStatementInfo&, llvm::StringRef, llvm::AsmToken, llvm::SMLoc) AsmParser.cpp:0:0
#12 0x000055a08a4f1d6f (anonymous namespace)::AsmParser::parseStatement((anonymous namespace)::ParseStatementInfo&, llvm::MCAsmParserSemaCallback*) AsmParser.cpp:0:0
#13 0x000055a08a4ea9e5 (anonymous namespace)::AsmParser::Run(bool, bool) AsmParser.cpp:0:0
#14 0x000055a08a2cc51b AssembleInput(char const*, llvm::Target const*, llvm::SourceMgr&, llvm::MCContext&, llvm::MCStreamer&, llvm::MCAsmInfo&, llvm::MCSubtargetInfo&, llvm::MCInstrInfo&, llvm::MCTargetOptions const&) llvm-mc.cpp:0:0
#15 0x000055a08a2cb2cd main (/work/llvm/build/bin/llvm-mc+0xb772cd)
#16 0x00007f45f4a29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#17 0x00007f45f4a29e40 call_init ./csu/../csu/libc-start.c:128:20
#18 0x00007f45f4a29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#19 0x000055a08a2c6465 _start (/work/llvm/build/bin/llvm-mc+0xb72465)
fish: Process 441908, '/work/llvm/build/bin/llvm-mc' from job 1, 'echo "zip {z1.q-z2.q}, z0.q, z0…' terminated by signal SIGABRT (Abort)

The instruction is invalid because the first register in the curly brackets must be even-numbered, but this should be reported as an error, not a crash.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions