X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCast.c;h=a81dd39c904cb6f6062ff96b51f54d8c0d5df37f;hb=9c1f16e0c496f60a6e49aa115b8819f4f3b2e585;hp=84bbdd8f67d8b0cffb202b0fd7a3383da8b9f725;hpb=9ad3112a0d40d8007803a97abf32198d44a7f561;p=fw%2Fsdcc diff --git a/src/SDCCast.c b/src/SDCCast.c index 84bbdd8f..a81dd39c 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -3646,8 +3646,13 @@ decorateType (ast * tree, RESULT_TYPE resultType) } /* if left is another '!' */ - if (tree->left->opval.op == '!') + if (IS_AST_NOT_OPER (tree->left)) { + if ((resultType == RESULT_TYPE_IFX) || (resultType == RESULT_TYPE_BIT)) + { + /* remove double '!!X' by 'X' */ + return tree->left->left; + } /* remove double '!!X' by 'X ? 1 : 0' */ tree->opval.op = '?'; tree->left = tree->left->left; @@ -4132,7 +4137,7 @@ decorateType (ast * tree, RESULT_TYPE resultType) IS_LITERAL(RTYPE(tree)) && ((int) floatFromVal (valFromType (RETYPE (tree)))) == 0) { - if (resultType == RESULT_TYPE_IFX) + if ((resultType == RESULT_TYPE_IFX) || (resultType == RESULT_TYPE_BIT)) { /* the parent is an ifx: */ /* if (unsigned value) */