if (lhs == 0)
+ {
+ true_value = fold_convert (type, true_value);
! lhs = fold (cond_first_p ? build2 (code, type, true_value, arg)
! : build2 (code, type, arg,
true_value));
+ }
if (rhs == 0)
+ {
+ false_value = fold_convert (type, false_value);
! rhs = fold (cond_first_p ? build2 (code, type, false_value,
arg)
! : build2 (code, type, arg,
false_value));
+ }
This should avoid potential problems with true_value or false_value
being "void" in a COND_EXPR, and matches the intended semantics.
Could you see if this untested suggestion works for you?