This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patches ping [3/3]: Update rtl.texi
- From: Alexey Neyman <alex dot neyman at auriga dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 1 Mar 2005 18:08:59 +0300
- Subject: Patches ping [3/3]: Update rtl.texi
- Organization: Auriga
Hi,
rtl.texi is somewhat out of date, it refers to wrong fields, files,
etc. This patch updates it.
Regards,
Alexey.
--
For mundane material concerns, seek the help of the one-eyed beings.
-- Pkunks, SC2
2004-12-08 Alexey Neyman <alex.neyman@auriga.ru>
* doc/rtl.texi: Sync up the lists of output format specifiers,
RTX access macros (and the fields they actually use), types
of note insns and register notes.
diff -crN gcc.orig/gcc/doc/rtl.texi gcc.work/gcc/doc/rtl.texi
*** gcc.orig/gcc/doc/rtl.texi 2005-01-30 18:36:09.000000000 +0300
--- gcc.work/gcc/doc/rtl.texi 2005-03-01 16:38:30.939109198 +0300
***************
*** 138,144 ****
The various expression codes are divided into several @dfn{classes},
which are represented by single characters. You can determine the class
of an RTX code with the macro @code{GET_RTX_CLASS (@var{code})}.
! Currently, @file{rtx.def} defines these classes:
@table @code
@item RTX_OBJ
--- 138,144 ----
The various expression codes are divided into several @dfn{classes},
which are represented by single characters. You can determine the class
of an RTX code with the macro @code{GET_RTX_CLASS (@var{code})}.
! Currently, @file{rtl.h} defines these classes:
@table @code
@item RTX_OBJ
***************
*** 244,262 ****
@item S
@samp{S} indicates a string which is optional. In the RTL objects in
! core, @samp{S} is equivalent to @samp{s}, but when the object is read,
from an @samp{md} file, the string value of this operand may be omitted.
An omitted string is taken to be the null string.
@item V
@samp{V} indicates a vector which is optional. In the RTL objects in
core, @samp{V} is equivalent to @samp{E}, but when the object is read
from an @samp{md} file, the vector value of this operand may be omitted.
An omitted vector is effectively the same as a vector of no elements.
@item B
@samp{B} indicates a pointer to basic block structure.
@item 0
@samp{0} means a slot whose contents do not fit any normal category.
@samp{0} slots are not printed at all in dumps, and are often used in
--- 244,272 ----
@item S
@samp{S} indicates a string which is optional. In the RTL objects in
! core, @samp{S} is equivalent to @samp{s}, but when the object is read
from an @samp{md} file, the string value of this operand may be omitted.
An omitted string is taken to be the null string.
+ @item T
+ @samp{T} is equivalent to @samp{s}, but it is treated specially by the
+ RTL reader.
+
@item V
@samp{V} indicates a vector which is optional. In the RTL objects in
core, @samp{V} is equivalent to @samp{E}, but when the object is read
from an @samp{md} file, the vector value of this operand may be omitted.
An omitted vector is effectively the same as a vector of no elements.
+ @item b
+ @samp{b} indicates a pointer to a bitmap header.
+
@item B
@samp{B} indicates a pointer to basic block structure.
+ @item t
+ @samp{t} indicates a pointer to tree structure.
+
@item 0
@samp{0} means a slot whose contents do not fit any normal category.
@samp{0} slots are not printed at all in dumps, and are often used in
***************
*** 280,305 ****
is safe to assume that all comparison operations have format @code{ee}.
@table @code
! @item 1
All codes of this class have format @code{e}.
! @item <
! @itemx c
! @itemx 2
All codes of these classes have format @code{ee}.
! @item b
! @itemx 3
All codes of these classes have format @code{eee}.
! @item i
! All codes of this class have formats that begin with @code{iuueiee}.
! @xref{Insns}. Note that not all RTL objects linked onto an insn chain
! are of class @code{i}.
!
! @item o
! @itemx m
! @itemx x
You can make no assumptions about the format of these codes.
@end table
--- 290,314 ----
is safe to assume that all comparison operations have format @code{ee}.
@table @code
! @item RTX_UNARY
All codes of this class have format @code{e}.
! @item RTX_COMPARE
! @itemx RTX_COMM_COMPARE
! @itemx RTX_BIN_ARITH
! @itemx RTX_COMM_ARITH
All codes of these classes have format @code{ee}.
! @item RTX_BITFIELD_OPS
! @itemx RTX_TERNARY
All codes of these classes have format @code{eee}.
! @item RTX_OBJ
! @itemx RTX_CONST_OBJ
! @itemx RTX_INSN
! @itemx RTX_MATCH
! @itemx RTX_AUTOINC
! @itemx RTX_EXTRA
You can make no assumptions about the format of these codes.
@end table
***************
*** 586,591 ****
--- 595,620 ----
Labels referenced by a non-local goto will have this bit set. Stored
in the @code{in_struct} field and printed as @samp{/s}.
+ @findex LABEL_KIND
+ @cindex @code{code_label} and @samp{/j} and @samp{/c}
+ @cindex @code{jump}, in @code{code_label}
+ @cindex @code{call}, in @code{code_label}
+ @item LABEL_KIND (@var{x})
+ In a @code{code_label}, returns one of @code{LABEL_NORMAL},
+ @code{LABEL_STATIC_ENTRY}, @code{LABEL_GLOBAL_ENTRY} or @code{LABEL_WEAK_ENTRY},
+ indicating the type of the label. Stored in the @code{jump}
+ field and @code{call} field, printed as @samp{/j} and @samp{/c}.
+ This macro may only be used to get the value, it may not be used to change
+ the value. Use @code{SET_LABEL_KIND} to change the value.
+
+ @findex SET_LABEL_KIND
+ @cindex @code{code_label} and @samp{/j} and @samp{/c}
+ @cindex @code{jump}, in @code{code_label}
+ @cindex @code{call}, in @code{code_label}
+ @item SET_LABEL_KIND (@var{x}, @var{val})
+ Set the @code{jump} and @code{call} fields in a @code{code_label}
+ to reflect the type of the label.
+
@findex LABEL_REF_NONLOCAL_P
@cindex @code{label_ref} and @samp{/v}
@cindex @code{reg_label} and @samp{/v}
***************
*** 625,631 ****
to 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{frame_related} field and printed as @samp{/f}.
@findex MEM_VOLATILE_P
@cindex @code{mem} and @samp{/v}
--- 654,660 ----
to 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}
***************
*** 646,657 ****
@findex REG_FUNCTION_VALUE_P
@cindex @code{reg} and @samp{/i}
! @cindex @code{integrated}, in @code{reg}
@item REG_FUNCTION_VALUE_P (@var{x})
! Nonzero in a @code{reg} if it is the place in which this function's
! value is going to be returned. (This happens only in a hard
! register.) Stored in the @code{integrated} field and printed as
! @samp{/i}.
@findex REG_POINTER
@cindex @code{reg} and @samp{/f}
--- 675,687 ----
@findex REG_FUNCTION_VALUE_P
@cindex @code{reg} and @samp{/i}
! @cindex @code{parallel} and @samp{/i}
! @cindex @code{return_val}, in @code{reg}
@item REG_FUNCTION_VALUE_P (@var{x})
! Nonzero in @code{reg} and @code{parallel} expressions if it is the place
! in which this function's value is going to be returned. (This happens
! only in a hard register.) Stored in the @code{return_val} field and
! printed as @samp{/i}.
@findex REG_POINTER
@cindex @code{reg} and @samp{/f}
***************
*** 707,725 ****
This flag is required for exception handling support on targets with RTL
prologues.
- @cindex @code{insn} and @samp{/i}
- @cindex @code{call_insn} and @samp{/i}
- @cindex @code{jump_insn} and @samp{/i}
- @cindex @code{barrier} and @samp{/i}
- @cindex @code{code_label} and @samp{/i}
- @cindex @code{insn_list} and @samp{/i}
- @cindex @code{const} and @samp{/i}
- @cindex @code{note} and @samp{/i}
- @cindex @code{integrated}, in @code{insn}, @code{call_insn}, @code{jump_insn}, @code{barrier}, @code{code_label}, @code{insn_list}, @code{const}, and @code{note}
- @code{code_label}, @code{insn_list}, @code{const}, or @code{note} if it
- resulted from an in-line function call.
- Stored in the @code{integrated} field and printed as @samp{/i}.
-
@findex MEM_READONLY_P
@cindex @code{mem} and @samp{/u}
@cindex @code{unchanging}, in @code{mem}
--- 737,742 ----
***************
*** 763,774 ****
For a @code{call_insn}, nonzero if the insn is a sibling call.
Stored in the @code{jump} field and printed as @samp{/j}.
! @findex STRING_POOL_ADDRESS_P
@cindex @code{symbol_ref} and @samp{/f}
@cindex @code{frame_related}, in @code{symbol_ref}
! @item STRING_POOL_ADDRESS_P (@var{x})
! For a @code{symbol_ref} expression, nonzero if it addresses this function's
! string constant pool.
Stored in the @code{frame_related} field and printed as @samp{/f}.
@findex SUBREG_PROMOTED_UNSIGNED_P
--- 780,799 ----
For a @code{call_insn}, nonzero if the insn is a sibling call.
Stored in the @code{jump} field and printed as @samp{/j}.
! @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})
! For a @code{symbol_ref} expression, nonzero if it addresses this function's
! rtl constant pool.
! Stored in the @code{unchanging} field and printed as @samp{/u}.
!
! @findex TREE_CONSTANT_POOL_ADDRESS_P
@cindex @code{symbol_ref} and @samp{/f}
@cindex @code{frame_related}, in @code{symbol_ref}
! @item TREE_CONSTANT_POOL_ADDRESS_P (@var{x})
! For a @code{symbol_ref} expression, nonzero if it addresses a value in the
! file's tree constant pool.
Stored in the @code{frame_related} field and printed as @samp{/f}.
@findex SUBREG_PROMOTED_UNSIGNED_P
***************
*** 786,795 ****
the value. Use @code{SUBREG_PROMOTED_UNSIGNED_SET} to change the value.
@findex SUBREG_PROMOTED_UNSIGNED_SET
! @cindex @code{subreg} and @samp{/u}
@cindex @code{unchanging}, in @code{subreg}
@cindex @code{volatil}, in @code{subreg}
! @item SUBREG_PROMOTED_UNSIGNED_SET (@var{x})
Set the @code{unchanging} and @code{volatil} fields in a @code{subreg}
to reflect zero, sign, or other extension. If @code{volatil} is
zero, then @code{unchanging} as nonzero means zero extension and as
--- 811,820 ----
the value. Use @code{SUBREG_PROMOTED_UNSIGNED_SET} to change the value.
@findex SUBREG_PROMOTED_UNSIGNED_SET
! @cindex @code{subreg} and @samp{/u} and @samp{/v}
@cindex @code{unchanging}, in @code{subreg}
@cindex @code{volatil}, in @code{subreg}
! @item SUBREG_PROMOTED_UNSIGNED_SET (@var{x}, @var{val})
Set the @code{unchanging} and @code{volatil} fields in a @code{subreg}
to reflect zero, sign, or other extension. If @code{volatil} is
zero, then @code{unchanging} as nonzero means zero extension and as
***************
*** 818,827 ****
@findex SYMBOL_REF_WEAK
@cindex @code{symbol_ref} and @samp{/i}
! @cindex @code{integrated}, in @code{symbol_ref}
@item SYMBOL_REF_WEAK (@var{x})
In a @code{symbol_ref}, indicates that @var{x} has been declared weak.
! Stored in the @code{integrated} field and printed as @samp{/i}.
@findex SYMBOL_REF_FLAG
@cindex @code{symbol_ref} and @samp{/v}
--- 843,852 ----
@findex SYMBOL_REF_WEAK
@cindex @code{symbol_ref} and @samp{/i}
! @cindex @code{return_val}, in @code{symbol_ref}
@item SYMBOL_REF_WEAK (@var{x})
In a @code{symbol_ref}, indicates that @var{x} has been declared weak.
! Stored in the @code{return_val} field and printed as @samp{/i}.
@findex SYMBOL_REF_FLAG
@cindex @code{symbol_ref} and @samp{/v}
***************
*** 843,864 ****
@item call
In a @code{mem}, 1 means that the memory reference will not trap.
In an RTL dump, this flag is represented as @samp{/c}.
@findex frame_related
@cindex @samp{/f} in RTL dump
@item frame_related
! In an @code{insn} or @code{set} expression, 1 means that it is part of
! a function prologue and sets the stack pointer, sets the frame pointer,
! saves a register, or sets up a temporary register to use in place of the
! frame pointer.
! In @code{reg} expressions, 1 means that the register holds a pointer.
In @code{symbol_ref} expressions, 1 means that the reference addresses
! this function's string constant pool.
!
! In @code{mem} expressions, 1 means that the reference is to a scalar.
In an RTL dump, this flag is represented as @samp{/f}.
--- 868,890 ----
@item call
In a @code{mem}, 1 means that the memory reference will not trap.
+ In a @code{code_label}, along with @samp{/j}, encodes the label type.
+
In an RTL dump, this flag is represented as @samp{/c}.
@findex frame_related
@cindex @samp{/f} in RTL dump
@item frame_related
! In an @code{insn}, @code{jump_insn}, @code{call_insn}, @code{barrier}
! or @code{set} expression, 1 means that it is part of a function prologue
! and sets the stack pointer, sets the frame pointer, saves a register,
! or sets up a temporary register to use in place of the frame pointer.
! In @code{reg} and @code{mem} expressions, 1 means that the expression
! holds a pointer.
In @code{symbol_ref} expressions, 1 means that the reference addresses
! this file's tree constant pool.
In an RTL dump, this flag is represented as @samp{/f}.
***************
*** 886,915 ****
label that would have been deleted is replaced with a @code{note} of type
@code{NOTE_INSN_DELETED_LABEL}.
! In an @code{insn} during dead-code elimination, 1 means that the insn is
! dead code.
!
! In an @code{insn} or @code{jump_insn} during reorg for an insn in the
! delay slot of a branch,
! 1 means that this insn is from the target of the branch.
!
! In an @code{insn} during instruction scheduling, 1 means that this insn
! must be scheduled as part of a group together with the previous insn.
In an RTL dump, this flag is represented as @samp{/s}.
! @findex integrated
@cindex @samp{/i} in RTL dump
! @item integrated
! In an @code{insn}, @code{insn_list}, or @code{const}, 1 means the RTL was
! produced by procedure integration.
!
In @code{reg} expressions, 1 means the register contains
the value to be returned by the current function. On
machines that pass parameters in registers, the same register number
may be used for parameters as well, but this flag is not set on such
uses.
In @code{symbol_ref} expressions, 1 means the referenced symbol is weak.
In an RTL dump, this flag is represented as @samp{/i}.
--- 912,938 ----
label that would have been deleted is replaced with a @code{note} of type
@code{NOTE_INSN_DELETED_LABEL}.
! In an @code{insn}, @code{jump_insn} or @code{call_insn} during reorganization
! for an insn in the delay slot of a branch, 1 means that this insn is from
! the target of the branch.
!
! In an @code{insn}, @code{jump_insn} and @code{call_insn} during instruction
! scheduling, 1 means that this insn must be scheduled as part of a group
! together with the previous insn.
In an RTL dump, this flag is represented as @samp{/s}.
! @findex return_val
@cindex @samp{/i} in RTL dump
! @item return_val
In @code{reg} expressions, 1 means the register contains
the value to be returned by the current function. On
machines that pass parameters in registers, the same register number
may be used for parameters as well, but this flag is not set on such
uses.
+ In @code{mem} expressions, 1 means the expression refers to scalar.
+
In @code{symbol_ref} expressions, 1 means the referenced symbol is weak.
In an RTL dump, this flag is represented as @samp{/i}.
***************
*** 924,929 ****
--- 947,954 ----
In a @code{call_insn}, 1 means it is a sibling call.
+ In a @code{code_label}, along with @samp{/c} encodes the label type.
+
In an RTL dump, this flag is represented as @samp{/j}.
@findex unchanging
***************
*** 3072,3086 ****
of a level of scoping of variable names. They control the output
of debugging information.
- @findex NOTE_INSN_EH_REGION_BEG
- @findex NOTE_INSN_EH_REGION_END
- @item NOTE_INSN_EH_REGION_BEG
- @itemx NOTE_INSN_EH_REGION_END
- These types of notes indicate the position of the beginning and end of a
- level of scoping for exception handling. @code{NOTE_BLOCK_NUMBER}
- identifies which @code{CODE_LABEL} or @code{note} of type
- @code{NOTE_INSN_DELETED_LABEL} is associated with the given region.
-
@findex NOTE_INSN_LOOP_BEG
@findex NOTE_INSN_LOOP_END
@item NOTE_INSN_LOOP_BEG
--- 3097,3102 ----
***************
*** 3089,3105 ****
of a @code{while} or @code{for} loop. They enable the loop optimizer
to find loops quickly.
- @findex NOTE_INSN_LOOP_CONT
- @item NOTE_INSN_LOOP_CONT
- Appears at the place in a loop that @code{continue} statements jump to.
-
- @findex NOTE_INSN_LOOP_VTOP
- @item NOTE_INSN_LOOP_VTOP
- This note indicates the place in a loop where the exit test begins for
- those loops in which the exit test has been duplicated. This position
- becomes another virtual start of the loop when considering loop
- invariants.
-
@findex NOTE_INSN_FUNCTION_BEG
@item NOTE_INSN_FUNCTION_END
Appears at the start of the function body, after the function
--- 3105,3110 ----
***************
*** 3112,3120 ****
does not suffice for returning). This note may be deleted by jump
optimization.
! @findex NOTE_INSN_SETJMP
! @item NOTE_INSN_SETJMP
! Appears following each call to @code{setjmp} or a related function.
@end table
These codes are printed symbolically when they appear in debugging dumps.
--- 3117,3162 ----
does not suffice for returning). This note may be deleted by jump
optimization.
! @findex NOTE_INSN_PROLOGUE_END
! @findex NOTE_INSN_EPILOGUE_BEG
! @item NOTE_INSN_PROLOGUE_END
! @itemx NOTE_INSN_EPILOGUE_BEG
! These notes appear right after the function prologue and right before
! the function epilogue, respectively.
!
! @findex NOTE_INSN_EH_REGION_BEG
! @findex NOTE_INSN_EH_REGION_END
! @item NOTE_INSN_EH_REGION_BEG
! @itemx NOTE_INSN_EH_REGION_END
! These types of notes indicate the position of the beginning and end of a
! level of scoping for exception handling. @code{NOTE_BLOCK_NUMBER}
! identifies which @code{CODE_LABEL} or @code{note} of type
! @code{NOTE_INSN_DELETED_LABEL} is associated with the given region.
!
! @findex NOTE_INSN_REPEATED_LINE_NUMBER
! @item NOTE_INSN_REPEATED_LINE_NUMBER
! These types of notes are generated whenever a duplicate line number note
! is output. For example, one is output after the end of an inline function,
! in order to prevent the line containing the inline call from being counted
! twice in gcov.
!
! @findex NOTE_INSN_VAR_LOCATION
! @item NOTE_INSN_VAR_LOCATION
! These notes record the location of a variable.
!
! @findex NOTE_INSN_EXPECTED_VALUE
! @item NOTE_INSN_EXPECTED_VALUE
! These notes record the expected value of a register at a location. The
! expected value is stored as (eq (reg) (const_int)).
!
! @findex NOTE_INSN_BASIC_BLOCK
! @item NOTE_INSN_BASIC_BLOCK
! These notes record the structure for the following basic block.
!
! @findex NOTE_INSN_UNLIKELY_EXECUTED_CODE
! @item NOTE_INSN_UNLIKELY_EXECUTED_CODE
! These notes record that the current basic block is unlikely to be executed and
! should be moved to the UNLIKELY_EXECUTED_TEXT_SECTION.
@end table
These codes are printed symbolically when they appear in debugging dumps.
***************
*** 3236,3241 ****
--- 3278,3291 ----
this insn since @var{op} is not necessarily modified by this insn.
Rather, no subsequent instruction uses the contents of @var{op}.
+ @findex REG_MAYBE_DEAD
+ @item REG_MAYBE_DEAD
+ This note indicates that this insn (which is part of the prologue)
+ computes a value which might not be used later, and if so it's OK to
+ delete the insn. Normally, deleting any insn in the prologue is an
+ error. At present the parameter is unused and set to (const_int 0).
+
+
@findex REG_UNUSED
@item REG_UNUSED
The register @var{op} being set by this insn will not be used in a
***************
*** 3295,3300 ****
--- 3345,3368 ----
instruction should not be ``collapsed'' into a simpler branching
construct. It is used when the optimization to partition basic blocks
into hot and cold sections is turned on.
+
+ @findex REG_NON_LOCAL_GOTO
+ @item REG_NON_LOCAL_GOTO
+ This note indicates that an indirect jump is a non-local goto instead of a
+ computed goto.
+
+ @findex REG_NORETURN
+ @item REG_NORETURN
+ This note indicates that a call does not return.
+
+ @findex REG_ALWAYS_RETURN
+ @item REG_ALWAYS_RETURN
+ This note indicates that a call always returns.
+
+ @findex REG_SETJMP
+ @item REG_SETJMP
+ This kind of note is generated at each call to `setjmp' and similar
+ functions that can return twice.
@end table
The following notes describe attributes of outputs of an insn:
***************
*** 3367,3372 ****
--- 3435,3455 ----
Thus, compiler passes prior to register allocation need only check for
@code{REG_EQUAL} notes and passes subsequent to register allocation
need only check for @code{REG_EQUIV} notes.
+
+ @findex REG_NOALIAS
+ @item REG_NOALIAS
+ This note is attached to a call insn. It indicates that the pointer
+ returned cannot alias anything.
+
+ @findex REG_SAVE_AREA
+ @item REG_SAVE_AREA
+ This note is used to optimize rtl generated by dynamic stack allocations
+ for targets where SETJMP_VIA_SAVE_AREA is true.
+
+ @findex REG_SAVE_NOTE
+ @item REG_SAVE_NOTE
+ This kind of note is used by haifa-sched to save NOTE_INSN notes across
+ scheduling.
@end table
These notes describe linkages between insns. They occur in pairs: one
***************
*** 3410,3415 ****
--- 3493,3510 ----
point to the insn using @code{cc0} and a @code{REG_CC_SETTER} note will
be placed on the insn using @code{cc0} to point to the insn setting
@code{cc0}.
+
+ @findex REG_EH_CONTEXT
+ @item REG_EH_CONTEXT
+ This note indicates that register holds the exception context for the
+ function. This context is shared by inline functions, so the code to
+ acquire the real exception context is delayed until after inlining.
+
+ @findex REG_EH_REGION
+ @item REG_EH_REGION
+ This note indicates that register holds the exception context for the
+ function. This context is shared by inline functions, so the code to
+ acquire the real exception context is delayed until after inlining.
@end table
These values are only used in the @code{LOG_LINKS} field, and indicate
***************
*** 3419,3424 ****
--- 3514,3523 ----
descriptive text.
@table @code
+ @findex REG_DEP_TRUE
+ @item REG_DEP_TRUE
+ This indicates a true dependence (a read after write dependence).
+
@findex REG_DEP_ANTI
@item REG_DEP_ANTI
This indicates an anti dependence (a write after read dependence).
***************
*** 3451,3456 ****
--- 3550,3560 ----
This is used on an RTX_FRAME_RELATED_P insn wherein the attached expression
is used in place of the actual insn pattern. This is done in cases where
the pattern is either complex or misleading.
+
+ @findex REG_VALUE_PROFILE
+ @item REG_VALUE_PROFILE
+ This note is attached to an insn when the profile is read in. It contains
+ the results of profiling.
@end table
For convenience, the machine mode in an @code{insn_list} or