public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/redhat/heads/gcc-9-branch)] Fix handling of floating-point homogeneous aggregates.
@ 2020-03-17 19:13 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2020-03-17 19:13 UTC (permalink / raw)
  To: gcc-cvs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 3686 bytes --]

https://gcc.gnu.org/g:4ccda0308ef19774c6cfd6b16c5e22829588809b

commit 4ccda0308ef19774c6cfd6b16c5e22829588809b
Author: John David Anglin <danglin@gcc.gnu.org>
Date:   Fri Feb 21 23:34:09 2020 +0000

    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.

Diff:
---
 gcc/ChangeLog       |  8 ++++++++
 gcc/config/pa/pa.c  |  2 +-
 gcc/config/pa/som.h | 18 ++++++++++++------
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a9042799a97..2a5d572005f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+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-20  Uroš Bizjak  <ubizjak@gmail.com>
 
 	PR target/93828
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 3546846956e..84a8cae22e4 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -9343,7 +9343,7 @@ pa_function_value (const_tree valtype,
       HOST_WIDE_INT valsize = int_size_in_bytes (valtype);
 
       /* 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);
 
       if (TARGET_64BIT)
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index adefc99a1e3..3ef543428ff 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -98,8 +98,8 @@ do {								\
 
 \f
 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
-    do { tree fntype = TREE_TYPE (TREE_TYPE (DECL));			\
-	 tree tree_type = TREE_TYPE (DECL);				\
+    do { tree tree_type = TREE_TYPE (DECL);				\
+	 tree fntype = TREE_TYPE (tree_type);				\
 	 tree parm;							\
 	 int i;								\
 	 if (TREE_PUBLIC (DECL) || TARGET_GAS)				\
@@ -121,9 +121,11 @@ do {								\
 	       {							\
 		 tree type = DECL_ARG_TYPE (parm);			\
 		 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++);			\
-		 else if (mode == DFmode && ! TARGET_SOFT_FLOAT)	\
+		 else if (!AGGREGATE_TYPE_P (type)			\
+			  && mode == DFmode && ! TARGET_SOFT_FLOAT)	\
 		   {							\
 		     if (i <= 2)					\
 		       {						\
@@ -158,9 +160,13 @@ do {								\
 		 for (; i < 4; 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);			\
-	     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);			\
 	     else if (fntype != void_type_node)				\
 	       fputs (",RTNVAL=GR", FILE);				\


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-17 19:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-17 19:13 [gcc(refs/vendors/redhat/heads/gcc-9-branch)] Fix handling of floating-point homogeneous aggregates Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).