+2007-03-07 Richard Henderson <rth@redhat.com>
+
+ PR target/30848
+ * reg-stack.c (emit_swap_insn): If a malformed asm was seen,
+ silently fix up the stack in the case of a missing register.
+
2007-03-07 Paul Brook <paul@codesourcery.com>
* config/arm/libunwind.S: Add .arch/.object_arch for armv4 builds.
hard_regno = get_hard_regnum (regstack, reg);
- gcc_assert (hard_regno >= FIRST_STACK_REG);
if (hard_regno == FIRST_STACK_REG)
return;
+ if (hard_regno == -1)
+ {
+ /* Something failed if the register wasn't on the stack. If we had
+ malformed asms, we zapped the instruction itself, but that didn't
+ produce the same pattern of register sets as before. To prevent
+ further failure, adjust REGSTACK to include REG at TOP. */
+ gcc_assert (any_malformed_asm);
+ regstack->reg[++regstack->top] = REGNO (reg);
+ return;
+ }
+ gcc_assert (hard_regno >= FIRST_STACK_REG);
other_reg = regstack->top - (hard_regno - FIRST_STACK_REG);