Hi Jakub, 27ec: 912143ff add sp, sp, #0x850 27f0: 8b2463ff add sp, sp, x4 27f4: 14000000 b 23c8 <_Unwind_RaiseException>
> This does a lot of register saving and restoring, which is not needed but is > not wrong-code (guess separate shrink wrapping would help here if > implemented for the target). The only wrong-code is actually the > add sp, sp, x4 instruction though. The previous instruction restored sp to > the value it had at the start of the function and then we should just tail > call. This instruction is something that is needed in the spot where > __builtin_eh_return is emitted. The issue seems to be that x4 isn't initialized correctly for tailcalls. However doesn't that mean tailcalls will ignore __builtin_eh_return? Or does the midend block any tailcalls that are reachable from __builtin_eh_return? Wilco