i386.h (MS_AGGREGATE_RETURN): New define.
authorDanny Smith <dannysmith@users.sourceforge.net>
Fri, 7 Feb 2003 22:10:56 +0000 (22:10 +0000)
committerDanny Smith <dannysmith@gcc.gnu.org>
Fri, 7 Feb 2003 22:10:56 +0000 (22:10 +0000)
* config/i386/i386.h (MS_AGGREGATE_RETURN): New define.
* config/i386/cygwin.h (MS_AGGREGATE_RETURN): Override default
definition.
* config/i386/i386.h (ix86_return_in_memory): Return aggregate
types of up to 8 bytes via registers if MS_AGGREGATE_RETURN.

From-SVN: r62547

gcc/ChangeLog
gcc/config/i386/cygwin.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h

index 7fbeef59dbd22b4811ac997a44f9e5cc2a53beab..7df730259bc490cc5d76808a5c296ce89004a2bc 100644 (file)
@@ -1,3 +1,11 @@
+2003-03-07  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * config/i386/i386.h (MS_AGGREGATE_RETURN): New define.
+       * config/i386/cygwin.h (MS_AGGREGATE_RETURN): Override default
+       definition.
+       * config/i386/i386.h (ix86_return_in_memory): Return aggregate
+       types of up to 8 bytes via registers if MS_AGGREGATE_RETURN.
+
 Fri Feb  7 22:22:40 CET 2003  Jan Hubicka  <jh@suse.cz>
 
        * i386.md (movdi_rex64_1): Fix mmx<->int move opcode.
index 76978980c28ff9c0d17e0e94fff6345863d091ca..085c3e78fe09ddcab2089cac82b28880d03112e0 100644 (file)
@@ -410,6 +410,11 @@ extern int i386_pe_dllimport_name_p PARAMS ((const char *));
 #undef DEFAULT_PCC_STRUCT_RETURN
 #define DEFAULT_PCC_STRUCT_RETURN 0
 
+/* MSVC returns aggregate types of up to 8 bytes via registers.
+   See i386.c:ix86_return_in_memory.  */
+#undef MS_AGGREGATE_RETURN
+#define MS_AGGREGATE_RETURN 1
+
 /* No data type wants to be aligned rounder than this.  */
 #undef BIGGEST_ALIGNMENT
 #define BIGGEST_ALIGNMENT 128
index 23f2494f41746c472272360bc632092cd4a35ff8..def53d052d00345615b65867ac7935ba9607fe5d 100644 (file)
@@ -2608,12 +2608,18 @@ ix86_return_in_memory (type)
     }
   else
     {
-      if (TYPE_MODE (type) == BLKmode
-         || (VECTOR_MODE_P (TYPE_MODE (type))
-             && int_size_in_bytes (type) == 8)
-         || (int_size_in_bytes (type) > 12 && TYPE_MODE (type) != TImode
-             && TYPE_MODE (type) != TFmode
-             && !VECTOR_MODE_P (TYPE_MODE (type))))
+      if (TYPE_MODE (type) == BLKmode)
+       return 1;
+      else if (MS_AGGREGATE_RETURN
+              && AGGREGATE_TYPE_P (type)
+              && int_size_in_bytes(type) <= 8)
+       return 0;
+      else if ((VECTOR_MODE_P (TYPE_MODE (type))
+               && int_size_in_bytes (type) == 8)
+              || (int_size_in_bytes (type) > 12
+                  && TYPE_MODE (type) != TImode
+                  && TYPE_MODE (type) != TFmode
+                  && !VECTOR_MODE_P (TYPE_MODE (type))))
        return 1;
       return 0;
     }
index 8d1b5e428f4b3d266be64eb739bdb723b32f935a..8373e3250a6e6101006373c968ab0f00be151c0b 100644 (file)
@@ -1208,6 +1208,9 @@ do {                                                                      \
 #define RETURN_IN_MEMORY(TYPE) \
   ix86_return_in_memory (TYPE)
 
+/* This is overriden by <cygwin.h>.  */
+#define MS_AGGREGATE_RETURN 0
+
 \f
 /* Define the classes of registers for register constraints in the
    machine description.  Also define ranges of constants.