Compiling with -Oz enable an optimisation, where the compiler tries to fold an update to SP by adding extra registers to existing push/pop instructions. This doesn't interact correctly with ARMAsmPrinter::EmitUnwindingInstruction - the generated unwind information causes the extra registers to be restored when an exception is propagated through the function, but the corresponding stack slots can be already clobbered.
When adding these registers to a push, the register operands are marked as "undef". This patch modifies ARMAsmPrinter::EmitUnwindingInstruction to examine the register operand flags and not mention in the .save the registers, which
have this flag set.