(truthvalue_conversion, BIT_AND_EXPR): Make sure that the result has

boolean_type_node.

From-SVN: r9844
This commit is contained in:
Richard Kenner 1995-05-31 07:31:46 -04:00
parent a0ab04225b
commit 58cee64304
1 changed files with 5 additions and 2 deletions

View File

@ -2103,8 +2103,11 @@ truthvalue_conversion (expr)
TREE_OPERAND (expr, 1))), 1);
case BIT_AND_EXPR:
if (integer_onep (TREE_OPERAND (expr, 1)))
return expr;
if (integer_onep (TREE_OPERAND (expr, 1))
&& TREE_TYPE (expr) != boolean_type_node)
/* Using convert here would cause infinite recursion. */
return build1 (NOP_EXPR, boolean_type_node, expr);
break;
case MODIFY_EXPR:
if (warn_parentheses && C_EXP_ORIGINAL_CODE (expr) == MODIFY_EXPR)