2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. index:: access to special operands
10 Access to Special Operands
11 **************************
13 Some RTL nodes have special annotations associated with them.
17 .. index:: MEM_ALIAS_SET
19 :samp:`MEM_ALIAS_SET ({x})`
20 If 0, :samp:`{x}` is not in any alias set, and may alias anything. Otherwise,
21 :samp:`{x}` can only alias ``MEM`` s in a conflicting alias set. This value
22 is set in a language-dependent manner in the front-end, and should not be
23 altered in the back-end. In some front-ends, these numbers may correspond
24 in some way to types, or other language-level entities, but they need not,
25 and the back-end makes no such assumptions.
26 These set numbers are tested with ``alias_sets_conflict_p``.
30 :samp:`MEM_EXPR ({x})`
31 If this register is known to hold the value of some user-level
32 declaration, this is that tree node. It may also be a
33 ``COMPONENT_REF``, in which case this is some field reference,
34 and ``TREE_OPERAND (x, 0)`` contains the declaration,
35 or another ``COMPONENT_REF``, or null if there is no compile-time
36 object associated with the reference.
38 .. index:: MEM_OFFSET_KNOWN_P
40 :samp:`MEM_OFFSET_KNOWN_P ({x})`
41 True if the offset of the memory reference from ``MEM_EXPR`` is known.
42 :samp:`MEM_OFFSET ({x})` provides the offset if so.
46 :samp:`MEM_OFFSET ({x})`
47 The offset from the start of ``MEM_EXPR``. The value is only valid if
48 :samp:`MEM_OFFSET_KNOWN_P ({x})` is true.
50 .. index:: MEM_SIZE_KNOWN_P
52 :samp:`MEM_SIZE_KNOWN_P ({x})`
53 True if the size of the memory reference is known.
54 :samp:`MEM_SIZE ({x})` provides its size if so.
58 :samp:`MEM_SIZE ({x})`
59 The size in bytes of the memory reference.
60 This is mostly relevant for ``BLKmode`` references as otherwise
61 the size is implied by the mode. The value is only valid if
62 :samp:`MEM_SIZE_KNOWN_P ({x})` is true.
66 :samp:`MEM_ALIGN ({x})`
67 The known alignment in bits of the memory reference.
69 .. index:: MEM_ADDR_SPACE
71 :samp:`MEM_ADDR_SPACE ({x})`
72 The address space of the memory reference. This will commonly be zero
73 for the generic address space.
77 .. index:: ORIGINAL_REGNO
79 :samp:`ORIGINAL_REGNO ({x})`
80 This field holds the number the register 'originally' had; for a
81 pseudo register turned into a hard reg this will hold the old pseudo
86 :samp:`REG_EXPR ({x})`
87 If this register is known to hold the value of some user-level
88 declaration, this is that tree node.
92 :samp:`REG_OFFSET ({x})`
93 If this register is known to hold the value of some user-level
94 declaration, this is the offset into that logical storage.
96 .. envvar:: SYMBOL_REF
98 .. index:: SYMBOL_REF_DECL
100 :samp:`SYMBOL_REF_DECL ({x})`
101 If the ``symbol_ref`` :samp:`{x}` was created for a ``VAR_DECL`` or
102 a ``FUNCTION_DECL``, that tree is recorded here. If this value is
103 null, then :samp:`{x}` was created by back end code generation routines,
104 and there is no associated front end symbol table entry.
106 ``SYMBOL_REF_DECL`` may also point to a tree of class ``'c'``,
107 that is, some sort of constant. In this case, the ``symbol_ref``
108 is an entry in the per-file constant pool; again, there is no associated
109 front end symbol table entry.
111 .. index:: SYMBOL_REF_CONSTANT
113 :samp:`SYMBOL_REF_CONSTANT ({x})`
114 If :samp:`CONSTANT_POOL_ADDRESS_P ({x})` is true, this is the constant
115 pool entry for :samp:`{x}`. It is null otherwise.
117 .. index:: SYMBOL_REF_DATA
119 :samp:`SYMBOL_REF_DATA ({x})`
120 A field of opaque type used to store ``SYMBOL_REF_DECL`` or
121 ``SYMBOL_REF_CONSTANT``.
123 .. index:: SYMBOL_REF_FLAGS
125 :samp:`SYMBOL_REF_FLAGS ({x})`
126 In a ``symbol_ref``, this is used to communicate various predicates
127 about the symbol. Some of these are common enough to be computed by
128 common code, some are specific to the target. The common bits are:
130 .. index:: SYMBOL_REF_FUNCTION_P, SYMBOL_FLAG_FUNCTION
132 .. envvar:: SYMBOL_FLAG_FUNCTION
134 Set if the symbol refers to a function.
136 .. envvar:: SYMBOL_FLAG_LOCAL
138 Set if the symbol is local to this 'module'.
139 See ``TARGET_BINDS_LOCAL_P``.
141 .. envvar:: SYMBOL_FLAG_EXTERNAL
143 Set if this symbol is not defined in this translation unit.
144 Note that this is not the inverse of ``SYMBOL_FLAG_LOCAL``.
146 .. envvar:: SYMBOL_FLAG_SMALL
148 Set if the symbol is located in the small data section.
149 See ``TARGET_IN_SMALL_DATA_P``.
151 :samp:`SYMBOL_REF_TLS_MODEL ({x})`
152 This is a multi-bit field accessor that returns the ``tls_model``
153 to be used for a thread-local storage symbol. It returns zero for
154 non-thread-local symbols.
156 .. index:: SYMBOL_REF_HAS_BLOCK_INFO_P, SYMBOL_FLAG_HAS_BLOCK_INFO
158 .. envvar:: SYMBOL_FLAG_HAS_BLOCK_INFO
160 Set if the symbol has ``SYMBOL_REF_BLOCK`` and
161 ``SYMBOL_REF_BLOCK_OFFSET`` fields.
163 .. index:: -fsection-anchors
165 .. envvar:: SYMBOL_FLAG_ANCHOR
167 Set if the symbol is used as a section anchor. 'Section anchors'
168 are symbols that have a known position within an ``object_block``
169 and that can be used to access nearby members of that block.
170 They are used to implement :option:`-fsection-anchors`.
172 If this flag is set, then ``SYMBOL_FLAG_HAS_BLOCK_INFO`` will be too.
174 Bits beginning with ``SYMBOL_FLAG_MACH_DEP`` are available for
177 :samp:`SYMBOL_REF_BLOCK ({x})`
178 If :samp:`SYMBOL_REF_HAS_BLOCK_INFO_P ({x})`, this is the
179 :samp:`object_block` structure to which the symbol belongs,
180 or ``NULL`` if it has not been assigned a block.
182 .. index:: SYMBOL_REF_BLOCK_OFFSET
184 :samp:`SYMBOL_REF_BLOCK_OFFSET ({x})`
185 If :samp:`SYMBOL_REF_HAS_BLOCK_INFO_P ({x})`, this is the offset of :samp:`{x}`
186 from the first object in :samp:`SYMBOL_REF_BLOCK ({x})`. The value is
187 negative if :samp:`{x}` has not yet been assigned to a block, or it has not
188 been given an offset within that block.