From patchwork Fri Jul 15 04:41:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 72060 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp416821qga; Thu, 14 Jul 2016 21:42:24 -0700 (PDT) X-Received: by 10.66.236.133 with SMTP id uu5mr28494688pac.35.1468557743967; Thu, 14 Jul 2016 21:42:23 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 65si4521338pfj.237.2016.07.14.21.42.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jul 2016 21:42:23 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-431717-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-431717-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-431717-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=ps3d2EcKOQiUG66lY A+F1me9ywUoQUktMimiUwP2iYGuF3KjVOHh5PlTtnoKoTUlTptHqAA2RjeYODjdq XZO9+09eIsdhDoqvCkooQYtgHOv+5lbIRceM7DJtppZ1dI85PnDp17FzO/MjRf30 6diqF5IQGZNKWtPKjMhixrcjJg= 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=B7ALs7KwwD84uPLTRsKIGIv JzhI=; b=Y9rc5b8oOdTKVmo371i7rrIQTVSwjXJuLArBVSJvAqeYZ6ThMGoS4Id zqe4glwJeKFejvWqYdySWFUPwOHRHeFgKn44tAUojj8bh2rHuTWtAmF39iEVFv8i QtNPrZZDZFScJgYKmq/DlggmX6GFucjl4DgVl/JHaJHwsoxHczp0= Received: (qmail 99010 invoked by alias); 15 Jul 2016 04:42:12 -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 98998 invoked by uid 89); 15 Jul 2016 04:42:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f49.google.com Received: from mail-wm0-f49.google.com (HELO mail-wm0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 15 Jul 2016 04:42:00 +0000 Received: by mail-wm0-f49.google.com with SMTP id f126so11190354wma.1 for ; Thu, 14 Jul 2016 21:42:00 -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=8M+iVl6JKLo1CMx9BvRefHNT8ys7hdW9zJmgsy67cp0=; b=VlMAN1Pgv2zPoYfkpvSOnw1npPjUU5cPndL4jLCJR7dQ97P8qsF2PXvRLQUTogX9lP dKad57GCHEabS+fkI2O+mgZEdx6bAnPLxwbWfV26KWpPMA/v8pbnhXI6fu1KL14uBDeC +0sT/+grefr7om2rrLOOUBIaQjb+gkq46f9zuKtcBLGYyhPRroETtxpk5EDdvmC7AFhf n4/46vEr84ktAzRLr0DasffvIq95RTNiOH9FYpEBMkRT1abM3QiR2DVm51YRbiWgq9Y/ J+cVFAy54BTHd/rByQ0ktVfRQcZddunXD7l29ETsHWB0QKRB9uoC4BSHwuWoMdpMTQpp nXyQ== X-Gm-Message-State: ALyK8tLfF6Z7LczF/yEai8AryGM7F69FliwPp6EowawLipNZVHMvRTH9FzlJAszKE0ZP2I0f X-Received: by 10.28.98.197 with SMTP id w188mr26601652wmb.45.1468557718029; Thu, 14 Jul 2016 21:41:58 -0700 (PDT) Received: from [192.168.207.67] ([62.28.188.194]) by smtp.gmail.com with ESMTPSA id q139sm169517wmb.18.2016.07.14.21.41.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jul 2016 21:41:57 -0700 (PDT) Subject: [RFC][IPA-VRP] Disable setting param of __builtin_constant_p to null To: "gcc-patches@gcc.gnu.org" References: <57886949.8010300@linaro.org> Cc: Richard Biener , Jan Hubicka , Martin Jambor From: kugan Message-ID: <57886993.3010901@linaro.org> Date: Fri, 15 Jul 2016 14:41:55 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <57886949.8010300@linaro.org> X-IsSubscribed: yes 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 } break; /* Both __builtin_ffs* and __builtin_popcount return -- 1.9.1