選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

174 行
7.7KB

  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-2020 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 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>Sharing (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Sharing (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Sharing (GNU Compiler Collection (GCC) Internals)">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  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="Reading-RTL.html#Reading-RTL" rel="next" title="Reading RTL">
  31. <link href="Calls.html#Calls" rel="prev" title="Calls">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  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.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="Sharing"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Reading-RTL.html#Reading-RTL" accesskey="n" rel="next">Reading RTL</a>, Previous: <a href="Calls.html#Calls" accesskey="p" rel="prev">Calls</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>
  65. </div>
  66. <hr>
  67. <a name="Structure-Sharing-Assumptions"></a>
  68. <h3 class="section">14.21 Structure Sharing Assumptions</h3>
  69. <a name="index-sharing-of-RTL-components"></a>
  70. <a name="index-RTL-structure-sharing-assumptions"></a>
  71. <p>The compiler assumes that certain kinds of RTL expressions are unique;
  72. there do not exist two distinct objects representing the same value.
  73. In other cases, it makes an opposite assumption: that no RTL expression
  74. object of a certain kind appears in more than one place in the
  75. containing structure.
  76. </p>
  77. <p>These assumptions refer to a single function; except for the RTL
  78. objects that describe global variables and external functions,
  79. and a few standard objects such as small integer constants,
  80. no RTL objects are common to two functions.
  81. </p>
  82. <ul>
  83. <li> <a name="index-reg_002c-RTL-sharing"></a>
  84. Each pseudo-register has only a single <code>reg</code> object to represent it,
  85. and therefore only a single machine mode.
  86. </li><li> <a name="index-symbolic-label"></a>
  87. <a name="index-symbol_005fref_002c-RTL-sharing"></a>
  88. For any symbolic label, there is only one <code>symbol_ref</code> object
  89. referring to it.
  90. </li><li> <a name="index-const_005fint_002c-RTL-sharing"></a>
  91. All <code>const_int</code> expressions with equal values are shared.
  92. </li><li> <a name="index-const_005fpoly_005fint_002c-RTL-sharing"></a>
  93. All <code>const_poly_int</code> expressions with equal modes and values
  94. are shared.
  95. </li><li> <a name="index-pc_002c-RTL-sharing"></a>
  96. There is only one <code>pc</code> expression.
  97. </li><li> <a name="index-cc0_002c-RTL-sharing"></a>
  98. There is only one <code>cc0</code> expression.
  99. </li><li> <a name="index-const_005fdouble_002c-RTL-sharing"></a>
  100. There is only one <code>const_double</code> expression with value 0 for
  101. each floating point mode. Likewise for values 1 and 2.
  102. </li><li> <a name="index-const_005fvector_002c-RTL-sharing"></a>
  103. There is only one <code>const_vector</code> expression with value 0 for
  104. each vector mode, be it an integer or a double constant vector.
  105. </li><li> <a name="index-label_005fref_002c-RTL-sharing"></a>
  106. <a name="index-scratch_002c-RTL-sharing"></a>
  107. No <code>label_ref</code> or <code>scratch</code> appears in more than one place in
  108. the RTL structure; in other words, it is safe to do a tree-walk of all
  109. the insns in the function and assume that each time a <code>label_ref</code>
  110. or <code>scratch</code> is seen it is distinct from all others that are seen.
  111. </li><li> <a name="index-mem_002c-RTL-sharing"></a>
  112. Only one <code>mem</code> object is normally created for each static
  113. variable or stack slot, so these objects are frequently shared in all
  114. the places they appear. However, separate but equal objects for these
  115. variables are occasionally made.
  116. </li><li> <a name="index-asm_005foperands_002c-RTL-sharing"></a>
  117. When a single <code>asm</code> statement has multiple output operands, a
  118. distinct <code>asm_operands</code> expression is made for each output operand.
  119. However, these all share the vector which contains the sequence of input
  120. operands. This sharing is used later on to test whether two
  121. <code>asm_operands</code> expressions come from the same statement, so all
  122. optimizations must carefully preserve the sharing if they copy the
  123. vector at all.
  124. </li><li> No RTL object appears in more than one place in the RTL structure
  125. except as described above. Many passes of the compiler rely on this
  126. by assuming that they can modify RTL objects in place without unwanted
  127. side-effects on other insns.
  128. </li><li> <a name="index-unshare_005fall_005frtl"></a>
  129. During initial RTL generation, shared structure is freely introduced.
  130. After all the RTL for a function has been generated, all shared
  131. structure is copied by <code>unshare_all_rtl</code> in <samp>emit-rtl.c</samp>,
  132. after which the above rules are guaranteed to be followed.
  133. </li><li> <a name="index-copy_005frtx_005fif_005fshared"></a>
  134. During the combiner pass, shared structure within an insn can exist
  135. temporarily. However, the shared structure is copied before the
  136. combiner is finished with the insn. This is done by calling
  137. <code>copy_rtx_if_shared</code>, which is a subroutine of
  138. <code>unshare_all_rtl</code>.
  139. </li></ul>
  140. <hr>
  141. <div class="header">
  142. <p>
  143. Next: <a href="Reading-RTL.html#Reading-RTL" accesskey="n" rel="next">Reading RTL</a>, Previous: <a href="Calls.html#Calls" accesskey="p" rel="prev">Calls</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>
  144. </div>
  145. </body>
  146. </html>