From 86d38d25ba2f6583291319bae57481a75aed48bd Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Sat, 6 Mar 1993 00:48:19 +0000 Subject: [PATCH] (expand_assignment): Special handling for storing in RESULT_DECL. From-SVN: r3663 --- gcc/expr.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gcc/expr.c b/gcc/expr.c index aa98632678d..3ff238ca1c1 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -2765,6 +2765,16 @@ expand_assignment (to, from, want_value, suggest_reg) if (to_rtx == 0) to_rtx = expand_expr (to, NULL_RTX, VOIDmode, 0); + /* Don't move directly into a return register. */ + if (TREE_CODE (to) == RESULT_DECL && GET_CODE (to_rtx) == REG) + { + rtx temp = expand_expr (from, 0, VOIDmode, 0); + emit_move_insn (to_rtx, temp); + preserve_temp_slots (to_rtx); + free_temp_slots (); + return to_rtx; + } + /* In case we are returning the contents of an object which overlaps the place the value is being stored, use a safe function when copying a value through a pointer into a structure value return block. */ -- 2.30.2