diff options
author | Steve Ellcey <sellcey@imgtec.com> | 2015-12-14 23:56:28 +0000 |
---|---|---|
committer | Steve Ellcey <sje@gcc.gnu.org> | 2015-12-14 23:56:28 +0000 |
commit | db4aec84e094cc3b736497891d7b0d383b9ce7bf (patch) | |
tree | c43bf905dfb5d30081601635a99a766a2d3d73b2 | |
parent | fa583f9e654fb4c7137a869d767858534f0bb535 (diff) | |
download | gcc-db4aec84e094cc3b736497891d7b0d383b9ce7bf.zip gcc-db4aec84e094cc3b736497891d7b0d383b9ce7bf.tar.gz gcc-db4aec84e094cc3b736497891d7b0d383b9ce7bf.tar.bz2 |
mips.c (mips_promote_function_mode): New function.
2015-12-14 Steve Ellcey <sellcey@imgtec.com>
* config/mips/mips.c (mips_promote_function_mode): New function.
(TARGET_PROMOTE_FUNCTION_MODE): Define as above function.
(TARGET_PROMOTE_PROTOTYPES): Remove.
From-SVN: r231634
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 31 |
2 files changed, 33 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e7b2d68..c90899e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-12-14 Steve Ellcey <sellcey@imgtec.com> + + * config/mips/mips.c (mips_promote_function_mode): New function. + (TARGET_PROMOTE_FUNCTION_MODE): Define as above function. + (TARGET_PROMOTE_PROTOTYPES): Remove. + 2015-12-14 Jason Merrill <jason@redhat.com> PR c++/68309 diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 6145944..7744d19 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -19906,6 +19906,32 @@ mips_ira_change_pseudo_allocno_class (int regno, reg_class_t allocno_class) return GR_REGS; return allocno_class; } + +/* Implement TARGET_PROMOTE_FUNCTION_MODE */ + +/* This function is equivalent to default_promote_function_mode_always_promote + except that it returns a promoted mode even if type is NULL_TREE. This is + needed by libcalls which have no type (only a mode) such as fixed conversion + routines that take a signed or unsigned char/short argument and convert it + to a fixed type. */ + +static machine_mode +mips_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, + machine_mode mode, + int *punsignedp ATTRIBUTE_UNUSED, + const_tree fntype ATTRIBUTE_UNUSED, + int for_return ATTRIBUTE_UNUSED) +{ + int unsignedp; + + if (type != NULL_TREE) + return promote_mode (type, mode, punsignedp); + + unsignedp = *punsignedp; + PROMOTE_MODE (mode, unsignedp, type); + *punsignedp = unsignedp; + return mode; +} /* Initialize the GCC target structure. */ #undef TARGET_ASM_ALIGNED_HI_OP @@ -20010,10 +20036,7 @@ mips_ira_change_pseudo_allocno_class (int regno, reg_class_t allocno_class) #define TARGET_GIMPLIFY_VA_ARG_EXPR mips_gimplify_va_arg_expr #undef TARGET_PROMOTE_FUNCTION_MODE -#define TARGET_PROMOTE_FUNCTION_MODE default_promote_function_mode_always_promote -#undef TARGET_PROMOTE_PROTOTYPES -#define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true - +#define TARGET_PROMOTE_FUNCTION_MODE mips_promote_function_mode #undef TARGET_FUNCTION_VALUE #define TARGET_FUNCTION_VALUE mips_function_value #undef TARGET_LIBCALL_VALUE |