home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / info / gcc.info-20 (.txt) < prev    next >
GNU Info File  |  1994-12-22  |  51KB  |  864 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 675 Massachusetts Avenue
  5. Cambridge, MA 02139 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993, 1994 Free Software Foundation,
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.    Permission is granted to copy and distribute modified versions of
  11. this manual under the conditions for verbatim copying, provided also
  12. that the sections entitled "GNU General Public License," "Funding for
  13. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  14. included exactly as in the original, and provided that the entire
  15. resulting derived work is distributed under the terms of a permission
  16. notice identical to this one.
  17.    Permission is granted to copy and distribute translations of this
  18. manual into another language, under the above conditions for modified
  19. versions, except that the sections entitled "GNU General Public
  20. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  21. `Look And Feel'", and this permission notice, may be included in
  22. translations approved by the Free Software Foundation instead of in the
  23. original English.
  24. File: gcc.info,  Node: Scalar Return,  Next: Aggregate Return,  Prev: Register Arguments,  Up: Stack and Calling
  25. How Scalar Function Values Are Returned
  26. ---------------------------------------
  27.    This section discusses the macros that control returning scalars as
  28. values--values that can fit in registers.
  29. `TRADITIONAL_RETURN_FLOAT'
  30.      Define this macro if `-traditional' should not cause functions
  31.      declared to return `float' to convert the value to `double'.
  32. `FUNCTION_VALUE (VALTYPE, FUNC)'
  33.      A C expression to create an RTX representing the place where a
  34.      function returns a value of data type VALTYPE.  VALTYPE is a tree
  35.      node representing a data type.  Write `TYPE_MODE (VALTYPE)' to get
  36.      the machine mode used to represent that type.  On many machines,
  37.      only the mode is relevant.  (Actually, on most machines, scalar
  38.      values are returned in the same place regardless of mode).
  39.      If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same
  40.      promotion rules specified in `PROMOTE_MODE' if VALTYPE is a scalar
  41.      type.
  42.      If the precise function being called is known, FUNC is a tree node
  43.      (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer.  This
  44.      makes it possible to use a different value-returning convention
  45.      for specific functions when all their calls are known.
  46.      `FUNCTION_VALUE' is not used for return vales with aggregate data
  47.      types, because these are returned in another way.  See
  48.      `STRUCT_VALUE_REGNUM' and related macros, below.
  49. `FUNCTION_OUTGOING_VALUE (VALTYPE, FUNC)'
  50.      Define this macro if the target machine has "register windows" so
  51.      that the register in which a function returns its value is not the
  52.      same as the one in which the caller sees the value.
  53.      For such machines, `FUNCTION_VALUE' computes the register in which
  54.      the caller will see the value.  `FUNCTION_OUTGOING_VALUE' should be
  55.      defined in a similar fashion to tell the function where to put the
  56.      value.
  57.      If `FUNCTION_OUTGOING_VALUE' is not defined, `FUNCTION_VALUE'
  58.      serves both purposes.
  59.      `FUNCTION_OUTGOING_VALUE' is not used for return vales with
  60.      aggregate data types, because these are returned in another way.
  61.      See `STRUCT_VALUE_REGNUM' and related macros, below.
  62. `LIBCALL_VALUE (MODE)'
  63.      A C expression to create an RTX representing the place where a
  64.      library function returns a value of mode MODE.  If the precise
  65.      function being called is known, FUNC is a tree node
  66.      (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer.  This
  67.      makes it possible to use a different value-returning convention
  68.      for specific functions when all their calls are known.
  69.      Note that "library function" in this context means a compiler
  70.      support routine, used to perform arithmetic, whose name is known
  71.      specially by the compiler and was not mentioned in the C code being
  72.      compiled.
  73.      The definition of `LIBRARY_VALUE' need not be concerned aggregate
  74.      data types, because none of the library functions returns such
  75.      types.
  76. `FUNCTION_VALUE_REGNO_P (REGNO)'
  77.      A C expression that is nonzero if REGNO is the number of a hard
  78.      register in which the values of called function may come back.
  79.      A register whose use for returning values is limited to serving as
  80.      the second of a pair (for a value of type `double', say) need not
  81.      be recognized by this macro.  So for most machines, this definition
  82.      suffices:
  83.           #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
  84.      If the machine has register windows, so that the caller and the
  85.      called function use different registers for the return value, this
  86.      macro should recognize only the caller's register numbers.
  87. `APPLY_RESULT_SIZE'
  88.      Define this macro if `untyped_call' and `untyped_return' need more
  89.      space than is implied by `FUNCTION_VALUE_REGNO_P' for saving and
  90.      restoring an arbitrary return value.
  91. File: gcc.info,  Node: Aggregate Return,  Next: Caller Saves,  Prev: Scalar Return,  Up: Stack and Calling
  92. How Large Values Are Returned
  93. -----------------------------
  94.    When a function value's mode is `BLKmode' (and in some other cases),
  95. the value is not returned according to `FUNCTION_VALUE' (*note Scalar
  96. Return::.).  Instead, the caller passes the address of a block of
  97. memory in which the value should be stored.  This address is called the
  98. "structure value address".
  99.    This section describes how to control returning structure values in
  100. memory.
  101. `RETURN_IN_MEMORY (TYPE)'
  102.      A C expression which can inhibit the returning of certain function
  103.      values in registers, based on the type of value.  A nonzero value
  104.      says to return the function value in memory, just as large
  105.      structures are always returned.  Here TYPE will be a C expression
  106.      of type `tree', representing the data type of the value.
  107.      Note that values of mode `BLKmode' must be explicitly handled by
  108.      this macro.  Also, the option `-fpcc-struct-return' takes effect
  109.      regardless of this macro.  On most systems, it is possible to
  110.      leave the macro undefined; this causes a default definition to be
  111.      used, whose value is the constant 1 for `BLKmode' values, and 0
  112.      otherwise.
  113.      Do not use this macro to indicate that structures and unions
  114.      should always be returned in memory.  You should instead use
  115.      `DEFAULT_PCC_STRUCT_RETURN' to indicate this.
  116. `DEFAULT_PCC_STRUCT_RETURN'
  117.      Define this macro to be 1 if all structure and union return values
  118.      must be in memory.  Since this results in slower code, this should
  119.      be defined only if needed for compatibility with other compilers
  120.      or with an ABI.  If you define this macro to be 0, then the
  121.      conventions used for structure and union return values are decided
  122.      by the `RETURN_IN_MEMORY' macro.
  123.      If not defined, this defaults to the value 1.
  124. `STRUCT_VALUE_REGNUM'
  125.      If the structure value address is passed in a register, then
  126.      `STRUCT_VALUE_REGNUM' should be the number of that register.
  127. `STRUCT_VALUE'
  128.      If the structure value address is not passed in a register, define
  129.      `STRUCT_VALUE' as an expression returning an RTX for the place
  130.      where the address is passed.  If it returns 0, the address is
  131.      passed as an "invisible" first argument.
  132. `STRUCT_VALUE_INCOMING_REGNUM'
  133.      On some architectures the place where the structure value address
  134.      is found by the called function is not the same place that the
  135.      caller put it.  This can be due to register windows, or it could
  136.      be because the function prologue moves it to a different place.
  137.      If the incoming location of the structure value address is in a
  138.      register, define this macro as the register number.
  139. `STRUCT_VALUE_INCOMING'
  140.      If the incoming location is not a register, then you should define
  141.      `