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-12
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-07-11
|
45KB
|
790 lines
This is Info file gcc.info, produced by Makeinfo-1.55 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: Regs and Memory, Next: Arithmetic, Prev: Constants, Up: RTL
Registers and Memory
====================
Here are the RTL expression types for describing access to machine
registers and to main memory.
`(reg:M N)'
For small values of the integer N (those that are less than
`FIRST_PSEUDO_REGISTER'), this stands for a reference to machine
register number N: a "hard register". For larger values of N, it
stands for a temporary value or "pseudo register". The compiler's
strategy is to generate code assuming an unlimited number of such
pseudo registers, and later convert them into hard registers or
into memory references.
M is the machine mode of the reference. It is necessary because
machines can generally refer to each register in more than one
mode. For example, a register may contain a full word but there
may be instructions to refer to it as a half word or as a single
byte, as well as instructions to refer to it as a floating point
number of various precisions.
Even for a register that the machine can access in only one mode,
the mode must always be specified.
The symbol `FIRST_PSEUDO_REGISTER' is defined by the machine
description, since the number of hard registers on the machine is
an invariant characteristic of the machine. Note, however, that
not all of the machine registers must be general registers. All
the machine registers that can be used for storage of data are
given hard register numbers, even those that can be used only in
certain instructions or can hold only certain types of data.
A hard register may be accessed in various modes throughout one
function, but each pseudo register is given a natural mode and is
accessed only in that mode. When it is necessary to describe an
access to a pseudo register using a nonnatural mode, a `subreg'
expression is used.
A `reg' expression with a machine mode that specifies more than
one word of data may actually stand for several consecutive
registers. If in addition the register number specifies a
hardware register, then it actually represents several consecutive
hardware registers starting with the specified one.
Each pseudo register number used in a function's RTL code is
represented by a unique `reg' expression.
Some pseudo register numbers, those within the range of
`FIRST_VIRTUAL_REGISTER' to `LAST_VIRTUAL_REGISTER' only appear
during the RTL generation phase and are eliminated before the
optimization phases. These represent locations in the stack frame
that cannot be determined until RTL generation for the function
has been completed. The following virtual register numbers are
defined:
`VIRTUAL_INCOMING_ARGS_REGNUM'
This points to the first word of the incoming arguments
passed on the stack. Normally these arguments are placed
there by the caller, but the callee may have pushed some
arguments that were previously passed in registers.
When RTL generation is complete, this virtual register is
replaced by the sum of the register given by
`ARG_POINTER_REGNUM' and the value of `FIRST_PARM_OFFSET'.
`VIRTUAL_STACK_VARS_REGNUM'
If `FRAME_GROWS_DOWNWARD' is defined, this points to
immediately above the first variable on the stack.
Otherwise, it points to the first variable on the stack.
`VIRTUAL_STACK_VARS_REGNUM' is replaced with the sum of the
register given by `FRAME_POINTER_REGNUM' and the value
`STARTING_FRAME_OFFSET'.
`VIRTUAL_STACK_DYNAMIC_REGNUM'
This points to the location of dynamically allocated memory
on the stack immediately after the stack pointer has been
adjusted by the amount of memory desired.
This virtual register is replaced by the sum of the register
given by `STACK_POINTER_REGNUM' and the value
`STACK_DYNAMIC_OFFSET'.
`VIRTUAL_OUTGOING_ARGS_REGNUM'
This points to the location in the stack at which outgoing
arguments should be written when the stack is pre-pushed
(arguments pushed using push insns should always use
`STACK_POINTER_REGNUM').
This virtual register is replaced by the sum of the register
given by `STACK_POINTER_REGNUM' and the value
`STACK_POINTER_OFFSET'.
`(subreg:M REG WORDNUM)'
`subreg' expressions are used to refer to a register in a machine
mode other than its natural one, or to refer to one register of a
multi-word `reg' that actually refers to several registers.
Each pseudo-register has a natural mode. If it is necessary to
operate on it in a different mode--for example, to perform a
fullword move instruction on a pseudo-register that contains a
single byte--the pseudo-register must be enclosed in a `subreg'.
In such a case, WORDNUM is zero.
Usually M is at least as narrow as the mode of REG, in which case
it is restricting consideration to only the bits of REG that are
in M.
Sometimes M is wider than the mode of REG. These `subreg'
expressions are often called "paradoxical". They are used in
cases where we want to refer to an object in a wider mode but do
not care what value the additional bits have. The reload pass
ensures that paradoxical references are only made to hard
registers.
The other use of `subreg' is to extract the individual registers of
a multi-register value. Machine modes such as `DImode' and
`TImode' can indicate values longer than a word, values which
usually require two or more consecutive registers. To access one
of the registers, use a `subreg' with mode `SImode' and a WORDNUM
that says which register.
Storing in a non-paradoxical `subreg' has undefined results for
bits belonging to the same word as the `subreg'. This laxity makes
it easier to generate efficient code for such instructions. To
represent an instruction that preserves all the bits outside of
those in the `subreg', use `strict_low_part' around the `subreg'.
The compilation parameter `WORDS_BIG_ENDIAN', if set to 1, says
that word number zero is the most significant part; otherwise, it
is the least significant part.
Between the combiner pass and the reload pass, it is possible to
have a paradoxical `subreg' which contains a `mem' instead of a
`reg' as its first operand. After the reload pass, it is also
possible to have a non-paradoxical `subreg' which contains a
`mem'; this usually occurs when the `mem' is a stack slot which
replaced a pseudo register.
Note that it is not valid to access a `DFmode