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