Next: Jumps, Previous: Loops, Up: Statements
A simple selection statement, such as the C if
statement, is
expressed in GIMPLE using a void COND_EXPR
. If only one branch is
used, the other is filled with an empty statement.
Normally, the condition expression is reduced to a simple comparison. If
it is a shortcut (&&
or ||
) expression, however, we try to
break up the if
into multiple if
s so that the implied shortcut
is taken directly, much like the transformation done by do_jump
in
the RTL expander.
A SWITCH_EXPR
in GIMPLE contains the condition and a
TREE_VEC
of CASE_LABEL_EXPR
s describing the case values
and corresponding LABEL_DECL
s to jump to. The body of the
switch
is moved after the SWITCH_EXPR
.