home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 2
/
FFMCD02.bin
/
useful
/
info
/
gcc.info-19
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1993-12-13
|
50KB
|
853 lines
This is Info file gcc.info, produced by Makeinfo-1.54 from the input
file gcc.texi.
This file documents the use and the internals of the GNU compiler.
Published by the Free Software Foundation 675 Massachusetts Avenue
Cambridge, MA 02139 USA
Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the sections entitled "GNU General Public License" and "Protect
Your Freedom--Fight `Look And Feel'" are included exactly as in the
original, and provided that the entire resulting derived work is
distributed under the terms of a permission notice identical to this
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the sections entitled "GNU General Public
License" and "Protect Your Freedom--Fight `Look And Feel'", and this
permission notice, may be included in translations approved by the Free
Software Foundation instead of in the original English.
File: gcc.info, Node: Scalar Return, Next: Aggregate Return, Prev: Register Arguments, Up: Stack and Calling
How Scalar Function Values Are Returned
---------------------------------------
This section discusses the macros that control returning scalars as
values--values that can fit in registers.
`TRADITIONAL_RETURN_FLOAT'
Define this macro if `-traditional' should not cause functions
declared to return `float' to convert the value to `double'.
`FUNCTION_VALUE (VALTYPE, FUNC)'
A C expression to create an RTX representing the place where a
function returns a value of data type VALTYPE. VALTYPE is a tree
node representing a data type. Write `TYPE_MODE (VALTYPE)' to get
the machine mode used to represent that type. On many machines,
only the mode is relevant. (Actually, on most machines, scalar
values are returned in the same place regardless of mode).
If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same
promotion rules specified in `PROMOTE_MODE' if VALTYPE is a scalar
type.
If the precise function being called is known, FUNC is a tree node
(`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
makes it possible to use a different value-returning convention
for specific functions when all their calls are known.
`FUNCTION_VALUE' is not used for return vales with aggregate data
types, because these are returned in another way. See
`STRUCT_VALUE_REGNUM' and related macros, below.
`FUNCTION_OUTGOING_VALUE (VALTYPE, FUNC)'
Define this macro if the target machine has "register windows" so
that the register in which a function returns its value is not the
same as the one in which the caller sees the value.
For such machines, `FUNCTION_VALUE' computes the register in which
the caller will see the value. `FUNCTION_OUTGOING_VALUE' should be
defined in a similar fashion to tell the function where to put the
value.
If `FUNCTION_OUTGOING_VALUE' is not defined, `FUNCTION_VALUE'
serves both purposes.
`FUNCTION_OUTGOING_VALUE' is not used for return vales with
aggregate data types, because these are returned in another way.
See `STRUCT_VALUE_REGNUM' and related macros, below.
`LIBCALL_VALUE (MODE)'
A C expression to create an RTX representing the place where a
library function returns a value of mode MODE. If the precise
function being called is known, FUNC is a tree node
(`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
makes it possible to use a different value-returning convention
for specific functions when all their calls are known.
Note that "library function" in this context means a compiler
support routine, used to perform arithmetic, whose name is known
specially by the compiler and was not mentioned in the C code being
compiled.
The definition of `LIBRARY_VALUE' need not be concerned aggregate
data types, because none of the library functions returns such
types.
`FUNCTION_VALUE_REGNO_P (REGNO)'
A C expression that is nonzero if REGNO is the number of a hard
register in which the values of called function may come back.
A register whose use for returning values is limited to serving as
the second of a pair (for a value of type `double', say) need not
be recognized by this macro. So for most machines, this definition
suffices:
#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
If the machine has register windows, so that the caller and the
called function use different registers for the return value, this
macro should recognize only the caller's register numbers.
`APPLY_RESULT_SIZE'
Define this macro if `untyped_call' and `untyped_return' need more
space than is implied by `FUNCTION_VALUE_REGNO_P' for saving and
restoring an arbitrary return value.
File: gcc.info, Node: Aggregate Return, Next: Caller Saves, Prev: Scalar Return, Up: Stack and Calling
How Large Values Are Returned
-----------------------------
When a function value's mode is `BLKmode' (and in some other cases),
the value is not returned according to `FUNCTION_VALUE' (*note Scalar
Return::.). Instead, the caller passes the address of a block of
memory in which the value should be stored. This address is called the
"structure value address".
This section describes how to control returning structure values in
memory.
`RETURN_IN_MEMORY (TYPE)'
A C expression which can inhibit the returning of certain function
values in registers, based on the type of value. A nonzero value
says to return the function value in memory, just as large
structures are 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' 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 1 for `BLKmode' values, and 0
otherwise.
Do not use this macro to indicate that structures and unions
should always be returned in memory. You should instead use
`DEFAULT_PCC_STRUCT_RETURN' to indicate this.
`DEFAULT_PCC_STRUCT_RETURN'
Define this macro to be 1 if all structure and union return values
must be in memory. Since this results in slower code, this should
be defined only if needed for compatibility with other compilers
or with an ABI. If you define this macro to be 0, then the
conventions used for structure and union return values are decided
by the `RETURN_IN_MEMORY' macro.
If not defined, this defaults to the value 1.
`STRUCT_VALUE_REGNUM'
If the structure value address is passed in a register, then
`STRUCT_VALUE_REGNUM' should be the number of that register.
`STRUCT_VALUE'
If the structure value address is not passed in a register, define
`STRUCT_VALUE' as an expression returning an RTX for the place
where the address is passed. If it returns 0, the address is
passed as an "invisible" first argument.
`STRUCT_VALUE_INCOMING_REGNUM'
On some architectures the place where the structure value address
is found by the called function is not the same place that the
caller put it. This can be due to register windows, or it could
be because the function prologue moves it to a different place.
If the incoming location of the structure value address is in a
register, define this macro as the register number.
`STRUCT_VALUE_INCOMING'
If the incoming location is not a register, then you should define
`STRUCT_VALUE_INCOMING' as an expression for an RTX for where the