OSDN Git Service

* config/sparc/sparc.c (function_value): Treat all non-record
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Feb 2001 12:53:46 +0000 (12:53 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Feb 2001 12:53:46 +0000 (12:53 +0000)
aggregate types like used to treat UNION_TYPE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39629 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/sparc/sparc.c

index d75143e..776b995 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 13 07:52:04 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * config/sparc/sparc.c (function_value): Treat all non-record
+       aggregate types like used to treat UNION_TYPE.
+
 Tue Feb 13 13:31:33 CET 2001  Jan Hubicka  <jh@suse.cz>
 
        * i386.c (print_reg): Use ANY_FP_REG instead of FP_REG
index 0d194f1..a84b095 100644 (file)
@@ -4683,9 +4683,11 @@ function_value (type, mode, incoming_p)
 
          return function_arg_record_value (type, mode, 0, 1, regbase);
        }
-      else if (TREE_CODE (type) == UNION_TYPE)
+      else if (AGGREGATE_TYPE_P (type))
        {
-         int bytes = int_size_in_bytes (type);
+         /* All other aggregate types are passed in an integer register
+            in a mode corresponding to the size of the type.  */
+         HOST_WIDE_INT bytes = int_size_in_bytes (type);
 
          if (bytes > 32)
            abort ();
@@ -4697,7 +4699,7 @@ function_value (type, mode, incoming_p)
   if (TARGET_ARCH64
       && GET_MODE_CLASS (mode) == MODE_INT 
       && GET_MODE_SIZE (mode) < UNITS_PER_WORD
-      && type && TREE_CODE (type) != UNION_TYPE)
+      && type && ! AGGREGATE_TYPE_P (type))
     mode = DImode;
 
   if (incoming_p)