aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>2000-04-06 19:43:12 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2000-04-06 20:43:12 +0100
commit9b4f640b5deb54d0634e507267ef429e99934a1c (patch)
tree47938717eaab444e6fd39d61075bf399724ef43c /gcc
parent2f6f4b96518a3e2e911acb32d2ceb48fba761686 (diff)
downloadgcc-9b4f640b5deb54d0634e507267ef429e99934a1c.zip
gcc-9b4f640b5deb54d0634e507267ef429e99934a1c.tar.gz
gcc-9b4f640b5deb54d0634e507267ef429e99934a1c.tar.bz2
* sh.h (STRUCT_VALUE, RETURN_IN_MEMORY): Define.
From-SVN: r32977
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/sh/sh.h20
2 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9d4000f..b4aabb4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+Thu Apr 6 20:39:26 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * sh.h (STRUCT_VALUE, RETURN_IN_MEMORY): Define.
+
Thu Apr 6 19:34:08 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
* config/sh/lib1funcs.asm (___udivsi3_i4):
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 9e1eba2..efeab0a 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -592,7 +592,25 @@ do { \
where the address is passed. If it returns 0, the address is
passed as an "invisible" first argument. */
-/*#define STRUCT_VALUE ((rtx)0)*/
+/* The Hitachi calling convention doesn't quite fit into this scheme since
+ the address is passed like an invisible argument, but one that is always
+ passed in memory. We approximate this by saying where the pointer is;
+ however, this will put any actual arguments that are passed in memory
+ in the wrong place.
+ If we wanted to implement this exactly, we'd need a STRUCT_VALUE of 0,
+ an extra field in CUMULATIVE_ARGS, initialize it in INIT_CUMULATIVE_ARGS,
+ and hack FUNCTION_VALUE / FUNCTION_ARG_ADVANCE to look directly at
+ DECL_RESULT of the current function in conjunction with CUM to determine
+ if the argument in question it is a struct value pointer, and if it is,
+ pass it in memory. */
+#define STRUCT_VALUE \
+ (TARGET_HITACHI \
+ ? gen_rtx_MEM (Pmode, arg_pointer_rtx) \
+ : gen_rtx_REG (Pmode, STRUCT_VALUE_REGNUM))
+
+#define RETURN_IN_MEMORY(TYPE) \
+ (TYPE_MODE (TYPE) == BLKmode \
+ || TARGET_HITACHI && TREE_CODE (TYPE) == RECORD_TYPE)
/* Don't default to pcc-struct-return, because we have already specified
exactly how to return structures in the RETURN_IN_MEMORY macro. */