aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meissner <meissner@gcc.gnu.org>1992-09-22 16:20:16 +0000
committerMichael Meissner <meissner@gcc.gnu.org>1992-09-22 16:20:16 +0000
commit6cb6c3b358c4a78eb9351f3b8eea1a7ffea42248 (patch)
tree26eb0c42e0640649850324429692c3e05b79dc02
parent372e033b8f9c7b7f5f38313a8638570908b90b1f (diff)
downloadgcc-6cb6c3b358c4a78eb9351f3b8eea1a7ffea42248.zip
gcc-6cb6c3b358c4a78eb9351f3b8eea1a7ffea42248.tar.gz
gcc-6cb6c3b358c4a78eb9351f3b8eea1a7ffea42248.tar.bz2
Fix varardic function returning a structure or union.
From-SVN: r2205
-rw-r--r--gcc/config/mips/mips.c14
-rw-r--r--gcc/config/mips/mips.h21
2 files changed, 25 insertions, 10 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 6cb808b..7936bc2 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -2400,7 +2400,19 @@ init_cumulative_args (cum, fntype, libname)
tree param, next_param;
if (TARGET_DEBUG_E_MODE)
- fprintf (stderr, "\ninit_cumulative_args\n");
+ {
+ fprintf (stderr, "\ninit_cumulative_args, fntype = 0x%.8lx", (long)fntype);
+ if (!fntype)
+ fputc ('\n', stderr);
+
+ else
+ {
+ tree ret_type = TREE_TYPE (fntype);
+ fprintf (stderr, ", fntype code = %s, ret code = %s\n",
+ tree_code_name[ (int)TREE_CODE (fntype) ],
+ tree_code_name[ (int)TREE_CODE (ret_type) ]);
+ }
+ }
cum->gp_reg_found = 0;
cum->arg_number = 0;
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index f7df3a0..12f581c 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -473,7 +473,7 @@ while (0)
/* Print subsidiary information on the compiler version in use. */
-#define MIPS_VERSION "[AL 1.1, MM 25]"
+#define MIPS_VERSION "[AL 1.1, MM 26]"
#ifndef MACHINE_TYPE
#define MACHINE_TYPE "BSD Mips"
@@ -1623,16 +1623,19 @@ extern struct mips_frame_info current_frame_info;
`ACCUMULATE_OUTGOING_ARGS'. */
#define ACCUMULATE_OUTGOING_ARGS
-/* Offset of first parameter from the argument pointer register value. */
-#define FIRST_PARM_OFFSET(FNDECL) 0
+/* Offset from the argument pointer register to the first argument's
+ address. On some machines it may depend on the data type of the
+ function.
-/* Offset from top-of-stack address to location to store the
- function parameter if it can't go in a register.
- Addresses for following parameters are computed relative to this one.
+ If `ARGS_GROW_DOWNWARD', this is the offset to the location above
+ the first argument's address. */
- It also has the effect of counting register arguments in the total
- argument size. */
-#define FIRST_PARM_CALLER_OFFSET(FNDECL) 0
+#define FIRST_PARM_OFFSET(FNDECL) \
+ (FNDECL != 0 \
+ && TREE_TYPE (FNDECL) != 0 \
+ && TREE_TYPE (TREE_TYPE (FNDECL)) != 0 \
+ && (TREE_CODE (TREE_TYPE (TREE_TYPE (FNDECL))) == RECORD_TYPE \
+ || TREE_CODE (TREE_TYPE (TREE_TYPE (FNDECL))) == UNION_TYPE) ? 4 : 0)
/* When a parameter is passed in a register, stack space is still
allocated for it. For the MIPS, stack space must be allocated, cf