These nodes represent unary negation of the single operand, for both integer and floating-point types. The type of negation can be determined by looking at the type of the expression.
The behavior of this operation on signed arithmetic overflow is
controlled by the
These nodes represent the absolute value of the single operand, for
both integer and floating-point types. This is typically used to
llabs builtins for
integer types, and the
builtins for floating point types. The type of abs operation can
be determined by looking at the type of the expression.
This node is not used for complex types. To represent the modulus
or complex abs of a complex value, use the
BUILT_IN_CABSL builtins, as used
to implement the C99
These nodes represent the absolute value of the single operand in
equivalent unsigned type such that
ABSU_EXPR of TYPE_MIN is
These nodes represent bitwise complement, and will always have integral type. The only operand is the value to be complemented.
These nodes represent logical negation, and will always have integral
(or boolean) type. The operand is the value being negated. The type
of the operand and that of the result are always of
These nodes represent increment and decrement expressions. The value of
the single operand is computed, and the operand incremented or
decremented. In the case of
PREINCREMENT_EXPR, the value of the expression is the value
resulting after the increment or decrement; in the case of
POSTINCREMENT_EXPR is the value
before the increment or decrement occurs. The type of the operand, like
that of the result, will be either integral, boolean, or floating-point.
These nodes represent conversion of a floating-point value to an integer. The single operand will have a floating-point type, while the complete expression will have an integral (or boolean) type. The operand is rounded towards zero.
These nodes represent conversion of an integral (or boolean) value to a floating-point value. The single operand will have integral type, while the complete expression will have a floating-point type.
FIXME: How is the operand supposed to be rounded? Is this dependent on -mieee?
These nodes are used to represent complex numbers constructed from two expressions of the same (integer or real) type. The first operand is the real part and the second operand is the imaginary part.
These nodes represent the conjugate of their operand.
These nodes represent respectively the real and the imaginary parts of complex numbers (their sole argument).
These nodes indicate that their one and only operand is not an lvalue. A back end can treat these identically to the single operand.
These nodes are used to represent conversions that do not require any
code-generation. For example, conversion of a
char* to an
int* does not require any code be generated; such a conversion is
represented by a
NOP_EXPR. The single operand is the expression
to be converted. The conversion from a pointer to a reference is also
represented with a
These nodes are similar to
NOP_EXPRs, but are used in those
situations where code may need to be generated. For example, if an
int* is converted to an
int code may need to be generated
on some platforms. These nodes are never used for C++-specific
conversions, like conversions between pointers to different classes in
an inheritance hierarchy. Any adjustments that need to be made in such
cases are always indicated explicitly. Similarly, a user-defined
conversion is never represented by a
CONVERT_EXPR; instead, the
function calls are made explicit.
These nodes are used to represent conversions that involve fixed-point values. For example, from a fixed-point value to another fixed-point value, from an integer to a fixed-point value, from a fixed-point value to an integer, from a floating-point value to a fixed-point value, or from a fixed-point value to a floating-point value.
These nodes represent left and right shifts, respectively. The first operand is the value to shift; it will always be of integral type. The second operand is an expression for the number of bits by which to shift. Right shift should be treated as arithmetic, i.e., the high-order bits should be zero-filled when the expression has unsigned type and filled with the sign bit when the expression has signed type. Note that the result is undefined if the second operand is larger than or equal to the first operand’s type size. Unlike most nodes, these can have a vector as first operand and a scalar as second operand.
These nodes represent bitwise inclusive or, bitwise exclusive or, and bitwise and, respectively. Both operands will always have integral type.
These nodes represent logical “and” and logical “or”, respectively.
These operators are not strict; i.e., the second operand is evaluated
only if the value of the expression is not determined by evaluation of
the first operand. The type of the operands and that of the result are
These nodes represent logical and, logical or, and logical exclusive or.
They are strict; both arguments are always evaluated. There are no
corresponding operators in C or C++, but the front end will sometimes
generate these expressions anyhow, if it can tell that strictness does
not matter. The type of the operands and that of the result are
This node represents pointer arithmetic. The first operand is always a pointer/reference type. The second operand is always an unsigned integer type compatible with sizetype. This and POINTER_DIFF_EXPR are the only binary arithmetic operators that can operate on pointer types.
This node represents pointer subtraction. The two operands always have pointer/reference type. It returns a signed integer of the same precision as the pointers. The behavior is undefined if the difference of the two pointers, seen as infinite precision non-negative integers, does not fit in the result type. The result does not depend on the pointer type, it is not divided by the size of the pointed-to type.
These nodes represent various binary arithmetic operations. Respectively, these operations are addition, subtraction (of the second operand from the first) and multiplication. Their operands may have either integral or floating type, but there will never be case in which one operand is of floating type and the other is of integral type.
The behavior of these operations on signed arithmetic overflow is
controlled by the
This node represents the “high-part” of a widening multiplication. For an integral type with b bits of precision, the result is the most significant b bits of the full 2b product.
This node represents a floating point division operation.
These nodes represent integer division operations that return an integer
TRUNC_DIV_EXPR rounds towards zero,
rounds towards negative infinity,
CEIL_DIV_EXPR rounds towards
positive infinity and
ROUND_DIV_EXPR rounds to the closest integer.
Integer division in C and C++ is truncating, i.e.
The behavior of these operations on signed arithmetic overflow, when
dividing the minimum signed integer by minus one, is controlled by the
These nodes represent the integer remainder or modulus operation.
The integer modulus of two operands
a - (a/b)*b where the division calculated using
the corresponding division operator. Hence for
this definition assumes division using truncation towards zero, i.e.
TRUNC_DIV_EXPR. Integer remainder in C and C++ uses truncating
EXACT_DIV_EXPR code is used to represent integer divisions where
the numerator is known to be an exact multiple of the denominator. This
allows the backend to choose between the faster of
FLOOR_DIV_EXPR for the current target.
These nodes represent the less than, less than or equal to, greater than, greater than or equal to, equal, and not equal comparison operators. The first and second operands will either be both of integral type, both of floating type or both of vector type. The result type of these expressions will always be of integral, boolean or signed integral vector type. These operations return the result type’s zero value for false, the result type’s one value for true, and a vector whose elements are zero (false) or minus one (true) for vectors.
For floating point comparisons, if we honor IEEE NaNs and either operand
is NaN, then
NE_EXPR always returns true and the remaining operators
always return false. On some targets, comparisons against an IEEE NaN,
other than equality and inequality, may generate a floating point exception.
These nodes represent non-trapping ordered and unordered comparison operators. These operations take two floating point operands and determine whether they are ordered or unordered relative to each other. If either operand is an IEEE NaN, their comparison is defined to be unordered, otherwise the comparison is defined to be ordered. The result type of these expressions will always be of integral or boolean type. These operations return the result type’s zero value for false, and the result type’s one value for true.
These nodes represent the unordered comparison operators.
These operations take two floating point operands and determine whether
the operands are unordered or are less than, less than or equal to,
greater than, greater than or equal to, or equal respectively. For
UNLT_EXPR returns true if either operand is an IEEE
NaN or the first operand is less than the second. With the possible
LTGT_EXPR, all of these operations are guaranteed
not to generate a floating point exception. The result
type of these expressions will always be of integral or boolean type.
These operations return the result type’s zero value for false,
and the result type’s one value for true.
These nodes represent assignment. The left-hand side is the first
operand; the right-hand side is the second operand. The left-hand side
will be a
These nodes are used to represent not only assignment with ‘=’ but also compound assignments (like ‘+=’), by reduction to ‘=’ assignment. In other words, the representation for ‘i += 3’ looks just like that for ‘i = i + 3’.
These nodes are just like
MODIFY_EXPR, but are used only when a
variable is initialized, rather than assigned to subsequently. This
means that we can assume that the target of the initialization is not
used in computing its own value; any reference to the lhs in computing
the rhs is undefined.
These nodes represent comma-expressions. The first operand is an expression whose value is computed and thrown away prior to the evaluation of the second operand. The value of the entire expression is the value of the second operand.
These nodes represent
?: expressions. The first operand
is of boolean or integral type. If it evaluates to a nonzero value,
the second operand should be evaluated, and returned as the value of the
expression. Otherwise, the third operand is evaluated, and returned as
the value of the expression.
The second operand must have the same type as the entire expression,
unless it unconditionally throws an exception or calls a noreturn
function, in which case it should have void type. The same constraints
apply to the third operand. This allows array bounds checks to be
represented conveniently as
(i >= 0 && i < 10) ? i : abort().
As a GNU extension, the C language front-ends allow the second
operand of the
?: operator may be omitted in the source.
x ? : 3 is equivalent to
x ? x : 3,
x is an expression without side effects.
In the tree representation, however, the second operand is always
present, possibly protected by
SAVE_EXPR if the first
argument does cause side effects.
These nodes are used to represent calls to functions, including
non-static member functions.
CALL_EXPRs are implemented as
expression nodes with a variable number of operands. Rather than using
TREE_OPERAND to extract them, it is preferable to use the
specialized accessor macros and functions that operate specifically on
CALL_EXPR_FN returns a pointer to the
function to call; it is always an expression whose type is a
The number of arguments to the call is returned by
while the arguments themselves can be accessed with the
macro. The arguments are zero-indexed and numbered left-to-right.
You can iterate over the arguments using
FOR_EACH_CALL_EXPR_ARG, as in:
tree call, arg; call_expr_arg_iterator iter; FOR_EACH_CALL_EXPR_ARG (arg, iter, call) /* arg is bound to successive arguments of call. */ …;
member functions, there will be an operand corresponding to the
this pointer. There will always be expressions corresponding to
all of the arguments, even if the function is declared with default
arguments and some arguments are not explicitly provided at the call
CALL_EXPRs also have a
CALL_EXPR_STATIC_CHAIN operand that
is used to implement nested functions. This operand is otherwise null.
These nodes represent full-expressions. The single operand is an expression to evaluate. Any destructor calls engendered by the creation of temporaries during the evaluation of that expression should be performed immediately after the expression is evaluated.
These nodes represent the brace-enclosed initializers for a structure or an
array. They contain a sequence of component values made out of a vector of
constructor_elt, which is a (
TREE_TYPE of the
CONSTRUCTOR is a
QUAL_UNION_TYPE then the
INDEX of each
node in the sequence will be a
FIELD_DECL and the
be the expression used to initialize that field.
TREE_TYPE of the
CONSTRUCTOR is an
INDEX of each node in the sequence will be an
INTEGER_CST or a
RANGE_EXPR of two
INTEGER_CST indicates which element of the array is being
assigned to. A
RANGE_EXPR indicates an inclusive range of elements
to initialize. In both cases the
VALUE is the corresponding
initializer. It is re-evaluated for each element of a
RANGE_EXPR. If the
the initializer is for the next available array element.
In the front end, you should not depend on the fields appearing in any particular order. However, in the middle end, fields must appear in declaration order. You should not assume that all fields will be represented. Unrepresented fields will be cleared (zeroed), unless the CONSTRUCTOR_NO_CLEARING flag is set, in which case their value becomes undefined.
These nodes represent ISO C99 compound literals. The
COMPOUND_LITERAL_EXPR_DECL_EXPR is a
containing an anonymous
the unnamed object represented by the compound literal; the
DECL_INITIAL of that
VAR_DECL is a
representing the brace-enclosed list of initializers in the compound
literal. That anonymous
VAR_DECL can also be accessed directly
SAVE_EXPR represents an expression (possibly involving
side effects) that is used more than once. The side effects should
occur only the first time the expression is evaluated. Subsequent uses
should just reuse the computed value. The first operand to the
SAVE_EXPR is the expression to evaluate. The side effects should
be executed where the
SAVE_EXPR is first encountered in a
depth-first preorder traversal of the expression tree.
TARGET_EXPR represents a temporary object. The first operand
VAR_DECL for the temporary variable. The second operand is
the initializer for the temporary. The initializer is evaluated and,
if non-void, copied (bitwise) into the temporary. If the initializer
is void, that means that it will perform the initialization itself.
TARGET_EXPR occurs on the right-hand side of an
assignment, or as the second operand to a comma-expression which is
itself the right-hand side of an assignment, etc. In this case, we say
TARGET_EXPR is “normal”; otherwise, we say it is
“orphaned”. For a normal
TARGET_EXPR the temporary variable
should be treated as an alias for the left-hand side of the assignment,
rather than as a new temporary variable.
The third operand to the
TARGET_EXPR, if present, is a
cleanup-expression (i.e., destructor call) for the temporary. If this
expression is orphaned, then this expression must be executed when the
statement containing this expression is complete. These cleanups must
always be executed in the order opposite to that in which they were
encountered. Note that if a temporary is created on one branch of a
conditional operator (i.e., in the second or third operand to a
COND_EXPR), the cleanup must be run only if that branch is
This node is used to implement support for the C/C++ variable argument-list
mechanism. It represents expressions like
va_arg (ap, type).
TREE_TYPE yields the tree representation for
its sole argument yields the representation for
This node is used to attach markers to an expression. The first operand
is the annotated expression, the second is an
a value from
enum annot_expr_kind, the third is an