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 >
GNU Info File  |  1994-02-06  |  51KB  |  943 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.49 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Copyright (C) 1988, 1989, 1992 Free Software Foundation, Inc.
  5.    Permission is granted to make and distribute verbatim copies of this
  6. manual provided the copyright notice and this permission notice are
  7. preserved on all copies.
  8.    Permission is granted to copy and distribute modified versions of
  9. this manual under the conditions for verbatim copying, provided also
  10. that the sections entitled "GNU General Public License" and "Protect
  11. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  12. original, and provided that the entire resulting derived work is
  13. distributed under the terms of a permission notice identical to this
  14.    Permission is granted to copy and distribute translations of this
  15. manual into another language, under the above conditions for modified
  16. versions, except that the sections entitled "GNU General Public
  17. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  18. permission notice, may be included in translations approved by the Free
  19. Software Foundation instead of in the original English.
  20. File: gcc.info,  Node: Accessors,  Next: Flags,  Prev: RTL Objects,  Up: RTL
  21. Access to Operands
  22. ==================
  23.    For each expression type `rtl.def' specifies the number of contained
  24. objects and their kinds, with four possibilities: `e' for expression
  25. (actually a pointer to an expression), `i' for integer, `w' for wide
  26. integer, `s' for string, and `E' for vector of expressions.  The
  27. sequence of letters for an expression code is called its "format". 
  28. Thus, the format of `subreg' is `ei'.
  29.    A few other format characters are used occasionally:
  30.      `u' is equivalent to `e' except that it is printed differently in
  31.      debugging dumps.  It is used for pointers to insns.
  32.      `n' is equivalent to `i' except that it is printed differently in
  33.      debugging dumps.  It is used for the line number or code number of
  34.      a `note' insn.
  35.      `S' indicates a string which is optional.  In the RTL objects in
  36.      core, `S' is equivalent to `s', but when the object is read, from
  37.      an `md' file, the string value of this operand may be omitted. An
  38.      omitted string is taken to be the null string.
  39.      `V' indicates a vector which is optional.  In the RTL objects in
  40.      core, `V' is equivalent to `E', but when the object is read from
  41.      an `md' file, the vector value of this operand may be omitted. An
  42.      omitted vector is effectively the same as a vector of no elements.
  43.      `0' means a slot whose contents do not fit any normal category.
  44.      `0' slots are not printed at all in dumps, and are often used in
  45.      special ways by small parts of the compiler.
  46.    There are macros to get the number of operands, the format, and the
  47. class of an expression code:
  48. `GET_RTX_LENGTH (CODE)'
  49.      Number of operands of an RTX of code CODE.
  50. `GET_RTX_FORMAT (CODE)'
  51.      The format of an RTX of code CODE, as a C string.
  52. `GET_RTX_CLASS (CODE)'
  53.      A single character representing the type of RTX operation that code
  54.      CODE performs.
  55.      The following classes are defined:
  56.     `o'
  57.           An RTX code that represents an actual object, such as `reg' or
  58.           `mem'.  `subreg' is not in this class.
  59.     `<'
  60.           An RTX code for a comparison.  The codes in this class are
  61.           `NE', `EQ', `LE', `LT', `GE', `GT', `LEU', `LTU', `GEU',
  62.           `GTU'.
  63.     `1'
  64.           An RTX code for a unary arithmetic operation, such as `neg'.
  65.     `c'
  66.           An RTX code for a commutative binary operation, other than
  67.           `NE' and `EQ' (which have class `<').
  68.     `2'
  69.           An RTX code for a noncommutative binary operation, such as
  70.           `MINUS'.
  71.     `b'
  72.           An RTX code for a bitfield operation (`ZERO_EXTRACT' and
  73.           `SIGN_EXTRACT').
  74.     `3'
  75.           An RTX code for other three input operations, such as
  76.           `IF_THEN_ELSE'.
  77.     `i'
  78.           An RTX code for a machine insn (`INSN', `JUMP_INSN', and
  79.           `CALL_INSN').
  80.     `m'
  81.           An RTX code for something that matches in insns, such as
  82.           `MATCH_DUP'.
  83.     `x'
  84.           All other RTX codes.
  85.    Operands of expressions are accessed using the macros `XEXP',
  86. `XINT', `XWINT' and `XSTR'.  Each of these macros takes two arguments:
  87. an expression-pointer (RTX) and an operand number (counting from zero).
  88.  Thus,
  89.      XEXP (X, 2)
  90. accesses operand 2 of expression X, as an expression.
  91.      XINT (X, 2)
  92. accesses the same operand as an integer.  `XSTR', used in the same
  93. fashion, would access it as a string.
  94.    Any operand can be accessed as an integer, as an expression or as a
  95. string. You must choose the correct method of access for the kind of
  96. value actually stored in the operand.  You would do this based on the
  97. expression code of the containing expression.  That is also how you
  98. would know how many operands there are.
  99.    For example, if X is a `subreg' expression, you know that it has two
  100. operands which can be correctly accessed as `XEXP (X, 0)' and `XINT (X,
  101. 1)'.  If you did `XINT (X, 0)', you would get the address of the
  102. expression operand but cast as an integer; that might occasionally be
  103. useful, but it would be cleaner to write `(int) XEXP (X, 0)'.  `XEXP
  104. (X, 1)' would also compile without error, and would return the second,
  105. integer operand cast as an expression pointer, which would probably
  106. result in a crash when accessed.  Nothing stops you from writing `XEXP
  107. (X, 28)' either, but this will access memory past the end of the
  108. expression with unpredictable results.
  109.    Access to operands which are vectors is more complicated.  You can
  110. use the macro `XVEC' to get the vector-pointer itself, or the macros
  111. `XVECEXP' and `XVECLEN' to access the elements and length of a vector.
  112. `XVEC (EXP, IDX)'
  113.      Access the vector-pointer which is operand number IDX in EXP.
  114. `XVECLEN (EXP, IDX)'
  115.      Access the length (number of elements) in the vector which is in
  116.      operand number IDX in EXP.  This value is an `int'.
  117. `XVECEXP (EXP, IDX, ELTNUM)'
  118.      Access element number ELTNUM in the vector which is in operand
  119.      number IDX in EXP.  This value is an RTX.
  120.      It is up to you to make sure that ELTNUM is not negative and is
  121.      less than `XVECLEN (EXP, IDX)'.
  122.    All the macros defined in this section expand into lvalues and
  123. therefore can be used to assign the operands, lengths and vector
  124. elements as well as to access them.
  125. File: gcc.info,  Node: Flags,  Next: Machine Modes,  Prev: Accessors,  Up: RTL
  126. Flags in an RTL Expression
  127. ==========================
  128.    RTL expressions contain several flags (one-bit bit-fields) that are
  129. used in certain types of expression.  Most often they are accessed with
  130. the following macros:
  131. `MEM_VOLATILE_P (X)'
  132.      In `mem' expressions, nonzero for volatile memory references.
  133.      Stored in the `volatil' field and printed as `/v'.
  134. `MEM_IN_STRUCT_P (X)'
  135.      In `mem' expressions, nonzero for reference to an entire
  136.      structure, union or array, or to a component of one.  Zero for
  137.      references to a scalar variable or through a pointer to a scalar.
  138.      Stored in the `in_struct' field and printed as `/s'.
  139. `REG_LOOP_TEST_P'
  140.      In `reg' expressions, nonzero if this register's entire life is
  141.      contained in the exit test code for some loop.  Stored in the
  142.      `in_struct' field and printed as `/s'.
  143. `REG_USERVAR_P (X)'
  144.      In a `reg', nonzero if it corresponds to a variable present in the
  145.      user's source code.  Zero for temporaries generated internally by
  146.      the compiler.  Stored in the `volatil' field and printed as `/v'.
  147. `REG_FUNCTION_VALUE_P (X)'
  148.      Nonzero in a `reg' if it is the place in which this function's
  149.      value is going to be returned.  (This happens only in a hard
  150.      register.)  Stored in the `integrated' field and printed as `/i'.
  151.      The same hard register may be used also for collecting the values
  152.      of functions called by this one, but `REG_FUNCTION_VALUE_P' is zero
  153.      in this kind of use.
  154. `SUBREG_PROMOTED_VAR_P'
  155.      Nonzero in a `subreg' if it was made when accessing an object that
  156.      was promoted to a wider mode in accord with the `PROMOTED_MODE'
  157.      machine des