{
if (integer_zerop (expr))
{
- expr = build_int_cst (type, 0, 0);
+ expr = build_int_cst (type, 0);
return expr;
}
case BOOLEAN_TYPE:
case CHAR_TYPE:
/* If this is a logical operation, which just returns 0 or 1, we can
- change the type of the expression. For some logical operations,
- we must also change the types of the operands to maintain type
- correctness. */
+ change the type of the expression. */
- if (TREE_CODE_CLASS (ex_form) == '<')
+ if (TREE_CODE_CLASS (ex_form) == tcc_comparison)
{
expr = copy_node (expr);
TREE_TYPE (expr) = type;
return expr;
}
- else if (ex_form == TRUTH_AND_EXPR || ex_form == TRUTH_ANDIF_EXPR
- || ex_form == TRUTH_OR_EXPR || ex_form == TRUTH_ORIF_EXPR
- || ex_form == TRUTH_XOR_EXPR)
- {
- expr = copy_node (expr);
- TREE_OPERAND (expr, 0) = convert (type, TREE_OPERAND (expr, 0));
- TREE_OPERAND (expr, 1) = convert (type, TREE_OPERAND (expr, 1));
- TREE_TYPE (expr) = type;
- return expr;
- }
-
- else if (ex_form == TRUTH_NOT_EXPR)
- {
- expr = copy_node (expr);
- TREE_OPERAND (expr, 0) = convert (type, TREE_OPERAND (expr, 0));
- TREE_TYPE (expr) = type;
- return expr;
- }
-
/* If we are widening the type, put in an explicit conversion.
Similarly if we are not changing the width. After this, we know
we are truncating EXPR. */
default:
error ("can't convert value to a vector");
- return convert_to_vector (type, integer_zero_node);
+ return error_mark_node;
}
}