summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-03-14 17:31:43 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-03-14 17:31:43 -0500
commitccdecf58a9337645c2cc5e26a0dfb8612b6e3e56 (patch)
tree75a7ab5df60ef4aa221318a0c1c77db56f61082e /gcc/function.c
parentd4c60bd6d656c0f1fcf18ade58607e9b170eb0ef (diff)
downloadgcc-ccdecf58a9337645c2cc5e26a0dfb8612b6e3e56.tar.gz
(assign_parms, expand_function_start): Properly set MEM_IN_STRUCT_P
for DECL_RTL of function result. From-SVN: r6791
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/function.c b/gcc/function.c
index a66e3367831..a266ead2c25 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -3707,8 +3707,19 @@ assign_parms (fndecl, second_time)
/* If this "parameter" was the place where we are receiving the
function's incoming structure pointer, set up the result. */
if (parm == function_result_decl)
- DECL_RTL (DECL_RESULT (fndecl))
- = gen_rtx (MEM, DECL_MODE (DECL_RESULT (fndecl)), DECL_RTL (parm));
+ {
+ tree result = DECL_RESULT (fndecl);
+ tree restype = TREE_TYPE (result);
+
+ DECL_RTL (result)
+ = gen_rtx (MEM, DECL_MODE (result), DECL_RTL (parm));
+
+ MEM_IN_STRUCT_P (DECL_RTL (result))
+ = (TREE_CODE (restype) == RECORD_TYPE
+ || TREE_CODE (restype) == UNION_TYPE
+ || TREE_CODE (restype) == QUAL_UNION_TYPE
+ || TREE_CODE (restype) == ARRAY_TYPE);
+ }
if (TREE_THIS_VOLATILE (parm))
MEM_VOLATILE_P (DECL_RTL (parm)) = 1;
@@ -4889,9 +4900,15 @@ expand_function_start (subr, parms_have_cleanups)
}
}
if (value_address)
- DECL_RTL (DECL_RESULT (subr))
- = gen_rtx (MEM, DECL_MODE (DECL_RESULT (subr)),
- value_address);
+ {
+ DECL_RTL (DECL_RESULT (subr))
+ = gen_rtx (MEM, DECL_MODE (DECL_RESULT (subr)), value_address);
+ MEM_IN_STRUCT_P (DECL_RTL (DECL_RESULT (subr)))
+ = (TREE_CODE (TREE_TYPE (DECL_RESULT (subr))) == RECORD_TYPE
+ || TREE_CODE (TREE_TYPE (DECL_RESULT (subr))) == UNION_TYPE
+ || TREE_CODE (TREE_TYPE (DECL_RESULT (subr))) == QUAL_UNION_TYPE
+ || TREE_CODE (TREE_TYPE (DECL_RESULT (subr))) == ARRAY_TYPE);
+ }
}
else if (DECL_MODE (DECL_RESULT (subr)) == VOIDmode)
/* If return mode is void, this decl rtl should not be used. */