gccint: Aggregate Return
1
1 18.9.9 How Large Values Are Returned
1 ------------------------------------
1
1 When a function value's mode is 'BLKmode' (and in some other cases), the
11 value is not returned according to 'TARGET_FUNCTION_VALUE' (⇒Scalar
Return). Instead, the caller passes the address of a block of memory
1 in which the value should be stored. This address is called the
1 "structure value address".
1
1 This section describes how to control returning structure values in
1 memory.
1
1 -- Target Hook: bool TARGET_RETURN_IN_MEMORY (const_tree TYPE,
1 const_tree FNTYPE)
1 This target hook should return a nonzero value to say to return the
1 function value in memory, just as large structures are always
1 returned. Here TYPE will be the data type of the value, and FNTYPE
1 will be the type of the function doing the returning, or 'NULL' for
1 libcalls.
1
1 Note that values of mode 'BLKmode' must be explicitly handled by
1 this function. Also, the option '-fpcc-struct-return' takes effect
1 regardless of this macro. On most systems, it is possible to leave
1 the hook undefined; this causes a default definition to be used,
1 whose value is the constant 1 for 'BLKmode' values, and 0
1 otherwise.
1
1 Do not use this hook to indicate that structures and unions should
1 always be returned in memory. You should instead use
1 'DEFAULT_PCC_STRUCT_RETURN' to indicate this.
1
1 -- Macro: DEFAULT_PCC_STRUCT_RETURN
1 Define this macro to be 1 if all structure and union return values
1 must be in memory. Since this results in slower code, this should
1 be defined only if needed for compatibility with other compilers or
1 with an ABI. If you define this macro to be 0, then the
1 conventions used for structure and union return values are decided
1 by the 'TARGET_RETURN_IN_MEMORY' target hook.
1
1 If not defined, this defaults to the value 1.
1
1 -- Target Hook: rtx TARGET_STRUCT_VALUE_RTX (tree FNDECL, int INCOMING)
1 This target hook should return the location of the structure value
1 address (normally a 'mem' or 'reg'), or 0 if the address is passed
1 as an "invisible" first argument. Note that FNDECL may be 'NULL',
1 for libcalls. You do not need to define this target hook if the
1 address is always passed as an "invisible" first argument.
1
1 On some architectures the place where the structure value address
1 is found by the called function is not the same place that the
1 caller put it. This can be due to register windows, or it could be
1 because the function prologue moves it to a different place.
1 INCOMING is '1' or '2' when the location is needed in the context
1 of the called function, and '0' in the context of the caller.
1
1 If INCOMING is nonzero and the address is to be found on the stack,
1 return a 'mem' which refers to the frame pointer. If INCOMING is
1 '2', the result is being used to fetch the structure value address
1 at the beginning of a function. If you need to emit adjusting
1 code, you should do it at this point.
1
1 -- Macro: PCC_STATIC_STRUCT_RETURN
1 Define this macro if the usual system convention on the target
1 machine for returning structures and unions is for the called
1 function to return the address of a static variable containing the
1 value.
1
1 Do not define this if the usual system convention is for the caller
1 to pass an address to the subroutine.
1
1 This macro has effect in '-fpcc-struct-return' mode, but it does
1 nothing when you use '-freg-struct-return' mode.
1
1 -- Target Hook: fixed_size_mode TARGET_GET_RAW_RESULT_MODE (int REGNO)
1 This target hook returns the mode to be used when accessing raw
1 return registers in '__builtin_return'. Define this macro if the
1 value in REG_RAW_MODE is not correct.
1
1 -- Target Hook: fixed_size_mode TARGET_GET_RAW_ARG_MODE (int REGNO)
1 This target hook returns the mode to be used when accessing raw
1 argument registers in '__builtin_apply_args'. Define this macro if
1 the value in REG_RAW_MODE is not correct.
1
1 -- Target Hook: bool TARGET_EMPTY_RECORD_P (const_tree TYPE)
1 This target hook returns true if the type is an empty record. The
1 default is to return 'false'.
1
1 -- Target Hook: void TARGET_WARN_PARAMETER_PASSING_ABI
1 (cumulative_args_t CA, tree TYPE)
1 This target hook warns about the change in empty class parameter
1 passing ABI.
1