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: 648661 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 3rrKg1573Bz9sBf for ; Fri, 15 Jul 2016 14:42:21 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=wLrAm3zL; 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=Tp84J37fesu1jUMIp P19QpwvSC0OHn19L7IaECVX4xQC97dDeuZ1gKbB8M8TvBtrJELj2FXj6Fin/QaHW Scv/mVhgFkA4t0BbJ95Wavlc8sazmFwq+TaeaV7f8sYFVWSqDF0T9qrW2GwcCQ8T XX2/qABJ2lEERbCNyFFOjnSG2A= 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=wLrAm3zLHpzXo8jy78l5cYh9EvgxtMRc1ZhX/tupghHbg3oGr6lsGBK grgYHDWDdS2iR9NI+gVpFOI/UpqbZRlh4awFzChpqABvdQke8iTmkzMjKxDud7AC ZHSpi5qsJogNmsa3tXxiNWWxyByJiS8M3eCsHdMmra8k7nAxXDYA= 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