From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7532 invoked by alias); 19 Jul 2011 11:43:45 -0000 Received: (qmail 7518 invoked by uid 22791); 19 Jul 2011 11:43:42 -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-gx0-f175.google.com (HELO mail-gx0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Jul 2011 11:43:07 +0000 Received: by gxk3 with SMTP id 3so1911752gxk.20 for ; Tue, 19 Jul 2011 04:43:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.169.1 with SMTP id r1mr6445706ybe.216.1311075786034; Tue, 19 Jul 2011 04:43:06 -0700 (PDT) Received: by 10.150.205.2 with HTTP; Tue, 19 Jul 2011 04:43:05 -0700 (PDT) In-Reply-To: References: Date: Tue, 19 Jul 2011 12:16: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/msg01500.txt.bz2 On Tue, Jul 19, 2011 at 1:27 PM, Kai Tietz wrote: > Hello, > > So this is the updated patch for boolifying of comparisons. =A0There are > two different kind of regression caused by this. =A0One is fixed by the > VRP patch I've sent and it waits for review. The other one is about > vectorization in gcc.dg/vect/vect-cond3.c > testcase. =A0This is caused by vectorization pass, which can't handle > different types for vectorization, as now the conditions are always > boolean-typed. > > ChangeLog > > 2011-07-19 =A0Kai Tietz =A0 > > =A0 =A0 =A0 =A0* fold-const.c (fold_unary_loc): Preserve > =A0 =A0 =A0 =A0non-boolean-typed casts. > =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.c (useless_type_conversion_p): Preserve incompa= tible > =A0 =A0 =A0 =A0casts from/to boolean, > =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/builtin-expect-5.c: Adjusted. > =A0 =A0 =A0 =A0* gcc.dg/tree-ssa/pr21031.c: Likewise. > =A0 =A0 =A0 =A0* gcc.dg/tree-ssa/pr30978.c: Likewise. > =A0 =A0 =A0 =A0* gcc.dg/tree-ssa/ssa-fre-6.c: Likewise. > =A0 =A0 =A0 =A0* gcc.dg/binop-xor1.c: Mark it as expected fail. > =A0 =A0 =A0 =A0* gcc.dg/binop-xor3.c: Likewise. > =A0 =A0 =A0 =A0* gcc.dg/uninit-15.c: Adjust reported message. > > Bootstrapped and regression tested for x86_64-pc-linux-gnu. =A0Ok for app= ly? Please test and commit the fold-const.c and tree-ssa.c parts separately, they are pre-approved if they pass separate testing. I think > * gcc.dg/uninit-15.c: Adjust reported message. is a bogus change. Please figure out why you need it. Likewise the builtin-expect-5.c change. > Regards, > Kai > > PS: Might be that due your recent patch to forwprop, that patch > doesn't apply here cleanly. You will need to re-test ontop of that patch anyway I guess. And deal with the gcc.dg/vect/vect-cond3.c fail. Richard. > 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 > @@ -7665,11 +7665,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/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 } > @@ -6791,7 +6796,7 @@ gimplify_expr (tree *expr_p, gimple_seq > =A0 =A0 =A0 =A0 =A0 =A0*expr_p =3D gimple_boolify (*expr_p); > =A0 =A0 =A0 =A0 =A0 =A0if (!useless_type_conversion_p (orig_type, TREE_TY= PE (*expr_p))) > =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 *expr_p =3D fold_convert_loc (saved_locatio= n, orig_type, *expr_p); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 *expr_p =3D fold_convert_loc (input_locatio= n, orig_type, *expr_p); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ret =3D GS_OK; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0 =A0 =A0 =A0} > @@ -7309,7 +7314,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/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); > 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/tree-ssa/builtin-expect-5.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/builtin-expect-5.c > +++ gcc-head/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-5.c > @@ -11,5 +11,5 @@ f (int i, float j) > > =A0/* { dg-final { scan-tree-dump-times { if } 2 "forwprop1"} } */ > =A0/* { dg-final { scan-tree-dump {builtin_expect[^\n]*, 0\);\n[^\n]*if} > "forwprop1"} } */ > -/* { dg-final { scan-tree-dump {builtin_expect[^\n]*, 1\);\n[^\n]*if} > "forwprop1"} } */ > +/* { dg-final { scan-tree-dump-not {builtin_expect[^\n]*, > 1\);\n[^\n]*if} "forwprop1"} } */ > =A0/* { dg-final { cleanup-tree-dump "forwprop?" } } */ > 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"} } */ > =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" } } */ > =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-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 > @@ -1122,30 +1174,22 @@ forward_propagate_comparison (gimple stm > =A0 if (!use_stmt) > =A0 =A0 return false; > > - =A0/* Conversion of the condition result to another integral type. =A0*/ > + =A0/* Test of the condition result. =A0*/ > =A0 if (is_gimple_assign (use_stmt) > - =A0 =A0 =A0&& (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (use_stmt)) > - =A0 =A0 =A0 =A0 || TREE_CODE_CLASS (gimple_assign_rhs_code (use_stmt)) > - =A0 =A0 =A0 =A0 =A0 =A0=3D=3D tcc_comparison > - =A0 =A0 =A0 =A0 =A0|| gimple_assign_rhs_code (use_stmt) =3D=3D TRUTH_NO= T_EXPR) > - =A0 =A0 =A0&& INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (use_stmt))= )) > + =A0 =A0 =A0&& ((TREE_CODE_CLASS (gimple_assign_rhs_code (use_stmt)) > + =A0 =A0 =A0 =A0 =A0=3D=3D tcc_comparison) > + =A0 =A0 =A0 =A0 =A0|| gimple_assign_rhs_code (use_stmt) =3D=3D TRUTH_NO= T_EXPR > + =A0 =A0 =A0 =A0 || (gimple_assign_rhs_code (use_stmt) =3D=3D BIT_NOT_EX= PR > + =A0 =A0 =A0 =A0 =A0 =A0 && TYPE_PRECISION (TREE_TYPE (gimple_assign_lhs= (use_stmt)))))) > =A0 =A0 { > =A0 =A0 =A0 tree lhs =3D gimple_assign_lhs (use_stmt); > > - =A0 =A0 =A0/* We can propagate the condition into a conversion. =A0*/ > - =A0 =A0 =A0if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (use_stmt))) > - =A0 =A0 =A0 { > - =A0 =A0 =A0 =A0 /* Avoid using fold here as that may create a COND_EXPR= with > - =A0 =A0 =A0 =A0 =A0 =A0non-boolean condition as canonical form. =A0*/ > - =A0 =A0 =A0 =A0 tmp =3D build2 (gimple_assign_rhs_code (stmt), TREE_TYP= E (lhs), > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0gimple_assign_rhs1 (stmt= ), gimple_assign_rhs2 (stmt)); > - =A0 =A0 =A0 } > =A0 =A0 =A0 /* We can propagate the condition into X op CST where op > =A0 =A0 =A0 =A0 is EQ_EXPR or NE_EXPR and CST is either one or zero. =A0*/ > - =A0 =A0 =A0else if (TREE_CODE_CLASS (gimple_assign_rhs_code (use_stmt)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D=3D tcc_comparison > - =A0 =A0 =A0 =A0 =A0 =A0 && TREE_CODE (gimple_assign_rhs1 (use_stmt)) = =3D=3D SSA_NAME > - =A0 =A0 =A0 =A0 =A0 =A0 && TREE_CODE (gimple_assign_rhs2 (use_stmt)) = =3D=3D INTEGER_CST) > + =A0 =A0 =A0if (TREE_CODE_CLASS (gimple_assign_rhs_code (use_stmt)) > + =A0 =A0 =A0 =A0 =A0=3D=3D tcc_comparison > + =A0 =A0 =A0 =A0 =A0&& TREE_CODE (gimple_assign_rhs1 (use_stmt)) =3D=3D = SSA_NAME > + =A0 =A0 =A0 =A0 =A0&& TREE_CODE (gimple_assign_rhs2 (use_stmt)) =3D=3D = INTEGER_CST) > =A0 =A0 =A0 { > =A0 =A0 =A0 =A0 enum tree_code code =3D gimple_assign_rhs_code (use_stmt); > =A0 =A0 =A0 =A0 tree cst =3D gimple_assign_rhs2 (use_stmt); > @@ -1164,7 +1208,8 @@ forward_propagate_comparison (gimple stm > =A0 =A0 =A0 } > =A0 =A0 =A0 /* We can propagate the condition into a statement that > =A0 =A0 =A0 =A0 computes the logical negation of the comparison result. = =A0*/ > - =A0 =A0 =A0else if (gimple_assign_rhs_code (use_stmt) =3D=3D TRUTH_NOT_= EXPR) > + =A0 =A0 =A0else if (gimple_assign_rhs_code (use_stmt) =3D=3D TRUTH_NOT_= EXPR > + =A0 =A0 =A0 =A0 =A0 =A0 =A0|| gimple_assign_rhs_code (use_stmt) =3D=3D = BIT_NOT_EXPR) > =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0tree type =3D TREE_TYPE (gimple_assign_rhs1 (stmt)); > =A0 =A0 =A0 =A0 =A0bool nans =3D HONOR_NANS (TYPE_MODE (type)); > @@ -1810,6 +1855,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); > @@ -1839,6 +1885,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); > @@ -1867,6 +1914,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/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/testsuite/gcc.dg/uninit-15.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/uninit-15.c > +++ gcc-head/gcc/testsuite/gcc.dg/uninit-15.c > @@ -18,9 +18,9 @@ foo (int i) > =A0void baz (void); > > =A0void > -bar (void) > +bar (void) /* { dg-warning "'j' is used uninitialized" } */ > =A0{ > =A0 int j; /* { dg-message "note: 'j' was declared here" "" { xfail *-*-*= } } */ > - =A0for (; foo (j); ++j) =A0/* { dg-warning "'j' is used uninitialized" = } */ > + =A0for (; foo (j); ++j) > =A0 =A0 baz (); > =A0} >