From: Bernd Schmidt Date: Mon, 18 Dec 2000 15:21:15 +0000 (+0000) Subject: Backport a fix X-Git-Tag: prereleases/gcc-2.95.3-test1~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f69c613535d7d437af028adeea759109865ee554;p=thirdparty%2Fgcc.git Backport a fix From-SVN: r38352 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c0a6f61ae5f4..09a5fad23217 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2000-12-18 Bernd Schmidt + 2000-09-15 Bernd Schmidt + * optabs.c (emit_libcall_block): If target is a user variable, + copy to a temporary first. + 2000-04-28 Kazu Hirata * h8300.c (function_epilogue): Clean up flags when the last insn in a function is a barrier. diff --git a/gcc/optabs.c b/gcc/optabs.c index 2b9091bcf4e0..bb875ee3cb3f 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -2887,8 +2887,14 @@ emit_libcall_block (insns, target, result, equiv) rtx result; rtx equiv; { + rtx final_dest = target; rtx prev, next, first, 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)) + target = gen_reg_rtx (GET_MODE (target)); + /* look for any CALL_INSNs in this sequence, and attach a REG_EH_REGION reg note to indicate that this call cannot throw. (Unless there is already a REG_EH_REGION note.) */ @@ -2952,6 +2958,9 @@ emit_libcall_block (insns, target, result, equiv) != CODE_FOR_nothing) set_unique_reg_note (last, REG_EQUAL, copy_rtx (equiv)); + if (final_dest != target) + emit_move_insn (final_dest, target); + if (prev == 0) first = get_insns (); else