]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport a fix
authorBernd Schmidt <bernds@redhat.co.uk>
Mon, 18 Dec 2000 15:21:15 +0000 (15:21 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Mon, 18 Dec 2000 15:21:15 +0000 (15:21 +0000)
From-SVN: r38352

gcc/ChangeLog
gcc/optabs.c

index c0a6f61ae5f42b0830f4e9c553d37bdd0215b802..09a5fad232179e2163cf450ef25bbfd50586ed8a 100644 (file)
@@ -1,5 +1,9 @@
 2000-12-18  Bernd Schmidt  <bernds@redhat.co.uk>
 
+       2000-09-15  Bernd Schmidt  <bernds@redhat.co.uk>
+       * optabs.c (emit_libcall_block): If target is a user variable,
+       copy to a temporary first.
+
        2000-04-28  Kazu Hirata  <kazu@hxi.com>
        * h8300.c (function_epilogue): Clean up flags when the last insn
        in a function is a barrier.
index 2b9091bcf4e05c0f59aa876dd8db646f7310a484..bb875ee3cb3f811b585ded247dfa1c106ff7d66e 100644 (file)
@@ -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