From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86011 invoked by alias); 15 Jul 2016 08:43:00 -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 85989 invoked by uid 89); 15 Jul 2016 08:42:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 15 Jul 2016 08:42:49 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id A58EA543C48; Fri, 15 Jul 2016 10:42:45 +0200 (CEST) Date: Fri, 15 Jul 2016 08:43:00 -0000 From: Jan Hubicka To: kugan Cc: "gcc-patches@gcc.gnu.org" , Richard Biener , Jan Hubicka , Martin Jambor Subject: Re: [RFC][IPA-VRP] Disable setting param of __builtin_constant_p to null Message-ID: <20160715084245.GA4195@kam.mff.cuni.cz> References: <57886949.8010300@linaro.org> <57886993.3010901@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57886993.3010901@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2016-07/txt/msg00915.txt.bz2 > Hi, > > > > VRP assumes that it is run after inlining. Therefore, if there is a > call to __builtin_constant_p with function parameter, it resolve it > to false to avoid bogus warnings. Since we use this as an early vrp > before inling, it leads to wrong code. As a workaround I have > disabled it for the time being. That is, this patch is not intended > for committing but just to get the VRP tested. > > > > Original patch which introduced this also talks about doing it earlier. > > > > > > Thanks, > > Kugan > >From 99f8e7884d582cfae2d7cb50ad59dab7ac6772fc Mon Sep 17 00:00:00 2001 > From: Kugan Vivekanandarajah > Date: Sat, 25 Jun 2016 11:52:57 +1000 > Subject: [PATCH 1/6] Hack-Prevent setting __builtin_constant_p of param to > null before inlining in Early VRP > > --- > gcc/tree-vrp.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c > index ecfab1f..23c12b5 100644 > --- a/gcc/tree-vrp.c > +++ b/gcc/tree-vrp.c > @@ -3759,8 +3759,10 @@ extract_range_basic (value_range *vr, gimple *stmt) > && SSA_NAME_IS_DEFAULT_DEF (arg) > && TREE_CODE (SSA_NAME_VAR (arg)) == PARM_DECL) > { > +#if 0 > set_value_range_to_null (vr, type); > return; > +#endif It is not cleanest either, but better to test cfun->after_inlining Honza