home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 4
/
FreshFish_May-June1994.bin
/
gnu
/
info
/
gcc.info-13
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-02-20
|
51KB
|
872 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: Insns, Next: Calls, Prev: Assembler, Up: RTL
Insns
=====
The RTL representation of the code for a function is a doubly-linked
chain of objects called "insns". Insns are expressions with special
codes that are used for no other purpose. Some insns are actual
instructions; others represent dispatch tables for `switch' statements;
others represent labels to jump to or various sorts of declarative
information.
In addition to its own specific data, each insn must have a unique
id-number that distinguishes it from all other insns in the current
function (after delayed branch scheduling, copies of an insn with the
same id-number may be present in multiple places in a function, but
these copies will always be identical and will only appear inside a
`sequence'), and chain pointers to the preceding and following insns.
These three fields occupy the same position in every insn, independent
of the expression code of the insn. They could be accessed with `XEXP'
and `XINT', but instead three special macros are always used:
`INSN_UID (I)'
Accesses the unique id of insn I.
`PREV_INSN (I)'
Accesses the chain pointer to the insn preceding I. If I is the
first insn, this is a null pointer.
`NEXT_INSN (I)'
Accesses the chain pointer to the insn following I. If I is the
last insn, this is a null pointer.
The first insn in the chain is obtained by calling `get_insns'; the
last insn is the result of calling `get_last_insn'. Within the chain
delimited by these insns, the `NEXT_INSN' and `PREV_INSN' pointers must
always correspond: if INSN is not the first insn,
NEXT_INSN (PREV_INSN (INSN)) == INSN
is always true and if INSN is not the last insn,
PREV_INSN (NEXT_INSN (INSN)) == INSN
is always true.
After delay slot scheduling, some of the insns in the chain might be
`sequence' expressions, which contain a vector of insns. The value of
`NEXT_INSN' in all but the last of these insns is the next insn in the
vector; the value of `NEXT_INSN' of the last insn in the vector is the
same as the value of `NEXT_INSN' for the `sequence' in which it is
contained. Similar rules apply for `PREV_INSN'.
This means that the above invariants are not necessarily true for
insns inside `sequence' expressions. Specifically, if INSN is the
first insn in a `sequence', `NEXT_INSN (PREV_INSN (INSN))' is the insn
containing the `sequence' expression, as is the value of `PREV_INSN
(NEXT_INSN (INSN))' is INSN is the last insn in the `sequence'
expression. You can use these expressions to find the containing
`sequence' expression.
Every insn has one of the following six expression codes:
`insn'
The expression code `insn' is used for instructions that do not
jump and do not do function calls. `sequence' expressions are
always contained in insns with code `insn' even if one of those
insns should jump or do function calls.
Insns with code `insn' have four additional fields beyond the three
mandatory ones listed above. These four are described in a table
below.
`jump_insn'
The expression code `jump_insn' is used for instructions that may
jump (or, more generally, may contain `label_ref' expressions). If
there is an instruction to return from the current function, it is
recorded as a `jump_insn'.
`jump_insn' insns have the same extra fields as `insn' insns,
accessed in the same way and in addition contains a field
`JUMP_LABEL' which is defined once jump optimization has completed.
For simple conditional and unconditional jumps, this field
contains the `code_label' to which this insn will (possibly
conditionally) branch. In a more complex jump, `JUMP_LABEL'
records one of the labels that the insn refers to; the only way to
find the others is to scan the entire body of the insn.
Return insns count as jumps, but since they do not refer to any
labels, they have zero in the `JUMP_LABEL' field.
`call_insn'
The expression code `call_insn' is used for instructions that may
do function calls. It is important to distinguish these
instructions because they imply that certain registers and memory
locations may be altered unpredictably.
A `call_insn' insn may be preceded by insns that contain a single
`use' expression and be followed by insns the contain a single
`clobber' expression. If so, these `use' and `clobber'
expressions are treated as being part of the function call. There
must not even be a `note' between the `call_insn' and the `use' or
`clobber' insns for this special treatment to take place. This is
somewhat of a kludge and will be removed in a later version of GNU
CC.
`call_insn' insns have the same extra fields as `insn' insns,
accessed in the same way.
`code_label'
A `code_label' insn represents a label that a jump insn can jump
to. It contains two special fields of data in addition to the
three standard ones. `CODE_LABEL_NUMBER' is used to hold the
"label number", a number that identifies this label uniquely among
all the labels in the compilation (not just in the current
function). Ultimately, the label is represented in the assembler
output as an assembler label, usually of the form `LN' where N is
the label number.
When a `code_label' appears in an RTL expression, it normally
appears within a `label_ref' which represents the address of the
label, as a number.
The field `LABEL_NUSES' is only defined once the jump optimization
phase is completed and contains the number of times this label is
referenced in the current function.
`barrier'
Barriers are placed in the instruction stream when control cannot
flow past them. They are placed after unconditional jump
instructions to indicate that the jumps are unconditional and
after calls to `volatile' functions, which do not return (e.g.,
`exit'). They contain no information beyond the three standard
fields.
`note'
`note' insns are used to represent additional debugging and
declarative information. They contain two nonstandard fields, an
integer which is accessed with the macro `NOTE_LINE_NUMBER' and a
string accessed with `NOTE_SOURCE_FILE'.
If `NOTE_LINE_NUMBER' is positive, the note represents the
position of a source line and `NOTE_SOURCE_FILE' is the source
file name that the line came from. These notes control generation
of line number data in the assembler output.
Otherwise, `NOTE_LINE_NUMBER' is not really a line number but a
code with one of the following values (and `NOTE_SOURCE_FILE' must
contain a null pointer):
`NOTE_INSN_DELETED'
Such a note is completely ignorable. Some passes of the
compiler delete insns by altering