<div dir="ltr">Attached is a patch which makes PEI::calculateCalleeSavedRegisters save/restore all callee saved registers (even those which are not used) in functions which call __builtin_unwind_init().<div>__builtin_unwind_init() is an undocumented gcc intrinsic which has this effect, and is used in libgcc_eh.</div>
<div><br></div><div>This should fix PR8541.</div><div><br></div><div>I say "should" because I haven't yet investigated all the relevant details of __builtin_eh_return, but it does fix some problems that we have seen which are similar to that described in the bug.</div>
</div>