Commit 7b35bba3 by Roger Sayle Committed by Roger Sayle

* doc/c-tree.texi: Update description of COND_EXPR tree nodes.

From-SVN: r58268
parent b991a865
2002-10-17 Roger Sayle <roger@eyesopen.com>
* doc/c-tree.texi: Update description of COND_EXPR tree nodes.
2002-10-17 Geoffrey Keating <geoffk@apple.com> 2002-10-17 Geoffrey Keating <geoffk@apple.com>
* config/rs6000/rs6000.h (HARD_REGNO_MODE_OK): Allow arbitrary modes * config/rs6000/rs6000.h (HARD_REGNO_MODE_OK): Allow arbitrary modes
......
...@@ -2127,25 +2127,21 @@ These nodes represent @code{?:} expressions. The first operand ...@@ -2127,25 +2127,21 @@ These nodes represent @code{?:} expressions. The first operand
is of boolean or integral type. If it evaluates to a nonzero value, 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 the second operand should be evaluated, and returned as the value of the
expression. Otherwise, the third operand is evaluated, and returned as expression. Otherwise, the third operand is evaluated, and returned as
the value of the expression. As a GNU extension, the middle operand of the value of the expression.
the @code{?:} operator may be omitted in the source, like this:
The second operand must have the same type as the entire expression,
@example unless it unconditionally throws an exception or calls a noreturn
x ? : 3 function, in which case it should have void type. The same constraints
@end example apply to the third operand. This allows array bounds checks to be
@noindent represented conveniently as @code{(i >= 0 && i < 10) ? i : abort()}.
which is equivalent to
As a GNU extension, the C language front-ends allow the second
@example operand of the @code{?:} operator may be omitted in the source.
x ? x : 3 For example, @code{x ? : 3} is equivalent to @code{x ? x : 3},
@end example assuming that @code{x} is an expression without side-effects.
In the tree representation, however, the second operand is always
@noindent present, possibly protected by @code{SAVE_EXPR} if the first
assuming that @code{x} is an expression without side-effects. However, argument does cause side-effects.
in the case that the first operation causes side effects, the
side-effects occur only once. Consumers of the internal representation
do not need to worry about this oddity; the second operand will be
always be present in the internal representation.
@item CALL_EXPR @item CALL_EXPR
These nodes are used to represent calls to functions, including These nodes are used to represent calls to functions, including
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment