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: 652179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ryXFH3195z9sC3 for ; Mon, 25 Jul 2016 17:00:02 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=DXiSS3Jx; dkim-atps=neutral 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=XKfG15hBMSU8P/iA+ mLLNMFuf7dE+J8lvWqkiP6Xbm8m9ymNUCJkA7kTGbXSvlOSQGkojkgzQGPrl9GWf IprgM25V/KExUmTETMyQqkd+47QQc9d0K/V7K7TsNNN/IgGRgG3j2L0RXt4mOvhd 8k4Yv8EEHiimacXzAc6MiZm/eY= 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=DXiSS3Jx6853eJTEVQnUMWbwBSYQ/+G1YJdrqrmKyKFh2EFxHh711NM +4kO0waf2JCTAdnImtMWoy8urAaq1YYTLF9F22+RcBRUVu6ToA48AVYbrIDt/G3u 2fXYpuq9+TZD36erOYKT25bwZ/BaMUvx2b1KxmptwlWEKINfQibo= 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