Commit 3c223b1b authored by Christoph Mallon's avatar Christoph Mallon
Browse files

be: Panic, if the register constraint, for which a register requirement should...

be: Panic, if the register constraint, for which a register requirement should be generated, does not allow any registers.

This gives a slightly better diagnostic message than failing to allocate a register later on.
parent f39784c7
......@@ -40,6 +40,9 @@ arch_register_req_t const *be_make_register_req(struct obstack *obst, be_asm_con
if (c->all_registers_allowed)
return c->cls->class_req;
if (c->allowed_registers == 0)
panic("constraint does not allow any registers");
arch_register_req_t *const req = (arch_register_req_t*)obstack_alloc(obst, sizeof(*req) + sizeof(unsigned));
unsigned *const limited = (unsigned*)(req + 1);
*limited = c->allowed_registers;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment