===================================================================
@@ -3848,9 +3848,13 @@ emit_libcall_block_1 (rtx insns, rtx tar
rtx final_dest = target;
rtx next, last, insn;
- /* If this is a reg with REG_USERVAR_P set, then it could possibly turn
- into a MEM later. Protect the libcall block from this change. */
- if (! REG_P (target) || REG_USERVAR_P (target))
+ /* If this is a parameter with REG_USERVAR_P set, then it could possibly turn
+ into a MEM later (e.g. if a REG_EQUIV note is attached to the insns that
+ sets the reg). Protect the libcall block from this change. */
+ if (! REG_P (target)
+ || (REG_USERVAR_P (target)
+ && REG_EXPR (target) != NULL_TREE
+ && TREE_CODE (REG_EXPR (target)) == PARM_DECL))
target = gen_reg_rtx (GET_MODE (target));
/* If we're using non-call exceptions, a libcall corresponding to an