* (RETURN_IN_MEMORY): Handle BLKmode values.
authorDoug Evans <dje@gnu.org>
Fri, 12 Mar 1993 00:10:21 +0000 (00:10 +0000)
committerDoug Evans <dje@gnu.org>
Fri, 12 Mar 1993 00:10:21 +0000 (00:10 +0000)
From-SVN: r3709

gcc/config/alpha/alpha.h
gcc/config/i386/sysv4.h
gcc/config/i960/i960.h
gcc/config/m68k/apollo68.h
gcc/config/m88k/m88k.h
gcc/config/mips/mips.h
gcc/config/romp/romp.h
gcc/config/rs6000/rs6000.h
gcc/config/sparc/sparc.h
gcc/expr.h

index a743989..23adda2 100644 (file)
@@ -673,7 +673,8 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, ALL_REGS,
    are integers whose size is larger than 64 bits.  */
 
 #define RETURN_IN_MEMORY(TYPE) \
-  (TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE (TYPE) == UNION_TYPE  \
+  (TYPE_MODE (TYPE) == BLKmode \
+   || TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE (TYPE) == UNION_TYPE  \
    || (TREE_CODE (TYPE) == INTEGER_TYPE && TYPE_PRECISION (TYPE) > 64))
 
 /* 1 if N is a possible register number for a function value
index 7e555a2..9cc9925 100644 (file)
@@ -31,7 +31,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #undef RETURN_IN_MEMORY
 #define RETURN_IN_MEMORY(TYPE) \
-  (TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE(TYPE) == UNION_TYPE)
+  (TYPE_MODE (TYPE) == BLKmode \
+   || TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE(TYPE) == UNION_TYPE)
 
 /* Define which macros to predefine.  __svr4__ is our extension.  */
 /* This used to define X86, but james@bigtex.cactus.org says that
index 265a2e6..01d2c5e 100644 (file)
@@ -814,10 +814,11 @@ extern struct rtx_def *i960_function_arg ();
 #define FUNCTION_VALUE(TYPE, FUNC) \
   gen_rtx (REG, TYPE_MODE (TYPE), 0)
 
-/* Force objects larger than 16 bytes to be returned in memory, since we
-   only have 4 registers available for return values.  */
+/* Force aggregates and objects larger than 16 bytes to be returned in memory,
+   since we only have 4 registers available for return values.  */
 
-#define RETURN_IN_MEMORY(TYPE) (int_size_in_bytes (TYPE) > 16)
+#define RETURN_IN_MEMORY(TYPE) \
+  (TYPE_MODE (TYPE) == BLKmode || int_size_in_bytes (TYPE) > 16)
 
 /* For an arg passed partly in registers and partly in memory,
    this is the number of registers used.
index e2be431..a7989b0 100644 (file)
@@ -161,7 +161,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
    returned that way. */
 
 #define RETURN_IN_MEMORY(type) \
-  (GET_MODE_SIZE (TYPE_MODE (type)) > UNITS_PER_WORD)
+  (TYPE_MODE (type) == BLKmode \
+   || GET_MODE_SIZE (TYPE_MODE (type)) > UNITS_PER_WORD)
 
 /* In order to link with Apollo libraries, we can't prefix external
    symbols with an underscore.  */
index 4da23ff..9e8ceb7 100644 (file)
@@ -999,11 +999,12 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
 
 /* Disable the promotion of some structures and unions to registers. */
 #define RETURN_IN_MEMORY(TYPE) \
-  ((TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE(TYPE) == UNION_TYPE) \
-   && !(TYPE_MODE (TYPE) == SImode \
-       || (TYPE_MODE (TYPE) == BLKmode \
-           && TYPE_ALIGN (TYPE) == BITS_PER_WORD \
-           && int_size_in_bytes (TYPE) == UNITS_PER_WORD)))
+  (TYPE_MODE (TYPE) == BLKmode \
+   || ((TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE(TYPE) == UNION_TYPE) \
+       && !(TYPE_MODE (TYPE) == SImode \
+           || (TYPE_MODE (TYPE) == BLKmode \
+               && TYPE_ALIGN (TYPE) == BITS_PER_WORD \
+               && int_size_in_bytes (TYPE) == UNITS_PER_WORD))))
 
 /* Define how to find the value returned by a library function
    assuming the value has mode MODE.  */
index adc3634..9cceff2 100644 (file)
@@ -1759,11 +1759,12 @@ extern struct mips_frame_info current_frame_info;
    always returned.  Here TYPE will be a C expression of type
    `tree', representing the data type of the value.
 
-   Note that values of mode `BLKmode' are returned in memory
-   regardless of this macro.  Also, the option `-fpcc-struct-return'
+   Note that values of mode `BLKmode' must be explicitly
+   handled by this macro.  Also, the option `-fpcc-struct-return'
    takes effect regardless of this macro.  On most systems, it is
    possible to leave the macro undefined; this causes a default
-   definition to be used, whose value is the constant 0.
+   definition to be used, whose value is the constant 1 for BLKmode
+   values, and 0 otherwise.
 
    GCC normally converts 1 byte structures into chars, 2 byte
    structs into shorts, and 4 byte structs into ints, and returns
@@ -1771,7 +1772,8 @@ extern struct mips_frame_info current_frame_info;
    to give us MIPS cc compatibility.  */
 
 #define RETURN_IN_MEMORY(TYPE) \
-  ((TREE_CODE (TYPE) == RECORD_TYPE) || (TREE_CODE (TYPE) == UNION_TYPE))
+  ((TYPE_MODE (TYPE) == BLKmode) \
+   || (TREE_CODE (TYPE) == RECORD_TYPE) || (TREE_CODE (TYPE) == UNION_TYPE))
 
 \f
 /* A code distinguishing the floating point format of the target
index 67178a9..aa48d4a 100644 (file)
@@ -552,7 +552,8 @@ enum reg_class { NO_REGS, R0_REGS, R15_REGS, BASE_REGS, GENERAL_REGS,
    type DImode is returned in memory.  */
 
 #define RETURN_IN_MEMORY(type) \
-  (TARGET_HC_STRUCT_RETURN && TYPE_MODE (type) == DImode)
+  (TYPE_MODE (type) == BLKmode \
+   || (TARGET_HC_STRUCT_RETURN && TYPE_MODE (type) == DImode))
 
 /* 1 if N is a possible register number for a function value
    as seen by the caller.
index 3e76e36..b5cc26a 100644 (file)
@@ -644,7 +644,8 @@ enum reg_class { NO_REGS, BASE_REGS, GENERAL_REGS, FLOAT_REGS,
    For the RS/6000, any structure or union type is returned in memory.  */
 
 #define RETURN_IN_MEMORY(TYPE) \
-  (TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE (TYPE) == UNION_TYPE)
+  (TYPE_MODE (TYPE) == BLKmode \
+   || TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE (TYPE) == UNION_TYPE)
 
 /* 1 if N is a possible register number for a function value
    as seen by the caller.
index c2a4816..be46d31 100644 (file)
@@ -447,7 +447,7 @@ extern int leaf_function;
    we follow GCC's normal policy.  Use -fpcc-struct-value
    if you want to follow the ABI.  */
 #define RETURN_IN_MEMORY(TYPE) \
-  (TYPE_MODE (TYPE) == TFmode)
+  (TYPE_MODE (TYPE) == BLKmode || TYPE_MODE (TYPE) == TFmode)
 
 /* Functions which return large structures get the address
    to place the wanted value at offset 64 from the frame.
index f3a8cb5..39e29db 100644 (file)
@@ -225,12 +225,11 @@ enum direction {none, upward, downward};  /* Value has this type.  */
           && (FUNCTION_ARG_PADDING (MODE, TYPE)        \
               == MUST_PASS_IN_STACK_BAD_PADDING))))
 
-/* Nonzero if type TYPE should be returned in memory
-   (even though its mode is not BLKmode).
+/* Nonzero if type TYPE should be returned in memory.
    Most machines can use the following default definition.  */
 
 #ifndef RETURN_IN_MEMORY
-#define RETURN_IN_MEMORY(TYPE) 0
+#define RETURN_IN_MEMORY(TYPE) (TYPE_MODE (TYPE) == BLKmode)
 #endif
 \f
 /* Optabs are tables saying how to generate insn bodies