m68hc11.c (TARGET_STRUCT_VALUE_RTX): New.

* 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
This commit is contained in:
Kazu Hirata 2004-01-25 17:35:43 +00:00 committed by Kazu Hirata
parent 344caf1ba1
commit 341ec19196
3 changed files with 39 additions and 18 deletions

View 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

View 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;
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"

View 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;
/* 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))
/* 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. */