Special-Accessors.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2017 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>GNU Compiler Collection (GCC) Internals: Special Accessors</title>
  20. <meta name="description" content="GNU Compiler Collection (GCC) Internals: Special Accessors">
  21. <meta name="keywords" content="GNU Compiler Collection (GCC) Internals: Special Accessors">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="RTL.html#RTL" rel="up" title="RTL">
  30. <link href="Flags.html#Flags" rel="next" title="Flags">
  31. <link href="Accessors.html#Accessors" rel="prev" title="Accessors">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style:oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="Special-Accessors"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="Flags.html#Flags" accesskey="n" rel="next">Flags</a>, Previous: <a href="Accessors.html#Accessors" accesskey="p" rel="prev">Accessors</a>, Up: <a href="RTL.html#RTL" accesskey="u" rel="up">RTL</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  66. </div>
  67. <hr>
  68. <a name="Access-to-Special-Operands"></a>
  69. <h3 class="section">13.4 Access to Special Operands</h3>
  70. <a name="index-access-to-special-operands"></a>
  71. <p>Some RTL nodes have special annotations associated with them.
  72. </p>
  73. <dl compact="compact">
  74. <dt><code>MEM</code></dt>
  75. <dd><dl compact="compact">
  76. <dd><a name="index-MEM_005fALIAS_005fSET"></a>
  77. </dd>
  78. <dt><code>MEM_ALIAS_SET (<var>x</var>)</code></dt>
  79. <dd><p>If 0, <var>x</var> is not in any alias set, and may alias anything. Otherwise,
  80. <var>x</var> can only alias <code>MEM</code>s in a conflicting alias set. This value
  81. is set in a language-dependent manner in the front-end, and should not be
  82. altered in the back-end. In some front-ends, these numbers may correspond
  83. in some way to types, or other language-level entities, but they need not,
  84. and the back-end makes no such assumptions.
  85. These set numbers are tested with <code>alias_sets_conflict_p</code>.
  86. </p>
  87. <a name="index-MEM_005fEXPR"></a>
  88. </dd>
  89. <dt><code>MEM_EXPR (<var>x</var>)</code></dt>
  90. <dd><p>If this register is known to hold the value of some user-level
  91. declaration, this is that tree node. It may also be a
  92. <code>COMPONENT_REF</code>, in which case this is some field reference,
  93. and <code>TREE_OPERAND (<var>x</var>, 0)</code> contains the declaration,
  94. or another <code>COMPONENT_REF</code>, or null if there is no compile-time
  95. object associated with the reference.
  96. </p>
  97. <a name="index-MEM_005fOFFSET_005fKNOWN_005fP"></a>
  98. </dd>
  99. <dt><code>MEM_OFFSET_KNOWN_P (<var>x</var>)</code></dt>
  100. <dd><p>True if the offset of the memory reference from <code>MEM_EXPR</code> is known.
  101. &lsquo;<samp>MEM_OFFSET (<var>x</var>)</samp>&rsquo; provides the offset if so.
  102. </p>
  103. <a name="index-MEM_005fOFFSET"></a>
  104. </dd>
  105. <dt><code>MEM_OFFSET (<var>x</var>)</code></dt>
  106. <dd><p>The offset from the start of <code>MEM_EXPR</code>. The value is only valid if
  107. &lsquo;<samp>MEM_OFFSET_KNOWN_P (<var>x</var>)</samp>&rsquo; is true.
  108. </p>
  109. <a name="index-MEM_005fSIZE_005fKNOWN_005fP"></a>
  110. </dd>
  111. <dt><code>MEM_SIZE_KNOWN_P (<var>x</var>)</code></dt>
  112. <dd><p>True if the size of the memory reference is known.
  113. &lsquo;<samp>MEM_SIZE (<var>x</var>)</samp>&rsquo; provides its size if so.
  114. </p>
  115. <a name="index-MEM_005fSIZE"></a>
  116. </dd>
  117. <dt><code>MEM_SIZE (<var>x</var>)</code></dt>
  118. <dd><p>The size in bytes of the memory reference.
  119. This is mostly relevant for <code>BLKmode</code> references as otherwise
  120. the size is implied by the mode. The value is only valid if
  121. &lsquo;<samp>MEM_SIZE_KNOWN_P (<var>x</var>)</samp>&rsquo; is true.
  122. </p>
  123. <a name="index-MEM_005fALIGN"></a>
  124. </dd>
  125. <dt><code>MEM_ALIGN (<var>x</var>)</code></dt>
  126. <dd><p>The known alignment in bits of the memory reference.
  127. </p>
  128. <a name="index-MEM_005fADDR_005fSPACE"></a>
  129. </dd>
  130. <dt><code>MEM_ADDR_SPACE (<var>x</var>)</code></dt>
  131. <dd><p>The address space of the memory reference. This will commonly be zero
  132. for the generic address space.
  133. </p></dd>
  134. </dl>
  135. </dd>
  136. <dt><code>REG</code></dt>
  137. <dd><dl compact="compact">
  138. <dd><a name="index-ORIGINAL_005fREGNO"></a>
  139. </dd>
  140. <dt><code>ORIGINAL_REGNO (<var>x</var>)</code></dt>
  141. <dd><p>This field holds the number the register &ldquo;originally&rdquo; had; for a
  142. pseudo register turned into a hard reg this will hold the old pseudo
  143. register number.
  144. </p>
  145. <a name="index-REG_005fEXPR"></a>
  146. </dd>
  147. <dt><code>REG_EXPR (<var>x</var>)</code></dt>
  148. <dd><p>If this register is known to hold the value of some user-level
  149. declaration, this is that tree node.
  150. </p>
  151. <a name="index-REG_005fOFFSET"></a>
  152. </dd>
  153. <dt><code>REG_OFFSET (<var>x</var>)</code></dt>
  154. <dd><p>If this register is known to hold the value of some user-level
  155. declaration, this is the offset into that logical storage.
  156. </p></dd>
  157. </dl>
  158. </dd>
  159. <dt><code>SYMBOL_REF</code></dt>
  160. <dd><dl compact="compact">
  161. <dd><a name="index-SYMBOL_005fREF_005fDECL"></a>
  162. </dd>
  163. <dt><code>SYMBOL_REF_DECL (<var>x</var>)</code></dt>
  164. <dd><p>If the <code>symbol_ref</code> <var>x</var> was created for a <code>VAR_DECL</code> or
  165. a <code>FUNCTION_DECL</code>, that tree is recorded here. If this value is
  166. null, then <var>x</var> was created by back end code generation routines,
  167. and there is no associated front end symbol table entry.
  168. </p>
  169. <p><code>SYMBOL_REF_DECL</code> may also point to a tree of class <code>'c'</code>,
  170. that is, some sort of constant. In this case, the <code>symbol_ref</code>
  171. is an entry in the per-file constant pool; again, there is no associated
  172. front end symbol table entry.
  173. </p>
  174. <a name="index-SYMBOL_005fREF_005fCONSTANT"></a>
  175. </dd>
  176. <dt><code>SYMBOL_REF_CONSTANT (<var>x</var>)</code></dt>
  177. <dd><p>If &lsquo;<samp>CONSTANT_POOL_ADDRESS_P (<var>x</var>)</samp>&rsquo; is true, this is the constant
  178. pool entry for <var>x</var>. It is null otherwise.
  179. </p>
  180. <a name="index-SYMBOL_005fREF_005fDATA"></a>
  181. </dd>
  182. <dt><code>SYMBOL_REF_DATA (<var>x</var>)</code></dt>
  183. <dd><p>A field of opaque type used to store <code>SYMBOL_REF_DECL</code> or
  184. <code>SYMBOL_REF_CONSTANT</code>.
  185. </p>
  186. <a name="index-SYMBOL_005fREF_005fFLAGS"></a>
  187. </dd>
  188. <dt><code>SYMBOL_REF_FLAGS (<var>x</var>)</code></dt>
  189. <dd><p>In a <code>symbol_ref</code>, this is used to communicate various predicates
  190. about the symbol. Some of these are common enough to be computed by
  191. common code, some are specific to the target. The common bits are:
  192. </p>
  193. <dl compact="compact">
  194. <dd><a name="index-SYMBOL_005fREF_005fFUNCTION_005fP"></a>
  195. <a name="index-SYMBOL_005fFLAG_005fFUNCTION"></a>
  196. </dd>
  197. <dt><code>SYMBOL_FLAG_FUNCTION</code></dt>
  198. <dd><p>Set if the symbol refers to a function.
  199. </p>
  200. <a name="index-SYMBOL_005fREF_005fLOCAL_005fP"></a>
  201. <a name="index-SYMBOL_005fFLAG_005fLOCAL"></a>
  202. </dd>
  203. <dt><code>SYMBOL_FLAG_LOCAL</code></dt>
  204. <dd><p>Set if the symbol is local to this &ldquo;module&rdquo;.
  205. See <code>TARGET_BINDS_LOCAL_P</code>.
  206. </p>
  207. <a name="index-SYMBOL_005fREF_005fEXTERNAL_005fP"></a>
  208. <a name="index-SYMBOL_005fFLAG_005fEXTERNAL"></a>
  209. </dd>
  210. <dt><code>SYMBOL_FLAG_EXTERNAL</code></dt>
  211. <dd><p>Set if this symbol is not defined in this translation unit.
  212. Note that this is not the inverse of <code>SYMBOL_FLAG_LOCAL</code>.
  213. </p>
  214. <a name="index-SYMBOL_005fREF_005fSMALL_005fP"></a>
  215. <a name="index-SYMBOL_005fFLAG_005fSMALL"></a>
  216. </dd>
  217. <dt><code>SYMBOL_FLAG_SMALL</code></dt>
  218. <dd><p>Set if the symbol is located in the small data section.
  219. See <code>TARGET_IN_SMALL_DATA_P</code>.
  220. </p>
  221. <a name="index-SYMBOL_005fFLAG_005fTLS_005fSHIFT"></a>
  222. <a name="index-SYMBOL_005fREF_005fTLS_005fMODEL"></a>
  223. </dd>
  224. <dt><code>SYMBOL_REF_TLS_MODEL (<var>x</var>)</code></dt>
  225. <dd><p>This is a multi-bit field accessor that returns the <code>tls_model</code>
  226. to be used for a thread-local storage symbol. It returns zero for
  227. non-thread-local symbols.
  228. </p>
  229. <a name="index-SYMBOL_005fREF_005fHAS_005fBLOCK_005fINFO_005fP"></a>
  230. <a name="index-SYMBOL_005fFLAG_005fHAS_005fBLOCK_005fINFO"></a>
  231. </dd>
  232. <dt><code>SYMBOL_FLAG_HAS_BLOCK_INFO</code></dt>
  233. <dd><p>Set if the symbol has <code>SYMBOL_REF_BLOCK</code> and
  234. <code>SYMBOL_REF_BLOCK_OFFSET</code> fields.
  235. </p>
  236. <a name="index-SYMBOL_005fREF_005fANCHOR_005fP"></a>
  237. <a name="index-SYMBOL_005fFLAG_005fANCHOR"></a>
  238. <a name="index-_002dfsection_002danchors"></a>
  239. </dd>
  240. <dt><code>SYMBOL_FLAG_ANCHOR</code></dt>
  241. <dd><p>Set if the symbol is used as a section anchor. &ldquo;Section anchors&rdquo;
  242. are symbols that have a known position within an <code>object_block</code>
  243. and that can be used to access nearby members of that block.
  244. They are used to implement <samp>-fsection-anchors</samp>.
  245. </p>
  246. <p>If this flag is set, then <code>SYMBOL_FLAG_HAS_BLOCK_INFO</code> will be too.
  247. </p></dd>
  248. </dl>
  249. <p>Bits beginning with <code>SYMBOL_FLAG_MACH_DEP</code> are available for
  250. the target&rsquo;s use.
  251. </p></dd>
  252. </dl>
  253. <a name="index-SYMBOL_005fREF_005fBLOCK"></a>
  254. </dd>
  255. <dt><code>SYMBOL_REF_BLOCK (<var>x</var>)</code></dt>
  256. <dd><p>If &lsquo;<samp>SYMBOL_REF_HAS_BLOCK_INFO_P (<var>x</var>)</samp>&rsquo;, this is the
  257. &lsquo;<samp>object_block</samp>&rsquo; structure to which the symbol belongs,
  258. or <code>NULL</code> if it has not been assigned a block.
  259. </p>
  260. <a name="index-SYMBOL_005fREF_005fBLOCK_005fOFFSET"></a>
  261. </dd>
  262. <dt><code>SYMBOL_REF_BLOCK_OFFSET (<var>x</var>)</code></dt>
  263. <dd><p>If &lsquo;<samp>SYMBOL_REF_HAS_BLOCK_INFO_P (<var>x</var>)</samp>&rsquo;, this is the offset of <var>x</var>
  264. from the first object in &lsquo;<samp>SYMBOL_REF_BLOCK (<var>x</var>)</samp>&rsquo;. The value is
  265. negative if <var>x</var> has not yet been assigned to a block, or it has not
  266. been given an offset within that block.
  267. </p></dd>
  268. </dl>
  269. <hr>
  270. <div class="header">
  271. <p>
  272. Next: <a href="Flags.html#Flags" accesskey="n" rel="next">Flags</a>, Previous: <a href="Accessors.html#Accessors" accesskey="p" rel="prev">Accessors</a>, Up: <a href="RTL.html#RTL" accesskey="u" rel="up">RTL</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  273. </div>
  274. </body>
  275. </html>