From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70269 invoked by alias); 11 Dec 2017 23:36:12 -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 70252 invoked by uid 89); 11 Dec 2017 23:36:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=sum X-HELO: mail-qt0-f173.google.com Received: from mail-qt0-f173.google.com (HELO mail-qt0-f173.google.com) (209.85.216.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Dec 2017 23:36:09 +0000 Received: by mail-qt0-f173.google.com with SMTP id g9so43069953qth.9 for ; Mon, 11 Dec 2017 15:36:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yP5Wcr8U1e7q8x4MBceMBURmz6dGcuXh6TKSb1GpKfk=; b=R2S8en0u8ht9sCqGjH3je0sCHosoKYF4OIAhwdigHL5IR0R1bIZTiS4iJR9hq24zPH 7nkn/o4O+0oFCTu74AsqB/wKrb/023fN6I0MoYe1VoCkjkmd56L9vhNBlOpUbuV8j6vR 8IhJCioapT73Q0HvJ/uBy0eoNc1GyP54JPoH8xRbUbmw050wo+/pR6kl+UuHw7DKCFTl L30miOr2VMJ1RhS3RE+ZSDYRMNBlupPPFuY5qyS3OSLPCEkmhL25i6NckXME9tIr07jJ r30K2VYuIcD+ON0g9f60D5Wy3Z9pVKjKswRkev7z8DH3qno2Qm4DqWM091B3Qekw+Mvf xQAg== X-Gm-Message-State: AKGB3mK1G+JF2fkp3kkyRL5skp6C95rwxibBtjT4kGdJ48GwXHtr7B3K hh7hW3QX2yh/ZdbTXiDvR/ujQ4K4fdc= X-Google-Smtp-Source: ACJfBovsD/+jlq0a3ORV4eMeYND9lAeX7my2IrHPNjBiTk/5K2TnxZ/8zyF2JLwIG11+2l8azHzIsg== X-Received: by 10.55.78.15 with SMTP id c15mr2983612qkb.105.1513035367787; Mon, 11 Dec 2017 15:36:07 -0800 (PST) Received: from [192.168.1.132] (209-6-90-240.s1774.c3-0.smr-ubr1.sbo-smr.ma.cable.rcncustomer.com. [209.6.90.240]) by smtp.gmail.com with ESMTPSA id j1sm4854635qkc.5.2017.12.11.15.36.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 15:36:06 -0800 (PST) Subject: Re: [PATCH 05/14] tree.c: strip location wrappers from integer_zerop etc To: David Malcolm Cc: Nathan Sidwell , Jakub Jelinek , Richard Biener , gcc-patches List References: <1510350329-48956-1-git-send-email-dmalcolm@redhat.com> <1510350329-48956-6-git-send-email-dmalcolm@redhat.com> From: Jason Merrill Message-ID: <2bd7a0ea-2f83-47c8-1dbd-d5e2bf9f8d41@redhat.com> Date: Mon, 11 Dec 2017 23:36:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1510350329-48956-6-git-send-email-dmalcolm@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-12/txt/msg00672.txt.bz2 On 11/10/2017 04:45 PM, David Malcolm wrote: > We need to strip away location wrappers in tree.c predicates like > integer_zerop, otherwise they fail when they're called on > wrapped INTEGER_CST; an example can be seen for > c-c++-common/Wmemset-transposed-args1.c > in g++.sum, where the warn_for_memset fails to detect integer zero > if the location wrappers aren't stripped. These shouldn't be needed; callers should have folded away location wrappers. I would hope for STRIP_ANY_LOCATION_WRAPPER to be almost never needed. warn_for_memset may be missing some calls to fold_for_warn. > int > really_constant_p (const_tree exp) > { > + STRIP_ANY_LOCATION_WRAPPER (exp); > + > /* This is not quite the same as STRIP_NOPS. It does more. */ > while (CONVERT_EXPR_P (exp) > || TREE_CODE (exp) == NON_LVALUE_EXPR) Here we should be able to add VIEW_CONVERT_EXPR to the condition. Similarly, tree_nop_conversion should treat a VIEW_CONVERT_EXPR to the same type as a nop. Jason