Next: , Previous: Compound Lvalues, Up: GIMPLE Expressions


10.2.3.3 Conditional Expressions

A C ?: expression is converted into an if statement with each branch assigning to the same temporary. So,

       a = b ? c : d;

becomes

       if (b)
         T1 = c;
       else
         T1 = d;
       a = T1;

Tree level if-conversion pass re-introduces ?: expression, if appropriate. It is used to vectorize loops with conditions using vector conditional operations.

Note that in GIMPLE, if statements are also represented using COND_EXPR, as described below.