diff options
author | Anatoly Sokolov <aesok@post.ru> | 2009-10-22 23:46:26 +0400 |
---|---|---|
committer | Anatoly Sokolov <aesok@gcc.gnu.org> | 2009-10-22 23:46:26 +0400 |
commit | 2a31793e324e29c237dc9e46064280aa626374ad (patch) | |
tree | 7115e883ca22b8fd5c248329b20c3d08a3703a2a /gcc | |
parent | 062eee1eb05a3387cebe8c9f9a6ecd359b15dec5 (diff) | |
download | gcc-2a31793e324e29c237dc9e46064280aa626374ad.zip gcc-2a31793e324e29c237dc9e46064280aa626374ad.tar.gz gcc-2a31793e324e29c237dc9e46064280aa626374ad.tar.bz2 |
m32c.c (m32c_function_value_regno_p): New function.
* config/m32c/m32c.c (m32c_function_value_regno_p): New function.
(m32c_function_value): Make static, add new 'outgoing' argument.
(m32c_libcall_value): Make static, add new 'fun' argument.
(TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare.
* config/m32c/m32c.h: (FUNCTION_VALUE, LIBCALL_VALUE): Remove.
(FUNCTION_VALUE_REGNO_P): Redefine, use m32c_function_value_regno_p.
* config/m32c/m32c-protos.h (m32c_function_value_regno_p): Declare.
(m32c_function_value, m32c_libcall_value): Delete declaration.
From-SVN: r153473
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/config/m32c/m32c-protos.h | 3 | ||||
-rw-r--r-- | gcc/config/m32c/m32c.c | 35 | ||||
-rw-r--r-- | gcc/config/m32c/m32c.h | 5 |
4 files changed, 41 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3540966..002a22a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2009-10-22 Anatoly Sokolov <aesok@post.ru> + + * config/m32c/m32c.c (m32c_function_value_regno_p): New function. + (m32c_function_value): Make static, add new 'outgoing' argument. + (m32c_libcall_value): Make static, add new 'fun' argument. + (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare. + * config/m32c/m32c.h: (FUNCTION_VALUE, LIBCALL_VALUE): Remove. + (FUNCTION_VALUE_REGNO_P): Redefine, use m32c_function_value_regno_p. + * config/m32c/m32c-protos.h (m32c_function_value_regno_p): Declare. + (m32c_function_value, m32c_libcall_value): Delete declaration. + 2009-10-22 Diego Novillo <dnovillo@google.com> * Makefile.in (PLUGIN_HEADERS): Add output.h and diff --git a/gcc/config/m32c/m32c-protos.h b/gcc/config/m32c/m32c-protos.h index e571fe9..42b92fe 100644 --- a/gcc/config/m32c/m32c-protos.h +++ b/gcc/config/m32c/m32c-protos.h @@ -49,7 +49,6 @@ int m32c_trampoline_size (void); #if defined(RTX_CODE) && defined(TREE_CODE) rtx m32c_function_arg (CUMULATIVE_ARGS *, MM, tree, int); -rtx m32c_function_value (const_tree, const_tree); #endif @@ -75,7 +74,7 @@ bool m32c_immd_dbl_mov (rtx *, MM); rtx m32c_incoming_return_addr_rtx (void); int m32c_legitimate_constant_p (rtx); int m32c_legitimize_reload_address (rtx *, MM, int, int, int); -rtx m32c_libcall_value (MM); +bool m32c_function_value_regno_p (const unsigned int); int m32c_limit_reload_class (MM, int); int m32c_memory_move_cost (MM, int, int); int m32c_modes_tieable_p (MM, MM); diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 4eeedb1..1085aa7 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -81,6 +81,9 @@ static bool m32c_strict_argument_naming (CUMULATIVE_ARGS *); static rtx m32c_struct_value_rtx (tree, int); static rtx m32c_subreg (enum machine_mode, rtx, enum machine_mode, int); static int need_to_save (int); +static rtx m32c_function_value (const_tree, const_tree, bool); +static rtx m32c_libcall_value (enum machine_mode, const_rtx); + int current_function_special_page_vector (rtx); #define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0) @@ -1591,15 +1594,19 @@ m32c_valid_pointer_mode (enum machine_mode mode) /* How Scalar Function Values Are Returned */ -/* Implements LIBCALL_VALUE. Most values are returned in $r0, or some +/* Implements TARGET_LIBCALL_VALUE. Most values are returned in $r0, or some combination of registers starting there (r2r0 for longs, r3r1r2r0 for long long, r3r2r1r0 for doubles), except that that ABI currently doesn't work because it ends up using all available general registers and gcc often can't compile it. So, instead, we return anything bigger than 16 bits in "mem0" (effectively, a memory location). */ -rtx -m32c_libcall_value (enum machine_mode mode) + +#undef TARGET_LIBCALL_VALUE +#define TARGET_LIBCALL_VALUE m32c_libcall_value + +static rtx +m32c_libcall_value (enum machine_mode mode, const_rtx fun ATTRIBUTE_UNUSED) { /* return reg or parallel */ #if 0 @@ -1649,14 +1656,28 @@ m32c_libcall_value (enum machine_mode mode) return gen_rtx_REG (mode, R0_REGNO); } -/* Implements FUNCTION_VALUE. Functions and libcalls have the same +/* Implements TARGET_FUNCTION_VALUE. Functions and libcalls have the same conventions. */ -rtx -m32c_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED) + +#undef TARGET_FUNCTION_VALUE +#define TARGET_FUNCTION_VALUE m32c_function_value + +static rtx +m32c_function_value (const_tree valtype, + const_tree fn_decl_or_type ATTRIBUTE_UNUSED, + bool outgoing ATTRIBUTE_UNUSED) { /* return reg or parallel */ const enum machine_mode mode = TYPE_MODE (valtype); - return m32c_libcall_value (mode); + return m32c_libcall_value (mode, NULL_RTX); +} + +/* Implements FUNCTION_VALUE_REGNO_P. */ + +bool +m32c_function_value_regno_p (const unsigned int regno) +{ + return (regno == R0_REGNO || regno == MEM0_REGNO); } /* How Large Values Are Returned */ diff --git a/gcc/config/m32c/m32c.h b/gcc/config/m32c/m32c.h index 0f12158..c0914d3 100644 --- a/gcc/config/m32c/m32c.h +++ b/gcc/config/m32c/m32c.h @@ -533,10 +533,7 @@ typedef struct m32c_cumulative_args /* How Scalar Function Values Are Returned */ -#define FUNCTION_VALUE(VT,F) m32c_function_value (VT, F) -#define LIBCALL_VALUE(MODE) m32c_libcall_value (MODE) - -#define FUNCTION_VALUE_REGNO_P(r) ((r) == R0_REGNO || (r) == MEM0_REGNO) +#define FUNCTION_VALUE_REGNO_P(r) m32c_function_value_regno_p (r) /* How Large Values Are Returned */ |