This patch fixes issue 19905. This solution isn't as clean as I'd
like it to be, but I haven't been able to come up with something that
would be both cleaner and not super invasive.
Another possible fix for this that seems cleaner to me is to have the
x86 spillCalleeSavedRegisters routine emit MOVs and not PUSHes (except
maybe for %rbp, to spare the debugger), with MO_FrameIndex operands.
These MOV instructions could then be peephole-optimized into sequences
of PUSHes and POPs if possible, after the frame indices have been
mapped to actual stack slot offsets. I'm not sure how feasible this
is, though.
You redefined CFA register above to be %rbp. So, not, this is not stack pointer just before the call anymore.
-120 is because the rule here is"take the address from %rbp and add 16 to it". %rbx is 13th register to be pushed, so we have to offset by 13 * -8 - 16 ;)