home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 7
/
FreshFishVol7.bin
/
bbs
/
gnu
/
gcc-2.3.3-src.lha
/
GNU
/
src
/
amiga
/
gcc-2.3.3
/
gcc.info-9
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-02-06
|
51KB
|
943 lines
This is Info file gcc.info, produced by Makeinfo-1.49 from the input
file gcc.texi.
This file documents the use and the internals of the GNU compiler.
Copyright (C) 1988, 1989, 1992 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: Accessors, Next: Flags, Prev: RTL Objects, Up: RTL
Access to Operands
==================
For each expression type `rtl.def' specifies the number of contained
objects and their kinds, with four possibilities: `e' for expression
(actually a pointer to an expression), `i' for integer, `w' for wide
integer, `s' for string, and `E' for vector of expressions. The
sequence of letters for an expression code is called its "format".
Thus, the format of `subreg' is `ei'.
A few other format characters are used occasionally:
`u' is equivalent to `e' except that it is printed differently in
debugging dumps. It is used for pointers to insns.
`n' is equivalent to `i' except that it is printed differently in
debugging dumps. It is used for the line number or code number of
a `note' insn.
`S' indicates a string which is optional. In the RTL objects in
core, `S' is equivalent to `s', but when the object is read, from
an `md' file, the string value of this operand may be omitted. An
omitted string is taken to be the null string.
`V' indicates a vector which is optional. In the RTL objects in
core, `V' is equivalent to `E', but when the object is read from
an `md' file, the vector value of this operand may be omitted. An
omitted vector is effectively the same as a vector of no elements.
`0' means a slot whose contents do not fit any normal category.
`0' slots are not printed at all in dumps, and are often used in
special ways by small parts of the compiler.
There are macros to get the number of operands, the format, and the
class of an expression code:
`GET_RTX_LENGTH (CODE)'
Number of operands of an RTX of code CODE.
`GET_RTX_FORMAT (CODE)'
The format of an RTX of code CODE, as a C string.
`GET_RTX_CLASS (CODE)'
A single character representing the type of RTX operation that code
CODE performs.
The following classes are defined:
`o'
An RTX code that represents an actual object, such as `reg' or
`mem'. `subreg' is not in this class.
`<'
An RTX code for a comparison. The codes in this class are
`NE', `EQ', `LE', `LT', `GE', `GT', `LEU', `LTU', `GEU',
`GTU'.
`1'
An RTX code for a unary arithmetic operation, such as `neg'.
`c'
An RTX code for a commutative binary operation, other than
`NE' and `EQ' (which have class `<').
`2'
An RTX code for a noncommutative binary operation, such as
`MINUS'.
`b'
An RTX code for a bitfield operation (`ZERO_EXTRACT' and
`SIGN_EXTRACT').
`3'
An RTX code for other three input operations, such as
`IF_THEN_ELSE'.
`i'
An RTX code for a machine insn (`INSN', `JUMP_INSN', and
`CALL_INSN').
`m'
An RTX code for something that matches in insns, such as
`MATCH_DUP'.
`x'
All other RTX codes.
Operands of expressions are accessed using the macros `XEXP',
`XINT', `XWINT' and `XSTR'. Each of these macros takes two arguments:
an expression-pointer (RTX) and an operand number (counting from zero).
Thus,
XEXP (X, 2)
accesses operand 2 of expression X, as an expression.
XINT (X, 2)
accesses the same operand as an integer. `XSTR', used in the same
fashion, would access it as a string.
Any operand can be accessed as an integer, as an expression or as a
string. You must choose the correct method of access for the kind of
value actually stored in the operand. You would do this based on the
expression code of the containing expression. That is also how you
would know how many operands there are.
For example, if X is a `subreg' expression, you know that it has two
operands which can be correctly accessed as `XEXP (X, 0)' and `XINT (X,
1)'. If you did `XINT (X, 0)', you would get the address of the
expression operand but cast as an integer; that might occasionally be
useful, but it would be cleaner to write `(int) XEXP (X, 0)'. `XEXP
(X, 1)' would also compile without error, and would return the second,
integer operand cast as an expression pointer, which would probably
result in a crash when accessed. Nothing stops you from writing `XEXP
(X, 28)' either, but this will access memory past the end of the
expression with unpredictable results.
Access to operands which are vectors is more complicated. You can
use the macro `XVEC' to get the vector-pointer itself, or the macros
`XVECEXP' and `XVECLEN' to access the elements and length of a vector.
`XVEC (EXP, IDX)'
Access the vector-pointer which is operand number IDX in EXP.
`XVECLEN (EXP, IDX)'
Access the length (number of elements) in the vector which is in
operand number IDX in EXP. This value is an `int'.
`XVECEXP (EXP, IDX, ELTNUM)'
Access element number ELTNUM in the vector which is in operand
number IDX in EXP. This value is an RTX.
It is up to you to make sure that ELTNUM is not negative and is
less than `XVECLEN (EXP, IDX)'.
All the macros defined in this section expand into lvalues and
therefore can be used to assign the operands, lengths and vector
elements as well as to access them.
File: gcc.info, Node: Flags, Next: Machine Modes, Prev: Accessors, Up: RTL
Flags in an RTL Expression
==========================
RTL expressions contain several flags (one-bit bit-fields) that are
used in certain types of expression. Most often they are accessed with
the following macros:
`MEM_VOLATILE_P (X)'
In `mem' expressions, nonzero for volatile memory references.
Stored in the `volatil' field and printed as `/v'.
`MEM_IN_STRUCT_P (X)'
In `mem' expressions, nonzero for reference to an entire
structure, union or array, or to a component of one. Zero for
references to a scalar variable or through a pointer to a scalar.
Stored in the `in_struct' field and printed as `/s'.
`REG_LOOP_TEST_P'
In `reg' expressions, nonzero if this register's entire life is
contained in the exit test code for some loop. Stored in the
`in_struct' field and printed as `/s'.
`REG_USERVAR_P (X)'
In a `reg', nonzero if it corresponds to a variable present in the
user's source code. Zero for temporaries generated internally by
the compiler. Stored in the `volatil' field and printed as `/v'.
`REG_FUNCTION_VALUE_P (X)'
Nonzero in a `reg' if it is the place in which this function's
value is going to be returned. (This happens only in a hard
register.) Stored in the `integrated' field and printed as `/i'.
The same hard register may be used also for collecting the values
of functions called by this one, but `REG_FUNCTION_VALUE_P' is zero
in this kind of use.
`SUBREG_PROMOTED_VAR_P'
Nonzero in a `subreg' if it was made when accessing an object that
was promoted to a wider mode in accord with the `PROMOTED_MODE'
machine des