aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-06-14 21:40:37 +0000
committerRichard Stallman <rms@gnu.org>1993-06-14 21:40:37 +0000
commit3008222343f1160e317ac2528719a855e6b79b88 (patch)
treec56a92464797ff565d349dbc15ae9afc62346b99
parent34f921d8b8d544df586cc45d0c3e72928bddeaaa (diff)
downloadgcc-3008222343f1160e317ac2528719a855e6b79b88.zip
gcc-3008222343f1160e317ac2528719a855e6b79b88.tar.gz
gcc-3008222343f1160e317ac2528719a855e6b79b88.tar.bz2
(expand_call): If PCC_STATIC_STRUCT_RETURN and TARGET
is zero, copy result from static location. From-SVN: r4677
-rw-r--r--gcc/calls.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 4e0e4e2..03dbdfb 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1838,15 +1838,21 @@ expand_call (exp, target, ignore)
{
if (target == 0)
{
- target = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)),
- copy_to_reg (valreg));
- MEM_IN_STRUCT_P (target)
- = (TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == UNION_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == QUAL_UNION_TYPE);
+ /* We used leave the value in the location that it is
+ returned in, but that causes problems if it is used more
+ than once in one expression. Rather than trying to track
+ when a copy is required, we always copy when TARGET is
+ not specified. This calling sequence is only used on
+ a few machines and TARGET is usually nonzero. */
+ if (TYPE_MODE (TREE_TYPE (exp)) == BLKmode)
+ target = assign_stack_temp (BLKmode,
+ int_size_in_bytes (TREE_TYPE (exp)),
+ 1);
+ else
+ target = gen_reg_rtx (TYPE_MODE (TREE_TYPE (exp)));
}
- else if (TYPE_MODE (TREE_TYPE (exp)) != BLKmode)
+
+ if (TYPE_MODE (TREE_TYPE (exp)) != BLKmode)
emit_move_insn (target, gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)),
copy_to_reg (valreg)));
else