The compiler assumes that certain kinds of RTL expressions are unique; there do not exist two distinct objects representing the same value. In other cases, it makes an opposite assumption: that no RTL expression object of a certain kind appears in more than one place in the containing structure.
These assumptions refer to a single function; except for the RTL objects that describe global variables and external functions, and a few standard objects such as small integer constants, no RTL objects are common to two functions.
regobject to represent it, and therefore only a single machine mode.
symbol_refobject referring to it.
const_intexpressions with equal values are shared.
const_poly_intexpressions with equal modes and values are shared.
const_doubleexpression with value 0 for each floating point mode. Likewise for values 1 and 2.
const_vectorexpression with value 0 for each vector mode, be it an integer or a double constant vector.
scratchappears in more than one place in the RTL structure; in other words, it is safe to do a tree-walk of all the insns in the function and assume that each time a
scratchis seen it is distinct from all others that are seen.
memobject is normally created for each static variable or stack slot, so these objects are frequently shared in all the places they appear. However, separate but equal objects for these variables are occasionally made.
asmstatement has multiple output operands, a distinct
asm_operandsexpression is made for each output operand. However, these all share the vector which contains the sequence of input operands. This sharing is used later on to test whether two
asm_operandsexpressions come from the same statement, so all optimizations must carefully preserve the sharing if they copy the vector at all.
unshare_all_rtlin emit-rtl.c, after which the above rules are guaranteed to be followed.
copy_rtx_if_shared, which is a subroutine of