From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 826 invoked by alias); 19 Jul 2011 20:57:35 -0000 Received: (qmail 816 invoked by uid 22791); 19 Jul 2011 20:57:33 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_TM X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Jul 2011 20:57:18 +0000 Received: by qwh5 with SMTP id 5so2582863qwh.20 for ; Tue, 19 Jul 2011 13:57:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.7.212 with SMTP id e20mr6148383qce.192.1311109037300; Tue, 19 Jul 2011 13:57:17 -0700 (PDT) Received: by 10.229.38.195 with HTTP; Tue, 19 Jul 2011 13:57:16 -0700 (PDT) In-Reply-To: References: Date: Tue, 19 Jul 2011 22:24:00 -0000 Message-ID: Subject: Re: [patch tree-optimization]: [2 of 3]: Boolify compares & more From: Kai Tietz To: Richard Guenther 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/msg01567.txt.bz2 2011/7/19 Richard Guenther : > On Tue, Jul 19, 2011 at 1:27 PM, Kai Tietz wrot= e: >> 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 incomp= atible >> =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 ap= ply? > > 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 > >> =A0 =A0 =A0 =A0* gcc.dg/uninit-15.c: Adjust reported message. > > is a bogus change. =A0Please figure out why you need it. Well, somewhere the location for statement gets lost. I was searching for the cause already some time and figured out it must be related to some folding, which occures just by this type-preserving and might be caused by some code using build2/3 instead of the build2/3_loc variant. This was the cause why I added here to some foldings the location preserving. I tested this with just the approved part and see that this regression occures already here. > Likewise the builtin-expect-5.c change. This I will address in my next patch for the approved part. This is caused by the folding for builtin_expect in builtins.c. It gets confused about type-casts on arguments for ANDIF/ORIF AFAICS. >> 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. Well, this regression is caused by vectorizer inability to fold things with two different types. It finds here a pattern with types 'int,int,_Bool,_Bool'. As by this patch conditions have always just boolean-type. So this regression shows more a missing feature in vectorizer. I tested here some approachs to solve this, but I didn't found an easy way to solve this until now. > 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 simplif= y 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 (exp= r, 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_T= YPE (*expr_p))) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0{ >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 *expr_p =3D fold_convert_loc (saved_locati= on, orig_type, *expr_p); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 *expr_p =3D fold_convert_loc (input_locati= on, 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 (*= expr_p); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 *expr_p =3D gimple_boolify (*e= xpr_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_conve= rt_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 BLKmod= e) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ret =3D gimplify_scalar_mode_aggr= egate_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 (o= uter_type)) >> =A0 =A0 =A0 =A0return false; >> >> - =A0 =A0 =A0/* Preserve conversions to BOOLEAN_TYPE if it is not of pre= cision >> - =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 n= ot >> + =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; ret= urn 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_N= OT_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_N= OT_EXPR >> + =A0 =A0 =A0 =A0 || (gimple_assign_rhs_code (use_stmt) =3D=3D BIT_NOT_E= XPR >> + =A0 =A0 =A0 =A0 =A0 =A0 && TYPE_PRECISION (TREE_TYPE (gimple_assign_lh= s (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_EXP= R 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_TY= PE (lhs), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0gimple_assign_rhs1 (stm= t), 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 upwa= rds. =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} >> > --=20 |=A0 (\_/) This is Bunny. Copy and paste | (=3D'.'=3D) Bunny into your signature to help | (")_(") him gain world domination