This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Rewrite TRUTH_NOT_EXPR as BIT_{NOT,XOR}_EXPR
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.
Ciao,
Michael.