From patchwork Mon Jul 25 06:59:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 72683 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp990392qga; Mon, 25 Jul 2016 00:00:09 -0700 (PDT) X-Received: by 10.66.25.115 with SMTP id b19mr26728879pag.69.1469430009183; Mon, 25 Jul 2016 00:00:09 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id lu15si32024691pab.140.2016.07.25.00.00.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jul 2016 00:00:09 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-432396-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-432396-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-432396-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=Re0kOdpgjr1Yhikrh Y3fpRHlaVQWjRx494+JROsvTPypdvyOv5+lUscUnpGYI9V10tY2ei+DgMgDpBNlo cURM82apeCO9vwVXOlRwvZ7FsbH4HGSTGgJEGEancpizfnDuMqfMg39YdFvy9QNn XXaUBtdNsZ0Wb/boy2BuxAQetg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=G0TyRir6ZD1tq/VD73KXp/C /YhU=; b=Y/LNn3FGaf9zqaJqw8/dhunTjjeIK7P8e5BFesIhAYVM75/fnDftv+6 SGgjSBaWu+gC4H4+6kwf/pO5Ap1SQ3ow2h5/HTsJoaI2PxCW4cSh8x8HjEeSIVUb CHZxdFjq498iiuBuOaiFepJdWN7PyFe0Yj9ymdkk/JaHvWw99ju4= Received: (qmail 20320 invoked by alias); 25 Jul 2016 06:59:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 20276 invoked by uid 89); 25 Jul 2016 06:59:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=*stmt X-HELO: mail-pf0-f182.google.com Received: from mail-pf0-f182.google.com (HELO mail-pf0-f182.google.com) (209.85.192.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 25 Jul 2016 06:59:42 +0000 Received: by mail-pf0-f182.google.com with SMTP id x72so61097491pfd.2 for ; Sun, 24 Jul 2016 23:59:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=3ffaP4TvdwDuIM0MDM4zUJL9g0v9hTqgwZUbTgycUg4=; b=iro0Lf+smkOSbHOKeME/PltBE1VHxSJp79V1H8yIWfZACxr9WYPxp13RV25aUnPvpS q7IzVEa8rihSo7NGN7y8p3S2IKtDDDvV0c/lZayhQ1I8oFa/VUSUNYO3BW9kCd6NgHAO CUyQUFCVh/oTGiJgFxHyZPlLV+KE3MopZZ2ATgGEUKDJ8epRFZF+8vGaOe3ANOh71bYo 2oYFqYVGYLGy7Mm41qxuUkCPMvvDKt5eUruH1JCZwv+VMDHP9BQT5JZqE/1inwWbIWAV zJe2ao0ZJOslDIqnyBBqMsrPllb80kNbE3lAlW2NrbQtqT5endnMVyPid7qd+MjQQEjz sgLw== X-Gm-Message-State: AEkooutjhpjZwVwLwMdLTp7gCmNloeGTAeuWnItDJNgOwl2m9ZiTOfk6TBi04wXVxusWW539 X-Received: by 10.98.87.90 with SMTP id l87mr26895409pfb.133.1469429980184; Sun, 24 Jul 2016 23:59:40 -0700 (PDT) Received: from [10.1.1.4] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by smtp.gmail.com with ESMTPSA id a20sm37121143pfa.27.2016.07.24.23.59.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Jul 2016 23:59:39 -0700 (PDT) Subject: Re: [RFC][IPA-VRP] Disable setting param of __builtin_constant_p to null To: Jan Hubicka References: <57886949.8010300@linaro.org> <57886993.3010901@linaro.org> <20160715084245.GA4195@kam.mff.cuni.cz> Cc: "gcc-patches@gcc.gnu.org" , Richard Biener , Martin Jambor From: kugan Message-ID: Date: Mon, 25 Jul 2016 16:59:28 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160715084245.GA4195@kam.mff.cuni.cz> X-IsSubscribed: yes Hi, >> 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 Thanks. Here is the patch which does this. Bootstrapped and regression tested with the rest of the patches in the series. Is this OK for trunk? Thanks, Kugan gcc/ChangeLog: 2016-07-25 Kugan Vivekanandarajah * tree-vrp.c (extract_range_basic): Check cfun->after_inlining before folding call to __builtin_constant_p with parameters to false. >From 4805ea975de0fd3b183b27324df1caa7ff29f887 Mon Sep 17 00:00:00 2001 From: Kugan Vivekanandarajah Date: Sat, 25 Jun 2016 11:52:57 +1000 Subject: [PATCH 2/7] Prevent setting __builtin_constant_p of param to null before inlining in Early VRP --- gcc/tree-vrp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index bdfc1b6..edaacf2 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -3763,7 +3763,8 @@ extract_range_basic (value_range *vr, gimple *stmt) arg = gimple_call_arg (stmt, 0); if (TREE_CODE (arg) == SSA_NAME && SSA_NAME_IS_DEFAULT_DEF (arg) - && TREE_CODE (SSA_NAME_VAR (arg)) == PARM_DECL) + && TREE_CODE (SSA_NAME_VAR (arg)) == PARM_DECL + && cfun->after_inlining) { set_value_range_to_null (vr, type); return; -- 1.9.1