Skip to content

aarch64 backend assertion failure during legalization with -mgeneral-regs-only: "Does Vec not start with size 1?" #48169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jwf opened this issue Jan 20, 2021 · 2 comments

Comments

@jwf
Copy link

jwf commented Jan 20, 2021

Bugzilla Link 48825
Version trunk
OS All
CC @aemerson,@Arnaud-de-Grandmaison-ARM,@DougGregor,@jwf,@ornata,@zygoloid,@smeenai,@smithp35

Extended Description

// clang -c boom.c -target aarch64-unknown-linux-gnu -mgeneral-regs-only
#include <stdbool.h>
bool foo(void);
bool boom() {
return foo();
}

Note that if you instead do

#include <stdbool.h>
bool foo(void);
bool boom() {
bool f = foo();
return f;
}

it compiles fine.

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Jan 20, 2021

lib/CodeGen/GlobalISel/LegalizerInfo.cpp:573: static LegalizerInfo::SizeAndAction llvm::LegalizerInfo::findAction(const llvm::LegalizerInfo::SizeAndActionsVec &, const uint32_t): Assertion `It != Vec.begin() && "Does Vec not start with size 1?"' failed.

#​10 0x000000000a0a2bcc llvm::LegalizerInfo::findAction(std::__1::vector<std::__1::pair<unsigned short, llvm::LegalizeActions::LegalizeAction>, std::__1::allocator<std::__1::pair<unsigned short, llvm::LegalizeActions::LegalizeAction> > > const&, unsigned int) lib/CodeGen/GlobalISel/LegalizerInfo.cpp:574:21
#​11 0x000000000a0a17ad llvm::LegalizerInfo::findScalarLegalAction(llvm::InstrAspect const&) const lib/CodeGen/GlobalISel/LegalizerInfo.cpp:644:24
#​12 0x000000000a0a1464 llvm::LegalizerInfo::getAspectAction(llvm::InstrAspect const&) const lib/CodeGen/GlobalISel/LegalizerInfo.cpp:394:12
#​13 0x000000000a0a20fb llvm::LegalizerInfo::getAction(llvm::LegalityQuery const&) const lib/CodeGen/GlobalISel/LegalizerInfo.cpp:473:19
#​14 0x000000000a0a257b llvm::LegalizerInfo::getAction(llvm::MachineInstr const&, llvm::MachineRegisterInfo const&) const lib/CodeGen/GlobalISel/LegalizerInfo.cpp:513:10
#​15 0x000000000a06d7cb llvm::LegalizerHelper::legalizeInstrStep(llvm::MachineInstr&) lib/CodeGen/GlobalISel/LegalizerHelper.cpp:111:18
#​16 0x000000000a063e4c llvm::Legalizer::legalizeMachineFunction(llvm::MachineFunction&, llvm::LegalizerInfo const&, llvm::ArrayRefllvm::GISelChangeObserver*, llvm::LostDebugLocObserver&, llvm::MachineIRBuilder&) lib/CodeGen/GlobalISel/Legalizer.cpp:233:12

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
@Endilll Endilll added llvm:crash crash Prefer [crash-on-valid] or [crash-on-invalid] and removed compile-fail Use [accepts-invalid] and [rejects-valid] instead crash Prefer [crash-on-valid] or [crash-on-invalid] labels Aug 17, 2023
@c-rhodes
Copy link
Collaborator

fixed (since LLVM 13): https://godbolt.org/z/6ajM4Gfoh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants