+2007-06-04 Maarten Brock <sourceforge.brock AT dse.nl>
+
+ * src/SDCCast.c(decorateType): better optimize '!!' and comparisons
+
2007-06-04 Borut Razem <borut.razem AT siol.net>
* configure.in, configure, config_vc.awk: sdcc version number is now
}
/* 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;
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) */