From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28892 invoked by alias); 21 Jul 2011 11:34:06 -0000 Received: (qmail 28619 invoked by uid 22791); 21 Jul 2011 11:34:04 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_TM X-Spam-Check-By: sourceware.org Received: from mail-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Jul 2011 11:33:27 +0000 Received: by gyd12 with SMTP id 12so669392gyd.20 for ; Thu, 21 Jul 2011 04:33:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.108.1 with SMTP id k1mr567849ybm.102.1311248006157; Thu, 21 Jul 2011 04:33:26 -0700 (PDT) Received: by 10.150.205.2 with HTTP; Thu, 21 Jul 2011 04:33:26 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 Jul 2011 12:13:00 -0000 Message-ID: Subject: Re: [patch tree-optimization]: [2 of 3]: Boolify compares & more From: Richard Guenther To: Kai Tietz Cc: GCC Patches Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-07/txt/msg01745.txt.bz2 On Thu, Jul 21, 2011 at 1:12 PM, Kai Tietz wrote: > Hello, > > Updated and again merged variant of this patch. > We have now just two vrp related regressions by this patch, > and it is addressed already by a posted one. > > 2011-07-21 =A0Kai Tietz =A0 > > =A0 =A0 =A0 =A0* fold-const.c (fold_unary_loc): Preserve indirect > =A0 =A0 =A0 =A0comparison cast to none-boolean type. > =A0 =A0 =A0 =A0* tree-ssa.c (useless_type_conversion_p): Preserve cast > =A0 =A0 =A0 =A0from/to boolean-type. > =A0 =A0 =A0 =A0* gimplify.c (gimple_boolify): Handle boolification > =A0 =A0 =A0 =A0of comparisons. > =A0 =A0 =A0 =A0(gimplify_expr): Boolifiy non aggregate-typed > =A0 =A0 =A0 =A0comparisons. > =A0 =A0 =A0 =A0* tree-cfg.c (verify_gimple_comparison): Check result > =A0 =A0 =A0 =A0type of comparison expression. > =A0 =A0 =A0 =A0* tree-ssa-forwprop.c (forward_propagate_comparison): > =A0 =A0 =A0 =A0Adjust test of condition result and disallow type-cast > =A0 =A0 =A0 =A0sinking into comparison. > > > =A0 =A0 =A0 =A0* gcc.dg/tree-ssa/pr21031.c: Adjusted. > =A0 =A0 =A0 =A0* gcc.dg/tree-ssa/pr30978.c: Likewise. > =A0 =A0 =A0 =A0* gcc.dg/tree-ssa/ssa-fre-6.c: Likewise. > > Bootstrapped and regression tested for x86_64-pc-linux-gnu. =A0Ok for app= ly? Comments below (well, just two minor testsuite ones). > Regards, > Kai > > Index: gcc-head/gcc/fold-const.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc-head.orig/gcc/fold-const.c > +++ gcc-head/gcc/fold-const.c > @@ -7664,11 +7664,11 @@ fold_unary_loc (location_t loc, enum tre > =A0 =A0 =A0 =A0 =A0 =A0 non-integral type. > =A0 =A0 =A0 =A0 =A0 =A0 Do not fold the result as that would not simplify= further, also > =A0 =A0 =A0 =A0 =A0 =A0 folding again results in recursions. =A0*/ > - =A0 =A0 =A0 =A0 if (INTEGRAL_TYPE_P (type)) > + =A0 =A0 =A0 =A0 if (TREE_CODE (type) =3D=3D BOOLEAN_TYPE) > =A0 =A0 =A0 =A0 =A0 =A0return build2_loc (loc, TREE_CODE (op0), type, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 TREE_OPERAND = (op0, 0), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 TREE_OPERAND = (op0, 1)); > - =A0 =A0 =A0 =A0 else > + =A0 =A0 =A0 =A0 else if (!INTEGRAL_TYPE_P (type)) > =A0 =A0 =A0 =A0 =A0 =A0return build3_loc (loc, COND_EXPR, type, op0, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fold_convert = (type, boolean_true_node), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fold_convert = (type, boolean_false_node)); > Index: gcc-head/gcc/tree-ssa.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc-head.orig/gcc/tree-ssa.c > +++ gcc-head/gcc/tree-ssa.c > @@ -1306,10 +1306,10 @@ useless_type_conversion_p (tree outer_ty > =A0 =A0 =A0 =A0 =A0|| TYPE_PRECISION (inner_type) !=3D TYPE_PRECISION (ou= ter_type)) > =A0 =A0 =A0 =A0return false; > > - =A0 =A0 =A0/* Preserve conversions to BOOLEAN_TYPE if it is not of prec= ision > - =A0 =A0 =A0 =A0 one. =A0*/ > - =A0 =A0 =A0if (TREE_CODE (inner_type) !=3D BOOLEAN_TYPE > - =A0 =A0 =A0 =A0 && TREE_CODE (outer_type) =3D=3D BOOLEAN_TYPE > + =A0 =A0 =A0/* Preserve conversions to/from BOOLEAN_TYPE if types are not > + =A0 =A0 =A0 =A0of precision one. =A0*/ > + =A0 =A0 =A0if (((TREE_CODE (inner_type) =3D=3D BOOLEAN_TYPE) > + =A0 =A0 =A0 =A0 =A0!=3D (TREE_CODE (outer_type) =3D=3D BOOLEAN_TYPE)) > =A0 =A0 =A0 =A0 =A0&& TYPE_PRECISION (outer_type) !=3D 1) > =A0 =A0 =A0 =A0return false; > > Index: gcc-head/gcc/testsuite/gcc.dg/binop-xor1.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc-head.orig/gcc/testsuite/gcc.dg/binop-xor1.c > +++ gcc-head/gcc/testsuite/gcc.dg/binop-xor1.c > @@ -7,8 +7,5 @@ foo (int a, int b, int c) > =A0 return ((a && !b && c) || (!a && b && c)); > =A0} > > -/* We expect to see ""; confirm that, so that we know to count > - =A0 it in the real test. =A0*/ > -/* { dg-final { scan-tree-dump-times "\]*>" 5 "optimized" } } */ > -/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */ > +/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" { xfail > *-*-* } } } */ > =A0/* { dg-final { cleanup-tree-dump "optimized" } } */ > Index: gcc-head/gcc/testsuite/gcc.dg/binop-xor3.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc-head.orig/gcc/testsuite/gcc.dg/binop-xor3.c > +++ gcc-head/gcc/testsuite/gcc.dg/binop-xor3.c > @@ -7,8 +7,5 @@ foo (int a, int b) > =A0 return ((a && !b) || (!a && b)); > =A0} > > -/* We expect to see ""; confirm that, so that we know to count > - =A0 it in the real test. =A0*/ > -/* { dg-final { scan-tree-dump-times "\]*>" 1 "optimized" } } */ > -/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */ > +/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" { xfail > *-*-* } } } */ > =A0/* { dg-final { cleanup-tree-dump "optimized" } } */ > Index: gcc-head/gcc/tree-ssa-forwprop.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc-head.orig/gcc/tree-ssa-forwprop.c > +++ gcc-head/gcc/tree-ssa-forwprop.c > @@ -1132,20 +1132,12 @@ forward_propagate_comparison (gimple stm > =A0 if (!INTEGRAL_TYPE_P (TREE_TYPE (lhs))) > =A0 =A0 return false; > > - =A0/* We can propagate the condition into a conversion. =A0*/ > - =A0if (CONVERT_EXPR_CODE_P (code)) > - =A0 =A0{ > - =A0 =A0 =A0/* Avoid using fold here as that may create a COND_EXPR with > - =A0 =A0 =A0 =A0non-boolean condition as canonical form. =A0*/ > - =A0 =A0 =A0tmp =3D build2 (gimple_assign_rhs_code (stmt), TREE_TYPE (lh= s), > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gimple_assign_rhs1 (stmt), gimple_a= ssign_rhs2 (stmt)); > - =A0 =A0} > =A0 /* We can propagate the condition into a statement that > =A0 =A0 =A0computes the logical negation of the comparison result. =A0*/ > - =A0else if ((code =3D=3D BIT_NOT_EXPR > - =A0 =A0 =A0 =A0 =A0 && TYPE_PRECISION (TREE_TYPE (lhs)) =3D=3D 1) > - =A0 =A0 =A0 =A0 =A0|| (code =3D=3D BIT_XOR_EXPR > - =A0 =A0 =A0 =A0 =A0 =A0 =A0&& integer_onep (gimple_assign_rhs2 (use_stm= t)))) > + =A0if ((code =3D=3D BIT_NOT_EXPR > + =A0 =A0 =A0 && TYPE_PRECISION (TREE_TYPE (lhs)) =3D=3D 1) > + =A0 =A0 =A0|| (code =3D=3D BIT_XOR_EXPR > + =A0 =A0 =A0 =A0 && integer_onep (gimple_assign_rhs2 (use_stmt)))) > =A0 =A0 { > =A0 =A0 =A0 tree type =3D TREE_TYPE (gimple_assign_rhs1 (stmt)); > =A0 =A0 =A0 bool nans =3D HONOR_NANS (TYPE_MODE (type)); > @@ -1750,6 +1742,7 @@ simplify_bitwise_binary (gimple_stmt_ite > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0arg2)); > =A0 =A0 =A0 tem =3D make_ssa_name (tem, newop); > =A0 =A0 =A0 gimple_assign_set_lhs (newop, tem); > + =A0 =A0 =A0gimple_set_location (newop, gimple_location (stmt)); > =A0 =A0 =A0 gsi_insert_before (gsi, newop, GSI_SAME_STMT); > =A0 =A0 =A0 gimple_assign_set_rhs_with_ops_1 (gsi, NOP_EXPR, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0tem, NULL_TREE, NULL_TREE); > @@ -1779,6 +1772,7 @@ simplify_bitwise_binary (gimple_stmt_ite > =A0 =A0 =A0 newop =3D gimple_build_assign_with_ops (code, tem, def1_arg1,= def2_arg1); > =A0 =A0 =A0 tem =3D make_ssa_name (tem, newop); > =A0 =A0 =A0 gimple_assign_set_lhs (newop, tem); > + =A0 =A0 =A0gimple_set_location (newop, gimple_location (stmt)); > =A0 =A0 =A0 gsi_insert_before (gsi, newop, GSI_SAME_STMT); > =A0 =A0 =A0 gimple_assign_set_rhs_with_ops_1 (gsi, NOP_EXPR, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0tem, NULL_TREE, NULL_TREE); > @@ -1807,6 +1801,7 @@ simplify_bitwise_binary (gimple_stmt_ite > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0tem, def1_arg1, arg2); > =A0 =A0 =A0 tem =3D make_ssa_name (tem, newop); > =A0 =A0 =A0 gimple_assign_set_lhs (newop, tem); > + =A0 =A0 =A0gimple_set_location (newop, gimple_location (stmt)); > =A0 =A0 =A0 /* Make sure to re-process the new stmt as it's walking upwar= ds. =A0*/ > =A0 =A0 =A0 gsi_insert_before (gsi, newop, GSI_NEW_STMT); > =A0 =A0 =A0 gimple_assign_set_rhs1 (stmt, tem); > Index: gcc-head/gcc/gimplify.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc-head.orig/gcc/gimplify.c > +++ gcc-head/gcc/gimplify.c > @@ -2860,18 +2860,23 @@ gimple_boolify (tree expr) > > =A0 =A0 case TRUTH_NOT_EXPR: > =A0 =A0 =A0 TREE_OPERAND (expr, 0) =3D gimple_boolify (TREE_OPERAND (expr= , 0)); > - =A0 =A0 =A0/* FALLTHRU */ > > - =A0 =A0case EQ_EXPR: case NE_EXPR: > - =A0 =A0case LE_EXPR: case GE_EXPR: case LT_EXPR: case GT_EXPR: > =A0 =A0 =A0 /* These expressions always produce boolean results. =A0*/ > - =A0 =A0 =A0TREE_TYPE (expr) =3D boolean_type_node; > + =A0 =A0 =A0if (TREE_CODE (type) !=3D BOOLEAN_TYPE) > + =A0 =A0 =A0 TREE_TYPE (expr) =3D boolean_type_node; > =A0 =A0 =A0 return expr; > > =A0 =A0 default: > + =A0 =A0 =A0if (COMPARISON_CLASS_P (expr)) > + =A0 =A0 =A0 { > + =A0 =A0 =A0 =A0 /* There expressions always prduce boolean results. =A0= */ > + =A0 =A0 =A0 =A0 if (TREE_CODE (type) !=3D BOOLEAN_TYPE) > + =A0 =A0 =A0 =A0 =A0 TREE_TYPE (expr) =3D boolean_type_node; > + =A0 =A0 =A0 =A0 return expr; > + =A0 =A0 =A0 } > =A0 =A0 =A0 /* Other expressions that get here must have boolean values, = but > =A0 =A0 =A0 =A0 might need to be converted to the appropriate mode. =A0*/ > - =A0 =A0 =A0if (type =3D=3D boolean_type_node) > + =A0 =A0 =A0if (TREE_CODE (type) =3D=3D BOOLEAN_TYPE) > =A0 =A0 =A0 =A0return expr; > =A0 =A0 =A0 return fold_convert_loc (loc, boolean_type_node, expr); > =A0 =A0 } > @@ -7316,7 +7321,19 @@ gimplify_expr (tree *expr_p, gimple_seq > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tree type =3D TREE_TYPE (TREE_OPERAND = (*expr_p, 1)); > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!AGGREGATE_TYPE_P (type)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto expr_2; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 tree org_type =3D TREE_TYPE (*e= xpr_p); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 *expr_p =3D gimple_boolify (*ex= pr_p); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!useless_type_conversion_p = (org_type, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 TREE_TYPE (*expr_p))) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 *expr_p =3D fold_conver= t_loc (input_location, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 org_type, *expr_p); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D GS_OK; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto expr_2; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else if (TYPE_MODE (type) !=3D BLKmode) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ret =3D gimplify_scalar_mode_aggre= gate_compare (expr_p); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else > Index: gcc-head/gcc/testsuite/gcc.dg/tree-ssa/pr21031.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc-head.orig/gcc/testsuite/gcc.dg/tree-ssa/pr21031.c > +++ gcc-head/gcc/testsuite/gcc.dg/tree-ssa/pr21031.c > @@ -16,5 +16,5 @@ foo (int a) > =A0 =A0 return 0; > =A0} > > -/* { dg-final { scan-tree-dump-times "Replaced" 2 "forwprop1"} } */ > +/* { dg-final { scan-tree-dump-times "Replaced" 1 "forwprop1"} } */ I have looked at this change and it shows a regression for which I am currently testing a patch, so this change will not be necessary. > =A0/* { dg-final { cleanup-tree-dump "forwprop1" } } */ > Index: gcc-head/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc-head.orig/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c > +++ gcc-head/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c > @@ -10,5 +10,5 @@ int foo(int a) > =A0 return e; > =A0} > > -/* { dg-final { scan-tree-dump "e_. =3D a_..D. > 0;" "optimized" } } */ > +/* { dg-final { scan-tree-dump " =3D a_..D. > 0;" "optimized" } } */ That no longer tests what the test was trying to do - we were testing that the comparison is fully propagated to the return value. Now we get (an expected) widening to the return type. So we should test for something that still makes sure we did the required optimization, which would for example be /* We expect exactly two assignments. */ /* { dg-final { scan-tree-dump-times " =3D " 2 "optimized" } } */ /* One comparison and one extension to int. */ /* { dg-final { scan-tree-dump " =3D a_..D. > 0;" "optimized" } } */ /* { dg-final { scan-tree-dump "e_. =3D \\\(int\\\)" "optimized" } } */ please change the testcase this way (verifying that my suggestion indeed works). With these two changes the patch is ok to commit (it will also regress gcc.target/i386/andor-2.c but that is an exact duplicate of the already regressed gcc.dg/tree-ssa/vrp47.c). Thanks, Richard. > =A0/* { dg-final { cleanup-tree-dump "optimized" } } */ > Index: gcc-head/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc-head.orig/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c > +++ gcc-head/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c > @@ -2,5 +2,5 @@ > =A0/* { dg-options "-O -fdump-tree-fre1-details" } */ > > =A0int i; int foo(void) { i =3D 2; int j =3D i * 2; int k =3D i + 2; retu= rn j =3D=3D k; } > -/* { dg-final { scan-tree-dump-times "Replaced " 5 "fre1" } } */ > +/* { dg-final { scan-tree-dump-times "Replaced " 6 "fre1" } } */ > =A0/* { dg-final { cleanup-tree-dump "fre1" } } */ > Index: gcc-head/gcc/tree-cfg.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc-head.orig/gcc/tree-cfg.c > +++ gcc-head/gcc/tree-cfg.c > @@ -3203,7 +3203,9 @@ verify_gimple_comparison (tree type, tre > =A0 =A0 =A0 =A0&& (!POINTER_TYPE_P (op0_type) > =A0 =A0 =A0 =A0 =A0 || !POINTER_TYPE_P (op1_type) > =A0 =A0 =A0 =A0 =A0 || TYPE_MODE (op0_type) !=3D TYPE_MODE (op1_type))) > - =A0 =A0 =A0|| !INTEGRAL_TYPE_P (type)) > + =A0 =A0 =A0|| !INTEGRAL_TYPE_P (type) > + =A0 =A0 =A0|| (TREE_CODE (type) !=3D BOOLEAN_TYPE > + =A0 =A0 =A0 =A0 && TYPE_PRECISION (type) !=3D 1)) > =A0 =A0 { > =A0 =A0 =A0 error ("type mismatch in comparison expression"); > =A0 =A0 =A0 debug_generic_expr (type); >