https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80080
--- Comment #5 from Dominik Vogt <vogt at linux dot vnet.ibm.com> --- What case do you mean? The + if (oldval != old_reg) + emit_move_insn (old_reg, oldval); at the end should make sure that the oldval-rtx is either not changed by the call, or its value is copied into old_reg at runtime. In both cases, the value of old_reg should be the old value to be returned (as it was hopefully before the patch). Me and Stefan have spent quite some time to proof read this patch; do you see somethings we might have overlooked?