m68hc11.c (TARGET_STRUCT_VALUE_RTX): New.
authorKazu Hirata <kazu@cs.umass.edu>
Sun, 25 Jan 2004 17:35:43 +0000 (17:35 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sun, 25 Jan 2004 17:35:43 +0000 (17:35 +0000)
* config/m68hc11/m68hc11.c (TARGET_STRUCT_VALUE_RTX): New.
(TARGET_RETURN_IN_MEMORY): Likewise.
(m68hc11_struct_value_rtx): Likewise.
(m68hc11_return_in_memory): Likewise.
* config/m68hc11/m68hc11.h: Remove a commented-out definition
of PROMOTE_PROTOTYPES.
(RETURN_IN_MEMORY): Remove.
(STRUCT_VALUE_REGNUM): Likewise.

From-SVN: r76571

gcc/ChangeLog
gcc/config/m68hc11/m68hc11.c
gcc/config/m68hc11/m68hc11.h

index 8628f62fd340a47bdbdde4cdd3fa4d236cc2c1f6..459e4d0d3a4dba0d5edcf6981d6f51b9adfc4e4c 100644 (file)
@@ -1,3 +1,14 @@
+2004-01-25  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * config/m68hc11/m68hc11.c (TARGET_STRUCT_VALUE_RTX): New.
+       (TARGET_RETURN_IN_MEMORY): Likewise.
+       (m68hc11_struct_value_rtx): Likewise.
+       (m68hc11_return_in_memory): Likewise.
+       * config/m68hc11/m68hc11.h: Remove a commented-out definition
+       of PROMOTE_PROTOTYPES.
+       (RETURN_IN_MEMORY): Remove.
+       (STRUCT_VALUE_REGNUM): Likewise.
+
 2004-01-25  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/mmix/mmix-protos.h: Remove the prototype for
index 9a8651dd4409ba7368a59d59cb817109e6d80fe3..314697874eb351fbe58ecc63df4df81f753d6dd6 100644 (file)
@@ -1,5 +1,5 @@
 /* Subroutines for code generation on Motorola 68HC11 and 68HC12.
-   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Contributed by Stephane Carrez (stcarrez@nerim.fr)
 
 This file is part of GCC.
@@ -87,6 +87,8 @@ static unsigned int m68hc11_section_type_flags (tree, const char*, int);
 static int autoinc_mode (rtx);
 static int m68hc11_make_autoinc_notes (rtx *, void *);
 static void m68hc11_init_libfuncs (void);
+static rtx m68hc11_struct_value_rtx (tree, int);
+static bool m68hc11_return_in_memory (tree, tree);
 
 /* Must be set to 1 to produce debug messages.  */
 int debug_m6811 = 0;
@@ -254,6 +256,11 @@ static int nb_soft_regs;
 #undef TARGET_INIT_LIBFUNCS
 #define TARGET_INIT_LIBFUNCS m68hc11_init_libfuncs
 
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX m68hc11_struct_value_rtx
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY m68hc11_return_in_memory
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 int
@@ -5520,4 +5527,23 @@ m68hc11_asm_out_destructor (rtx symbol, int priority)
   fprintf (asm_out_file, "\t.globl\t__do_global_dtors\n");
 }
 
+static rtx
+m68hc11_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
+                         int incoming ATTRIBUTE_UNUSED)
+{
+  return gen_rtx_REG (Pmode, HARD_D_REGNUM);
+}
+
+/* Return true if type TYPE should be returned in memory.
+   Blocks and data types largers than 4 bytes cannot be returned
+   in the register (D + X = 4).  */
+
+static bool
+m68hc11_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
+{
+  return ((TYPE_MODE (type) == BLKmode)
+         ? (int_size_in_bytes (type) > 4)
+         : (GET_MODE_SIZE (TYPE_MODE (type)) > 4));
+}
+
 #include "gt-m68hc11.h"
index ba0a2c7eef1124bc385083e5be5fa683b95aba07..0b235b5b33d6be20c070db19d1455b66bb1b2b88 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler.
    Motorola 68HC11 and 68HC12.
-   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Contributed by Stephane Carrez (stcarrez@nerim.fr)
 
 This file is part of GCC.
@@ -1004,9 +1004,6 @@ extern enum reg_class m68hc11_tmp_regs_class;
 \f
 /* Passing Function Arguments on the Stack.  */
 
-/* When a prototype says `char' or `short', really pass an `int'.  */
-/* #define PROMOTE_PROTOTYPES */
-
 /* If we generate an insn to push BYTES bytes, this says how many the
    stack pointer really advances by. No rounding or alignment needed
    for MC6811.  */
@@ -1020,15 +1017,6 @@ extern enum reg_class m68hc11_tmp_regs_class;
    The standard MC6811 call, with arg count word, includes popping the
    args as part of the call template.  */
 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-
-/* Nonzero if type TYPE should be returned in memory.
-   Blocks and data types largers than 4 bytes cannot be returned
-   in the register (D + X = 4).  */
-#define RETURN_IN_MEMORY(TYPE)                         \
-    ((TYPE_MODE (TYPE) == BLKmode)                     \
-     ? (int_size_in_bytes (TYPE) > 4)                  \
-     : (GET_MODE_SIZE (TYPE_MODE (TYPE)) > 4))
-
 \f
 /* Passing Arguments in Registers.  */
 
@@ -1148,10 +1136,6 @@ typedef struct m68hc11_args
 #define FUNCTION_VALUE_REGNO_P(N) \
      ((N) == HARD_D_REGNUM || (N) == HARD_X_REGNUM)
 
-/* Register in which address to store a structure value is passed to a
-   function.  */
-#define STRUCT_VALUE_REGNUM    HARD_D_REGNUM
-
 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
    the stack pointer does not matter.  The value is tested only in functions
    that have frame pointers. No definition is equivalent to always zero.  */