aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2002-12-17 16:29:29 -0500
committerJason Merrill <jason@gcc.gnu.org>2002-12-17 16:29:29 -0500
commit89ea02fbac98156915e26567a21668dd816b4e3a (patch)
tree37b41e3dbf4463f5475171f6696ef200af12ca08 /gcc
parente489a31f89b0a7570f518ab963a2e9706f6761c0 (diff)
downloadgcc-89ea02fbac98156915e26567a21668dd816b4e3a.zip
gcc-89ea02fbac98156915e26567a21668dd816b4e3a.tar.gz
gcc-89ea02fbac98156915e26567a21668dd816b4e3a.tar.bz2
calls.c (expand_call): Handle CALL_EXPR_HAS_RETURN_SLOT_ADDR with special struct-return ABIs.
* calls.c (expand_call): Handle CALL_EXPR_HAS_RETURN_SLOT_ADDR with special struct-return ABIs. cp/ * semantics.c (simplify_aggr_init_exprs_r): Don't change the type of the CALL_EXPR. From-SVN: r60223
Diffstat (limited to 'gcc')
-rw-r--r--gcc/calls.c16
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/semantics.c11
3 files changed, 20 insertions, 10 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 4d6cdd7..09398e8 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -2248,8 +2248,20 @@ expand_call (exp, target, ignore)
struct_value_size = int_size_in_bytes (TREE_TYPE (exp));
if (CALL_EXPR_HAS_RETURN_SLOT_ADDR (exp))
- /* The structure value address arg is already in actparms. */
- structure_value_addr_parm = 1;
+ {
+ /* The structure value address arg is already in actparms. */
+ if (struct_value_rtx == 0)
+ /* We want to pass it as a normal argument, so leave it. */
+ structure_value_addr_parm = 1;
+ else
+ {
+ /* We want to pass it in a special location. */
+ tree return_arg = TREE_VALUE (actparms);
+ actparms = TREE_CHAIN (actparms);
+ structure_value_addr = expand_expr (return_arg, struct_value_rtx,
+ VOIDmode, EXPAND_NORMAL);
+ }
+ }
else if (target && GET_CODE (target) == MEM)
structure_value_addr = XEXP (target, 0);
else
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a1b5038..1e50ff9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2002-12-16 Jason Merrill <jason@redhat.com>
+ * semantics.c (simplify_aggr_init_exprs_r): Don't change the type
+ of the CALL_EXPR.
+
* semantics.c (do_pushlevel): Call pushlevel after adding the
SCOPE_STMT.
(do_poplevel): Call poplevel before adding the SCOPE_STMT.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 763916a..e402a72 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2250,14 +2250,9 @@ simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
TREE_SIDE_EFFECTS (call_expr) = 1;
if (style == arg)
- {
- /* Tell the backend that we've added our return slot to the argument
- list. */
- CALL_EXPR_HAS_RETURN_SLOT_ADDR (call_expr) = 1;
- /* And don't let anyone use the value of the call directly in a
- larger expression. */
- TREE_TYPE (call_expr) = void_type_node;
- }
+ /* Tell the backend that we've added our return slot to the argument
+ list. */
+ CALL_EXPR_HAS_RETURN_SLOT_ADDR (call_expr) = 1;
else if (style == pcc)
{
/* If we're using the non-reentrant PCC calling convention, then we