?? rtl.texi
字號:
operands there are.For example, if @var{x} is a @code{subreg} expression, you know that it hastwo operands which can be correctly accessed as @code{XEXP (@var{x}, 0)}and @code{XINT (@var{x}, 1)}. If you did @code{XINT (@var{x}, 0)}, youwould get the address of the expression operand but cast as an integer;that might occasionally be useful, but it would be cleaner to write@code{(int) XEXP (@var{x}, 0)}. @code{XEXP (@var{x}, 1)} would alsocompile without error, and would return the second, integer operand cast asan expression pointer, which would probably result in a crash whenaccessed. Nothing stops you from writing @code{XEXP (@var{x}, 28)} either,but this will access memory past the end of the expression withunpredictable results.Access to operands which are vectors is more complicated. You can use themacro @code{XVEC} to get the vector-pointer itself, or the macros@code{XVECEXP} and @code{XVECLEN} to access the elements and length of avector.@table @code@findex XVEC@item XVEC (@var{exp}, @var{idx})Access the vector-pointer which is operand number @var{idx} in @var{exp}.@findex XVECLEN@item XVECLEN (@var{exp}, @var{idx})Access the length (number of elements) in the vector which isin operand number @var{idx} in @var{exp}. This value is an @code{int}.@findex XVECEXP@item XVECEXP (@var{exp}, @var{idx}, @var{eltnum})Access element number @var{eltnum} in the vector which isin operand number @var{idx} in @var{exp}. This value is an RTX@.It is up to you to make sure that @var{eltnum} is not negativeand is less than @code{XVECLEN (@var{exp}, @var{idx})}.@end tableAll the macros defined in this section expand into lvalues and thereforecan be used to assign the operands, lengths and vector elements as well asto access them.@node Special Accessors@section Access to Special Operands@cindex access to special operandsSome RTL nodes have special annotations associated with them.@table @code@item MEM@table @code@findex MEM_ALIAS_SET@item MEM_ALIAS_SET (@var{x})If 0, @var{x} is not in any alias set, and may alias anything. Otherwise,@var{x} can only alias @code{MEM}s in a conflicting alias set. This valueis set in a language-dependent manner in the front-end, and should not bealtered in the back-end. In some front-ends, these numbers may correspondin some way to types, or other language-level entities, but they need not,and the back-end makes no such assumptions.These set numbers are tested with @code{alias_sets_conflict_p}.@findex MEM_EXPR@item MEM_EXPR (@var{x})If this register is known to hold the value of some user-leveldeclaration, this is that tree node. It may also be a@code{COMPONENT_REF}, in which case this is some field reference,and @code{TREE_OPERAND (@var{x}, 0)} contains the declaration,or another @code{COMPONENT_REF}, or null if there is no compile-timeobject associated with the reference.@findex MEM_OFFSET@item MEM_OFFSET (@var{x})The offset from the start of @code{MEM_EXPR} as a @code{CONST_INT} rtx.@findex MEM_SIZE@item MEM_SIZE (@var{x})The size in bytes of the memory reference as a @code{CONST_INT} rtx.This is mostly relevant for @code{BLKmode} references as otherwisethe size is implied by the mode.@findex MEM_ALIGN@item MEM_ALIGN (@var{x})The known alignment in bits of the memory reference.@end table@item REG@table @code@findex ORIGINAL_REGNO@item ORIGINAL_REGNO (@var{x})This field holds the number the register ``originally'' had; for apseudo register turned into a hard reg this will hold the old pseudoregister number.@findex REG_EXPR@item REG_EXPR (@var{x})If this register is known to hold the value of some user-leveldeclaration, this is that tree node.@findex REG_OFFSET@item REG_OFFSET (@var{x})If this register is known to hold the value of some user-leveldeclaration, this is the offset into that logical storage.@end table@item SYMBOL_REF@table @code@findex SYMBOL_REF_DECL@item SYMBOL_REF_DECL (@var{x})If the @code{symbol_ref} @var{x} was created for a @code{VAR_DECL} ora @code{FUNCTION_DECL}, that tree is recorded here. If this value isnull, then @var{x} was created by back end code generation routines,and there is no associated front end symbol table entry.@code{SYMBOL_REF_DECL} may also point to a tree of class @code{'c'},that is, some sort of constant. In this case, the @code{symbol_ref}is an entry in the per-file constant pool; again, there is no associatedfront end symbol table entry.@findex SYMBOL_REF_CONSTANT@item SYMBOL_REF_CONSTANT (@var{x})If @samp{CONSTANT_POOL_ADDRESS_P (@var{x})} is true, this is the constantpool entry for @var{x}. It is null otherwise.@findex SYMBOL_REF_DATA@item SYMBOL_REF_DATA (@var{x})A field of opaque type used to store @code{SYMBOL_REF_DECL} or@code{SYMBOL_REF_CONSTANT}.@findex SYMBOL_REF_FLAGS@item SYMBOL_REF_FLAGS (@var{x})In a @code{symbol_ref}, this is used to communicate various predicatesabout the symbol. Some of these are common enough to be computed bycommon code, some are specific to the target. The common bits are:@table @code@findex SYMBOL_REF_FUNCTION_P@findex SYMBOL_FLAG_FUNCTION@item SYMBOL_FLAG_FUNCTIONSet if the symbol refers to a function.@findex SYMBOL_REF_LOCAL_P@findex SYMBOL_FLAG_LOCAL@item SYMBOL_FLAG_LOCALSet if the symbol is local to this ``module''.See @code{TARGET_BINDS_LOCAL_P}.@findex SYMBOL_REF_EXTERNAL_P@findex SYMBOL_FLAG_EXTERNAL@item SYMBOL_FLAG_EXTERNALSet if this symbol is not defined in this translation unit.Note that this is not the inverse of @code{SYMBOL_FLAG_LOCAL}.@findex SYMBOL_REF_SMALL_P@findex SYMBOL_FLAG_SMALL@item SYMBOL_FLAG_SMALLSet if the symbol is located in the small data section.See @code{TARGET_IN_SMALL_DATA_P}.@findex SYMBOL_FLAG_TLS_SHIFT@findex SYMBOL_REF_TLS_MODEL@item SYMBOL_REF_TLS_MODEL (@var{x})This is a multi-bit field accessor that returns the @code{tls_model}to be used for a thread-local storage symbol. It returns zero fornon-thread-local symbols.@findex SYMBOL_REF_HAS_BLOCK_INFO_P@findex SYMBOL_FLAG_HAS_BLOCK_INFO@item SYMBOL_FLAG_HAS_BLOCK_INFOSet if the symbol has @code{SYMBOL_REF_BLOCK} and@code{SYMBOL_REF_BLOCK_OFFSET} fields.@findex SYMBOL_REF_ANCHOR_P@findex SYMBOL_FLAG_ANCHOR@cindex @option{-fsection-anchors}@item SYMBOL_FLAG_ANCHORSet if the symbol is used as a section anchor. ``Section anchors''are symbols that have a known position within an @code{object_block}and that can be used to access nearby members of that block.They are used to implement @option{-fsection-anchors}.If this flag is set, then @code{SYMBOL_FLAG_HAS_BLOCK_INFO} will be too.@end tableBits beginning with @code{SYMBOL_FLAG_MACH_DEP} are available forthe target's use.@end table@findex SYMBOL_REF_BLOCK@item SYMBOL_REF_BLOCK (@var{x})If @samp{SYMBOL_REF_HAS_BLOCK_INFO_P (@var{x})}, this is the@samp{object_block} structure to which the symbol belongs,or @code{NULL} if it has not been assigned a block.@findex SYMBOL_REF_BLOCK_OFFSET@item SYMBOL_REF_BLOCK_OFFSET (@var{x})If @samp{SYMBOL_REF_HAS_BLOCK_INFO_P (@var{x})}, this is the offset of @var{x}from the first object in @samp{SYMBOL_REF_BLOCK (@var{x})}. The value isnegative if @var{x} has not yet been assigned to a block, or it has notbeen given an offset within that block.@end table@node Flags@section Flags in an RTL Expression@cindex flags in RTL expressionRTL expressions contain several flags (one-bit bit-fields)that are used in certain types of expression. Most often theyare accessed with the following macros, which expand into lvalues.@table @code@findex CONSTANT_POOL_ADDRESS_P@cindex @code{symbol_ref} and @samp{/u}@cindex @code{unchanging}, in @code{symbol_ref}@item CONSTANT_POOL_ADDRESS_P (@var{x})Nonzero in a @code{symbol_ref} if it refers to part of the currentfunction's constant pool. For most targets these addresses are in a@code{.rodata} section entirely separate from the function, but forsome targets the addresses are close to the beginning of the function.In either case GCC assumes these addresses can be addressed directly,perhaps with the help of base registers.Stored in the @code{unchanging} field and printed as @samp{/u}.@findex CONST_OR_PURE_CALL_P@cindex @code{call_insn} and @samp{/u}@cindex @code{unchanging}, in @code{call_insn}@item CONST_OR_PURE_CALL_P (@var{x})In a @code{call_insn}, @code{note}, or an @code{expr_list} for notes,indicates that the insn represents a call to a const or pure function.Stored in the @code{unchanging} field and printed as @samp{/u}.@findex INSN_ANNULLED_BRANCH_P@cindex @code{jump_insn} and @samp{/u}@cindex @code{call_insn} and @samp{/u}@cindex @code{insn} and @samp{/u}@cindex @code{unchanging}, in @code{jump_insn}, @code{call_insn} and @code{insn}@item INSN_ANNULLED_BRANCH_P (@var{x})In a @code{jump_insn}, @code{call_insn}, or @code{insn} indicatesthat the branch is an annulling one. See the discussion under@code{sequence} below. Stored in the @code{unchanging} field andprinted as @samp{/u}.@findex INSN_DELETED_P@cindex @code{insn} and @samp{/v}@cindex @code{call_insn} and @samp{/v}@cindex @code{jump_insn} and @samp{/v}@cindex @code{code_label} and @samp{/v}@cindex @code{barrier} and @samp{/v}@cindex @code{note} and @samp{/v}@cindex @code{volatil}, in @code{insn}, @code{call_insn}, @code{jump_insn}, @code{code_label}, @code{barrier}, and @code{note}@item INSN_DELETED_P (@var{x})In an @code{insn}, @code{call_insn}, @code{jump_insn}, @code{code_label},@code{barrier}, or @code{note},nonzero if the insn has been deleted. Stored in the@code{volatil} field and printed as @samp{/v}.@findex INSN_FROM_TARGET_P@cindex @code{insn} and @samp{/s}@cindex @code{jump_insn} and @samp{/s}@cindex @code{call_insn} and @samp{/s}@cindex @code{in_struct}, in @code{insn} and @code{jump_insn} and @code{call_insn}@item INSN_FROM_TARGET_P (@var{x})In an @code{insn} or @code{jump_insn} or @code{call_insn} in a delayslot of a branch, indicates that the insnis from the target of the branch. If the branch insn has@code{INSN_ANNULLED_BRANCH_P} set, this insn will only be executed ifthe branch is taken. For annulled branches with@code{INSN_FROM_TARGET_P} clear, the insn will be executed only if thebranch is not taken. When @code{INSN_ANNULLED_BRANCH_P} is not set,this insn will always be executed. Stored in the @code{in_struct}field and printed as @samp{/s}.@findex LABEL_PRESERVE_P@cindex @code{code_label} and @samp{/i}@cindex @code{note} and @samp{/i}@cindex @code{in_struct}, in @code{code_label} and @code{note}@item LABEL_PRESERVE_P (@var{x})In a @code{code_label} or @code{note}, indicates that the label is referenced bycode or data not visible to the RTL of a given function.Labels referenced by a non-local goto will have this bit set. Storedin the @code{in_struct} field and printed as @samp{/s}.@findex LABEL_REF_NONLOCAL_P@cindex @code{label_ref} and @samp{/v}@cindex @code{reg_label} and @samp{/v}@cindex @code{volatil}, in @code{label_ref} and @code{reg_label}@item LABEL_REF_NONLOCAL_P (@var{x})In @code{label_ref} and @code{reg_label} expressions, nonzero if this isa reference to a non-local label.Stored in the @code{volatil} field and printed as @samp{/v}.@findex MEM_IN_STRUCT_P@cindex @code{mem} and @samp{/s}@cindex @code{in_struct}, in @code{mem}@item MEM_IN_STRUCT_P (@var{x})In @code{mem} expressions, nonzero for reference to an entire structure,union or array, or to a component of one. Zero for references to ascalar variable or through a pointer to a scalar. If both this flag and@code{MEM_SCALAR_P} are clear, then we don't know whether this @code{mem}is in a structure or not. Both flags should never be simultaneously set.Stored in the @code{in_struct} field and printed as @samp{/s}.@findex MEM_KEEP_ALIAS_SET_P@cindex @code{mem} and @samp{/j}@cindex @code{jump}, in @code{mem}@item MEM_KEEP_ALIAS_SET_P (@var{x})In @code{mem} expressions, 1 if we should keep the alias set for thismem unchanged when we access a component. Set to 1, for example, when weare already in a non-addressable component of an aggregate.Stored in the @code{jump} field and printed as @samp{/j}.@findex MEM_SCALAR_P@cindex @code{mem} and @samp{/i}@cindex @code{return_val}, in @code{mem}@item MEM_SCALAR_P (@var{x})In @code{mem} expressions, nonzero for reference to a scalar known notto be a member of a structure, union, or array. Zero for suchreferences and for indirections through pointers, even pointers pointingto scalar types. If both this flag and @code{MEM_IN_STRUCT_P} are clear,then we don't know whether this @code{mem} is in a structure or not.Both flags should never be simultaneously set.Stored in the @code{return_val} field and printed as @samp{/i}.@findex MEM_VOLATILE_P@cindex @code{mem} and @samp{/v}@cindex @code{asm_input} and @samp{/v}@cindex @code{asm_operands} and @samp{/v}@cindex @code{volatil}, in @code{mem}, @code{asm_operands}, and @code{asm_input}@item MEM_VOLATILE_P (@var{x})In @code{mem}, @code{asm_operands}, and @code{asm_input} expressions,nonzero for volatile memory references.Stored in the @code{volatil} field and printed as @samp{/v}.@findex MEM_NOTRAP_P@cindex @code{mem} and @samp{/c}@cindex @code{call}, in @code{mem}@item MEM_NOTRAP_P (@var{x})In @code{mem}, nonzero for memory references that will not trap.Stored in the @code{call} field and printed as @samp{/c}.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -