{
case AND_OP:
case OR_OP:
+ case '!':
return resultType;
case '=':
case '?':
if (IS_LITERAL(RTYPE(tree)) &&
floatFromVal (valFromType (RETYPE (tree))) == 0 &&
tree->opval.op == EQ_OP &&
- resultType == RESULT_TYPE_IFX)
+ (resultType == RESULT_TYPE_IFX || resultType == RESULT_TYPE_BIT))
{
tree->opval.op = '!';
tree->right = NULL;
}
LRVAL (tree) = RRVAL (tree) = 1;
- TTYPE (tree) = TETYPE (tree) = newBoolLink ();
+ TTYPE (tree) = TETYPE (tree) = (resultType == RESULT_TYPE_BIT) ? newBoolLink() :newCharLink();
/* condition transformations */
{
root->right->opval.val : NULL);
/* if left is a BITVAR in BITSPACE */
- /* and right is a LITERAL then opt- */
- /* imize else do nothing */
+ /* and right is a LITERAL then */
+ /* optimize else do nothing */
if (vleft && vright &&
IS_BITVAR (vleft->etype) &&
IN_BITSPACE (SPEC_OCLS (vleft->etype)) &&