From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114675 invoked by alias); 15 Jul 2015 18:45:37 -0000 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 Received: (qmail 114661 invoked by uid 89); 15 Jul 2015 18:45:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 15 Jul 2015 18:45:36 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 840B341AD2E; Wed, 15 Jul 2015 18:45:34 +0000 (UTC) Received: from localhost.localdomain ([10.3.113.12]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6FIjX13023021; Wed, 15 Jul 2015 14:45:34 -0400 Subject: Re: [PR66726] Factor conversion out of COND_EXPR To: Kugan , Bernhard Reutner-Fischer References: <55974BF2.3060603@linaro.org> <20150704085143.GA14895@nbbrfq.cc.univie.ac.at> <5597D24B.8010900@linaro.org> <559AF515.6010700@redhat.com> <559BCB15.9010209@linaro.org> <559BE505.5070802@redhat.com> <559EFEE5.6030006@linaro.org> <55A02DBF.6030608@redhat.com> <55A24E7D.4080609@linaro.org> <55A6073D.1020800@linaro.org> Cc: "gcc-patches@gcc.gnu.org" From: Jeff Law Message-ID: <55A6AA4D.1030106@redhat.com> Date: Wed, 15 Jul 2015 18:55:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <55A6073D.1020800@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg01320.txt.bz2 On 07/15/2015 01:09 AM, Kugan wrote: > > 2015-07-15 Kugan Vivekanandarajah > > PR middle-end/66726 > * tree-ssa-reassoc.c (optimize_range_tests): Handle sinking the cast > after PHI. > (final_range_test_p): Detect sinking the cast after PHI. > (maybe_optimize_range_tests): Handle sinking the cast after PHI. Can we tweak > > > p.txt > > > diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c > index 932c83a..3058eb5 100644 > --- a/gcc/tree-ssa-reassoc.c > +++ b/gcc/tree-ssa-reassoc.c > return false; > bb = gimple_bb (stmt); > if (!single_succ_p (bb)) > @@ -2729,9 +2743,8 @@ final_range_test_p (gimple stmt) > > lhs = gimple_assign_lhs (stmt); > rhs = gimple_assign_rhs1 (stmt); > - if (!INTEGRAL_TYPE_P (TREE_TYPE (lhs)) > - || TREE_CODE (rhs) != SSA_NAME > - || TREE_CODE (TREE_TYPE (rhs)) != BOOLEAN_TYPE) > + if (TREE_CODE (TREE_TYPE (rhs)) != BOOLEAN_TYPE > + && TREE_CODE (TREE_TYPE (lhs)) != BOOLEAN_TYPE) > return false; So you're ensuring that one of the two is a boolean... Note that previously we ensured that the rhs was a boolean and the lhs was an integral type (which I believe is true for booleans). Thus if we had bool x; int y; x = (bool) y; The old code would have rejected that case. But I think it gets through now, right? I think once that issue is addressed, this will be good for the trunk. jeff