This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Commit: RX: Do not promote vector types
- From: Nick Clifton <nickc at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 08 Jun 2015 14:57:22 +0100
- Subject: Commit: RX: Do not promote vector types
- Authentication-results: sourceware.org; auth=none
Hi Guys,
I am applying the patch below to the RX's handling of vector
functions. The RX ABI specifies that small integer return values
should always be promoted to 32-bit values, but the code that performs
this promotion was also affecting vector types. This results in
internal compiler errors when the promoted type does not match the
original vector type.
Cheers
Nick
gcc/ChangeLog
2015-06-08 Nick Clifton <nickc@redhat.com>
* config/rx/rx.c (rx_function_value): Do not promote vector types.
(rx_promote_function_mode): Likewise.
* config/rx/rx.h (LIBCALL_VALUE): Likewise.
Index: gcc/config/rx/rx.c
===================================================================
--- gcc/config/rx/rx.c (revision 224227)
+++ gcc/config/rx/rx.c (working copy)
@@ -1174,6 +1181,8 @@
if (GET_MODE_SIZE (mode) > 0
&& GET_MODE_SIZE (mode) < 4
&& ! COMPLEX_MODE_P (mode)
+ && ! VECTOR_TYPE_P (ret_type)
+ && ! VECTOR_MODE_P (mode)
)
return gen_rtx_REG (SImode, FUNC_RETURN_REGNUM);
@@ -1193,6 +1202,8 @@
if (for_return != 1
|| GET_MODE_SIZE (mode) >= 4
|| COMPLEX_MODE_P (mode)
+ || VECTOR_MODE_P (mode)
+ || VECTOR_TYPE_P (type)
|| GET_MODE_SIZE (mode) < 1)
return mode;
Index: gcc/config/rx/rx.h
===================================================================
--- gcc/config/rx/rx.h (revision 224227)
+++ gcc/config/rx/rx.h (working copy)
@@ -267,6 +267,7 @@
#define LIBCALL_VALUE(MODE) \
gen_rtx_REG (((GET_MODE_CLASS (MODE) != MODE_INT \
|| COMPLEX_MODE_P (MODE) \
+ || VECTOR_MODE_P (MODE) \
|| GET_MODE_SIZE (MODE) >= 4) \
? (MODE) \
: SImode), \