Richard Sandiford <richard.sandif...@arm.com> writes: > Rather than hiding this in target code, perhaps we should add a > target-independent concept of an "eh_return taken" flag, say > EH_RETURN_TAKEN_RTX. > > We could define it so that, on targets that define EH_RETURN_TAKEN_RTX, > a register EH_RETURN_STACKADJ_RTX and a register EH_RETURN_HANDLER_RTX > are only meaningful when the flag is true. E.g. we could have: > > #ifdef EH_RETURN_HANDLER_RTX
Gah, I meant #ifdef EH_RETURN_TAKEN_RTX here > for (rtx tmp : { EH_RETURN_STACKADJ_RTX, EH_RETURN_HANDLER_RTX }) > if (tmp && REG_P (tmp)) > emit_clobber (tmp); > #endif > > in the "normal return" part of expand_eh_return. (If some other target > wants a flag with different semantics, it'd be up to them to add it.) > > That should avoid most of the bad code-quality effects, since the > specialness of x4-x6 will be confined to the code immediately before > the pre-epilogue exit edges. > > Thanks, > Richard