aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/m68k
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-01-29 01:56:28 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2004-01-29 01:56:28 +0000
commit8636be86eab0c475bd896a425cb21b2bac7e9756 (patch)
treea4ef36d1307b6363a5a016cbf9fbe02bcd8c75d0 /gcc/config/m68k
parentf2f61ee79ce0a21f469a7da55575f134effc1548 (diff)
downloadgcc-8636be86eab0c475bd896a425cb21b2bac7e9756.zip
gcc-8636be86eab0c475bd896a425cb21b2bac7e9756.tar.gz
gcc-8636be86eab0c475bd896a425cb21b2bac7e9756.tar.bz2
m68k.c (TARGET_PROMOTE_PROTOTYPES): New.
* config/m68k/m68k.c (TARGET_PROMOTE_PROTOTYPES): New. (TARGET_STRUCT_VALUE_RTX): Likewise. (m68k_struct_value_rtx): Likewise. * config/m68k/m68k.h (STRUCT_VALUE_REGNUM): Rename to STRUCT_VALUE_REGNUM. (PROMOTE_PROTOTYPES): Remove. * config/m68k/m68kelf.h (STRUCT_VALUE_REGNUM): Rename to STRUCT_VALUE_REGNUM. * config/m68k/m68kv4.h (STRUCT_VALUE_REGNUM): Likewise. * config/m68k/netbsd-elf.h (STRUCT_VALUE_REGNUM): Likewise. From-SVN: r76833
Diffstat (limited to 'gcc/config/m68k')
-rw-r--r--gcc/config/m68k/m68k.c19
-rw-r--r--gcc/config/m68k/m68k.h7
-rw-r--r--gcc/config/m68k/m68kelf.h7
-rw-r--r--gcc/config/m68k/m68kv4.h6
-rw-r--r--gcc/config/m68k/netbsd-elf.h6
5 files changed, 30 insertions, 15 deletions
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 210c63a..53b0926 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -1,5 +1,6 @@
/* Subroutines for insn-output.c for Motorola 68000 family.
- Copyright (C) 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
+ Copyright (C) 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2003, 2004
Free Software Foundation, Inc.
This file is part of GCC.
@@ -107,6 +108,7 @@ static void m68k_hp320_file_start (void);
#endif
static void m68k_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree);
+static rtx m68k_struct_value_rtx (tree, int);
static bool m68k_interrupt_function_p (tree func);
static tree m68k_handle_fndecl_attribute (tree *node, tree name,
tree args, int flags,
@@ -192,6 +194,12 @@ int m68k_last_compare_had_fp_operands;
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE m68k_attribute_table
+#undef TARGET_PROMOTE_PROTOTYPES
+#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
+
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX m68k_struct_value_rtx
+
static const struct attribute_spec m68k_attribute_table[] =
{
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
@@ -3496,3 +3504,12 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
output_asm_insn (fmt, xops);
}
+
+/* Worker function for TARGET_STRUCT_VALUE_RTX. */
+
+static rtx
+m68k_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
+ int incoming ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (Pmode, M68K_STRUCT_VALUE_REGNUM);
+}
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index 423895d..5ae893e 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -1,7 +1,7 @@
/* Definitions of target machine for GNU compiler.
Sun 68000/68020 version.
Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GCC.
@@ -587,7 +587,7 @@ extern int target_flags;
/* Register in which address to store a structure value
is passed to a function. */
-#define STRUCT_VALUE_REGNUM 9
+#define M68K_STRUCT_VALUE_REGNUM 9
/* Define the classes of registers for register constraints in the
machine description. Also define ranges of constants.
@@ -1369,9 +1369,6 @@ __transfer_from_trampoline () \
#define STORE_FLAG_VALUE (-1)
-/* When a prototype says `char' or `short', really pass an `int'. */
-#define PROMOTE_PROTOTYPES 1
-
/* Specify the machine mode that pointers have.
After generation of rtl, the compiler makes no further distinction
between pointers and any other objects of this machine mode. */
diff --git a/gcc/config/m68k/m68kelf.h b/gcc/config/m68k/m68kelf.h
index dfccef6..ac59af4 100644
--- a/gcc/config/m68k/m68kelf.h
+++ b/gcc/config/m68k/m68kelf.h
@@ -1,7 +1,8 @@
/* m68kelf support, derived from m68kv4.h */
/* Target definitions for GNU compiler for mc680x0 running System V.4
- Copyright (C) 1991, 1993, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1993, 2000, 2002, 2003, 2004
+ Free Software Foundation, Inc.
Written by Ron Guilmette (rfg@netcom.com) and Fred Fish (fnf@cygnus.com).
@@ -137,8 +138,8 @@ do { \
/* Register in which address to store a structure value is passed to a
function. The default in m68k.h is a1. For m68k/SVR4 it is a0. */
-#undef STRUCT_VALUE_REGNUM
-#define STRUCT_VALUE_REGNUM 8
+#undef M68K_STRUCT_VALUE_REGNUM
+#define M68K_STRUCT_VALUE_REGNUM 8
#define ASM_COMMENT_START "|"
diff --git a/gcc/config/m68k/m68kv4.h b/gcc/config/m68k/m68kv4.h
index ade22d4..f7886b5 100644
--- a/gcc/config/m68k/m68kv4.h
+++ b/gcc/config/m68k/m68kv4.h
@@ -1,5 +1,5 @@
/* Target definitions for GNU compiler for mc680x0 running System V.4
- Copyright (C) 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2003
+ Copyright (C) 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2003, 2004
Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com) and
Fred Fish (fnf@cygnus.com).
@@ -90,8 +90,8 @@ Boston, MA 02111-1307, USA. */
/* Register in which address to store a structure value is passed to a
function. The default in m68k.h is a1. For m68k/SVR4 it is a0. */
-#undef STRUCT_VALUE_REGNUM
-#define STRUCT_VALUE_REGNUM 8
+#undef M68K_STRUCT_VALUE_REGNUM
+#define M68K_STRUCT_VALUE_REGNUM 8
/* Register in which static-chain is passed to a function. The
default in m68k.h is a0, but that is already the struct value
diff --git a/gcc/config/m68k/netbsd-elf.h b/gcc/config/m68k/netbsd-elf.h
index 6669e5a..31a8052 100644
--- a/gcc/config/m68k/netbsd-elf.h
+++ b/gcc/config/m68k/netbsd-elf.h
@@ -1,7 +1,7 @@
/* Definitions of target machine for GNU compiler,
for m68k (including m68010) NetBSD platforms using the
ELF object format.
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Wasabi Systems. Inc.
This file is derived from <m68k/m68kv4.h>, <m68k/m68kelf.h>,
@@ -273,8 +273,8 @@ while (0)
/* Register in which address to store a structure value is passed to a
function. The default in m68k.h is a1. For m68k/SVR4 it is a0. */
-#undef STRUCT_VALUE_REGNUM
-#define STRUCT_VALUE_REGNUM 8
+#undef M68K_STRUCT_VALUE_REGNUM
+#define M68K_STRUCT_VALUE_REGNUM 8
/* Register in which static-chain is passed to a function. The