On Tue, 19 Jul 2011, Michael Matz wrote: > Hi, > > On Tue, 19 Jul 2011, Richard Guenther wrote: > > > *************** forward_propagate_comparison (gimple stm > > *** 1164,1170 **** > > } > > /* We can propagate the condition into a statement that > > computes the logical negation of the comparison result. */ > > ! else if (gimple_assign_rhs_code (use_stmt) == TRUTH_NOT_EXPR) > > { > > tree type = TREE_TYPE (gimple_assign_rhs1 (stmt)); > > bool nans = HONOR_NANS (TYPE_MODE (type)); > > --- 1165,1174 ---- > > } > > /* We can propagate the condition into a statement that > > computes the logical negation of the comparison result. */ > > ! else if ((gimple_assign_rhs_code (use_stmt) == BIT_NOT_EXPR > > ! && TYPE_PRECISION (TREE_TYPE (lhs)) == 1) > > ! || (gimple_assign_rhs_code (use_stmt) == BIT_XOR_EXPR > > ! && integer_onep (gimple_assign_rhs2 (use_stmt)))) > > In XOR case you want either precision==1 or integer_all_onesp (the fixed > variant), otherwise it's no inversion.
As discussed offline that's not what we want. This check is to handle non-1-precision BOOLEAN_TYPEs (which still have always 1 for true and 0 for false). Consider that the above is always in the context of a comparison producing the value that is xored with 1. Richard.