Commit 01af7e0a by John David Anglin

Fix handling of floating-point homogeneous aggregates.

	2020-02-21  John David Anglin  <danglin@gcc.gnu.org>

	* gcc/config/pa/pa.c (pa_function_value): Fix check for word and
	double-word size when handling aggregate return values.
	* gcc/config/pa/som.h (ASM_DECLARE_FUNCTION_NAME): Fix to indicate
	that homogeneous SFmode and DFmode aggregates are passed and returned
	in general registers.
parent 8d1780b5
2020-02-21 John David Anglin <danglin@gcc.gnu.org>
* gcc/config/pa/pa.c (pa_function_value): Fix check for word and
double-word size when handling aggregate return values.
* gcc/config/pa/som.h (ASM_DECLARE_FUNCTION_NAME): Fix to indicate
that homogeneous SFmode and DFmode aggregates are passed and returned
in general registers.
2020-02-21 Jakub Jelinek <jakub@redhat.com> 2020-02-21 Jakub Jelinek <jakub@redhat.com>
PR translation/93759 PR translation/93759
......
...@@ -9335,7 +9335,7 @@ pa_function_value (const_tree valtype, ...@@ -9335,7 +9335,7 @@ pa_function_value (const_tree valtype,
HOST_WIDE_INT valsize = int_size_in_bytes (valtype); HOST_WIDE_INT valsize = int_size_in_bytes (valtype);
/* Handle aggregates that fit exactly in a word or double word. */ /* Handle aggregates that fit exactly in a word or double word. */
if ((valsize & (UNITS_PER_WORD - 1)) == 0) if (valsize == UNITS_PER_WORD || valsize == 2 * UNITS_PER_WORD)
return gen_rtx_REG (TYPE_MODE (valtype), 28); return gen_rtx_REG (TYPE_MODE (valtype), 28);
if (TARGET_64BIT) if (TARGET_64BIT)
......
...@@ -98,8 +98,8 @@ do { \ ...@@ -98,8 +98,8 @@ do { \
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
do { tree fntype = TREE_TYPE (TREE_TYPE (DECL)); \ do { tree tree_type = TREE_TYPE (DECL); \
tree tree_type = TREE_TYPE (DECL); \ tree fntype = TREE_TYPE (tree_type); \
tree parm; \ tree parm; \
int i; \ int i; \
if (TREE_PUBLIC (DECL) || TARGET_GAS) \ if (TREE_PUBLIC (DECL) || TARGET_GAS) \
...@@ -121,9 +121,11 @@ do { \ ...@@ -121,9 +121,11 @@ do { \
{ \ { \
tree type = DECL_ARG_TYPE (parm); \ tree type = DECL_ARG_TYPE (parm); \
machine_mode mode = TYPE_MODE (type); \ machine_mode mode = TYPE_MODE (type); \
if (mode == SFmode && ! TARGET_SOFT_FLOAT) \ if (!AGGREGATE_TYPE_P (type) \
&& mode == SFmode && ! TARGET_SOFT_FLOAT) \
fprintf (FILE, ",ARGW%d=FR", i++); \ fprintf (FILE, ",ARGW%d=FR", i++); \
else if (mode == DFmode && ! TARGET_SOFT_FLOAT) \ else if (!AGGREGATE_TYPE_P (type) \
&& mode == DFmode && ! TARGET_SOFT_FLOAT) \
{ \ { \
if (i <= 2) \ if (i <= 2) \
{ \ { \
...@@ -158,9 +160,13 @@ do { \ ...@@ -158,9 +160,13 @@ do { \
for (; i < 4; i++) \ for (; i < 4; i++) \
fprintf (FILE, ",ARGW%d=GR", i); \ fprintf (FILE, ",ARGW%d=GR", i); \
} \ } \
if (TYPE_MODE (fntype) == DFmode && ! TARGET_SOFT_FLOAT) \ if (!AGGREGATE_TYPE_P (fntype) \
&& TYPE_MODE (fntype) == DFmode \
&& ! TARGET_SOFT_FLOAT) \
fputs (DFMODE_RETURN_STRING, FILE); \ fputs (DFMODE_RETURN_STRING, FILE); \
else if (TYPE_MODE (fntype) == SFmode && ! TARGET_SOFT_FLOAT) \ else if (!AGGREGATE_TYPE_P (fntype) \
&& TYPE_MODE (fntype) == SFmode \
&& ! TARGET_SOFT_FLOAT) \
fputs (SFMODE_RETURN_STRING, FILE); \ fputs (SFMODE_RETURN_STRING, FILE); \
else if (fntype != void_type_node) \ else if (fntype != void_type_node) \
fputs (",RTNVAL=GR", FILE); \ fputs (",RTNVAL=GR", FILE); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment