diff options
author | Richard Stallman <rms@gnu.org> | 1993-03-06 00:48:19 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-03-06 00:48:19 +0000 |
commit | 86d38d25ba2f6583291319bae57481a75aed48bd (patch) | |
tree | 7563129dc93fc94c803da35bd194156fcc63d504 | |
parent | 9cea6503647587279c871fd4dfa1878efaebf596 (diff) | |
download | gcc-86d38d25ba2f6583291319bae57481a75aed48bd.zip gcc-86d38d25ba2f6583291319bae57481a75aed48bd.tar.gz gcc-86d38d25ba2f6583291319bae57481a75aed48bd.tar.bz2 |
(expand_assignment): Special handling for storing in RESULT_DECL.
From-SVN: r3663
-rw-r--r-- | gcc/expr.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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. */ |