summaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorcrux <crux@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-15 15:35:03 +0000
committercrux <crux@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-15 15:35:03 +0000
commit08852b5fd2084d6ca38f5cced0a21cee64d059e9 (patch)
treec85b3d299188bdcde03c7dc4b888789f679aa2e9 /gcc/optabs.c
parent83d86adad08e431d0a361ca5719b6dc0af442173 (diff)
downloadgcc-08852b5fd2084d6ca38f5cced0a21cee64d059e9.tar.gz
Avoid copying libcall results directly to user variables.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36433 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index f35300b04b4..136f17897ab 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -2756,8 +2756,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 or execute a nonlocal
goto. (Unless there is already a REG_EH_REGION note, in which case
@@ -2833,6 +2839,8 @@ emit_libcall_block (insns, target, result, equiv)
remove_note (last, find_reg_note (last, REG_EQUAL, NULL_RTX));
}
+ emit_move_insn (final_dest, target);
+
if (prev == 0)
first = get_insns ();
else