https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114843
--- Comment #18 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Wilco from comment #17) > So I don't believe you should change aarch64_pop_regs at all - it's too late > to change things and just adds unnecessary complexity and more bugs. The > best option would be to handle eh_return explicitly and insert the extra > push/pops rather than treating them like a generic callee-save (because > clearly they are not anymore). Thinking about this I think you are right, I will work on an incremental patch to change them to be in seperate array. Note I do have a fix for the issue in comment #17, I had a premature optimization thinking only if regno1 was an eh_handler data register, then regno2 could be one; rather they should be checked independently. I will attach that patch to this bug once my testing is finished. And then will work on splitting out the eh_handler data register load/stores.