home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / gcc-2.5.8-bin.lha / info / gcc.info-12 (.txt) < prev    next >
GNU Info File  |  1994-02-21  |  45KB  |  790 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: Regs and Memory,  Next: Arithmetic,  Prev: Constants,  Up: RTL
  23. Registers and Memory
  24. ====================
  25.    Here are the RTL expression types for describing access to machine
  26. registers and to main memory.
  27. `(reg:M N)'
  28.      For small values of the integer N (those that are less than
  29.      `FIRST_PSEUDO_REGISTER'), this stands for a reference to machine
  30.      register number N: a "hard register".  For larger values of N, it
  31.      stands for a temporary value or "pseudo register".  The compiler's
  32.      strategy is to generate code assuming an unlimited number of such
  33.      pseudo registers, and later convert them into hard registers or
  34.      into memory references.
  35.      M is the machine mode of the reference.  It is necessary because
  36.      machines can generally refer to each register in more than one
  37.      mode.  For example, a register may contain a full word but there
  38.      may be instructions to refer to it as a half word or as a single
  39.      byte, as well as instructions to refer to it as a floating point
  40.      number of various precisions.
  41.      Even for a register that the machine can access in only one mode,
  42.      the mode must always be specified.
  43.      The symbol `FIRST_PSEUDO_REGISTER' is defined by the machine
  44.      description, since the number of hard registers on the machine is
  45.      an invariant characteristic of the machine.  Note, however, that
  46.      not all of the machine registers must be general registers.  All
  47.      the machine registers that can be used for storage of data are
  48.      given hard register numbers, even those that can be used only in
  49.      certain instructions or can hold only certain types of data.
  50.      A hard register may be accessed in various modes throughout one
  51.      function, but each pseudo register is given a natural mode and is
  52.      accessed only in that mode.  When it is necessary to describe an
  53.      access to a pseudo register using a nonnatural mode, a `subreg'
  54.      expression is used.
  55.      A `reg' expression with a machine mode that specifies more than
  56.      one word of data may actually stand for several consecutive
  57.      registers.  If in addition the register number specifies a
  58.      hardware register, then it actually represents several consecutive
  59.      hardware registers starting with the specified one.
  60.      Each pseudo register number used in a function's RTL code is
  61.      represented by a unique `reg' expression.
  62.      Some pseudo register numbers, those within the range of
  63.      `FIRST_VIRTUAL_REGISTER' to `LAST_VIRTUAL_REGISTER' only appear
  64.      during the RTL generation phase and are eliminated before the
  65.      optimization phases.  These represent locations in the stack frame
  66.      that cannot be determined until RTL generation for the function
  67.      has been completed.  The following virtual register numbers are
  68.      defined:
  69.     `VIRTUAL_INCOMING_ARGS_REGNUM'
  70.           This points to the first word of the incoming arguments
  71.           passed on the stack.  Normally these arguments are placed
  72.           there by the caller, but the callee may have pushed some
  73.           arguments that were previously passed in registers.
  74.           When RTL generation is complete, this virtual register is
  75.           replaced by the sum of the register given by
  76.           `ARG_POINTER_REGNUM' and the value of `FIRST_PARM_OFFSET'.
  77.     `VIRTUAL_STACK_VARS_REGNUM'
  78.           If `FRAME_GROWS_DOWNWARD' is defined, this points to
  79.           immediately above the first variable on the stack.
  80.           Otherwise, it points to the first variable on the stack.
  81.           `VIRTUAL_STACK_VARS_REGNUM' is replaced with the sum of the
  82.           register given by `FRAME_POINTER_REGNUM' and the value
  83.           `STARTING_FRAME_OFFSET'.
  84.     `VIRTUAL_STACK_DYNAMIC_REGNUM'
  85.           This points to the location of dynamically allocated memory
  86.           on the stack immediately after the stack pointer has been
  87.           adjusted by the amount of memory desired.
  88.           This virtual register is replaced by the sum of the register
  89.           given by `STACK_POINTER_REGNUM' and the value
  90.           `STACK_DYNAMIC_OFFSET'.
  91.     `VIRTUAL_OUTGOING_ARGS_REGNUM'
  92.           This points to the location in the stack at which outgoing
  93.           arguments should be written when the stack is pre-pushed
  94.           (arguments pushed using push insns should always use
  95.           `STACK_POINTER_REGNUM').
  96.           This virtual register is replaced by the sum of the register
  97.           given by `STACK_POINTER_REGNUM' and the value
  98.           `STACK_POINTER_OFFSET'.
  99. `(subreg:M REG WORDNUM)'
  100.      `subreg' expressions are used to refer to a register in a machine
  101.      mode other than its natural one, or to refer to one register of a
  102.      multi-word `reg' that actually refers to several registers.
  103.      Each pseudo-register has a natural mode.  If it is necessary to
  104.      operate on it in a different mode--for example, to perform a
  105.      fullword move instruction on a pseudo-register that contains a
  106.      single byte--the pseudo-register must be enclosed in a `subreg'.
  107.      In such a case, WORDNUM is zero.
  108.      Usually M is at least as narrow as the mode of REG, in which case
  109.      it is restricting consideration to only the bits of REG that are
  110.      in M.
  111.      Sometimes M is wider than the mode of REG.  These `subreg'
  112.      expressions are often called "paradoxical".  They are used in
  113.      cases where we want to refer to an object in a wider mode but do
  114.      not care what value the additional bits have.  The reload pass
  115.      ensures that paradoxical references are only made to hard
  116.      registers.
  117.      The other use of `subreg' is to extract the individual registers of
  118.      a multi-register value.  Machine modes such as `DImode' and
  119.      `TImode' can indicate values longer than a word, values which
  120.      usually require two or more consecutive registers.  To access one
  121.      of the registers, use a `subreg' with mode `SImode' and a WORDNUM
  122.      that says which register.
  123.      Storing in a non-paradoxical `subreg' has undefined results for
  124.      bits belonging to the same word as the `subreg'.  This laxity makes
  125.      it easier to generate efficient code for such instructions.  To
  126.      represent an instruction that preserves all the bits outside of
  127.      those in the `subreg', use `strict_low_part' around the `subreg'.
  128.      The compilation parameter `WORDS_BIG_ENDIAN', if set to 1, says
  129.      that word number zero is the most significant part; otherwise, it
  130.      is the least significant part.
  131.      Between the combiner pass and the reload pass, it is possible to
  132.      have a paradoxical `subreg' which contains a `mem' instead of a
  133.      `reg' as its first operand.  After the reload pass, it is also
  134.      possible to have a non-paradoxical `subreg' which contains a
  135.      `mem'; this usually occurs when the `mem' is a stack slot which
  136.      replaced a pseudo register.
  137.      Note that it is not valid to access a `DFmode