From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97324 invoked by alias); 25 Apr 2019 11:55:45 -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 97316 invoked by uid 89); 25 Apr 2019 11:55:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Apr 2019 11:55:43 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D00B7ACCE; Thu, 25 Apr 2019 11:55:41 +0000 (UTC) Date: Thu, 25 Apr 2019 12:16:00 -0000 From: Richard Biener To: Jakub Jelinek cc: Rainer Orth , gcc-patches@gcc.gnu.org, jason@redhat.com Subject: Re: [PATCH] Fix -Wunused-var-35.C (was Re: [PATCH][C++] Improve compile-time by ordering expensive checks last) In-Reply-To: <20190425114839.GK21066@tucnak> Message-ID: References: <20190425112739.GJ21066@tucnak> <20190425114839.GK21066@tucnak> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="-1609908220-1004244944-1556193341=:27537" X-SW-Source: 2019-04/txt/msg00981.txt.bz2 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1609908220-1004244944-1556193341=:27537 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8BIT Content-length: 1599 On Thu, 25 Apr 2019, Jakub Jelinek wrote: > On Thu, Apr 25, 2019 at 01:39:02PM +0200, Richard Biener wrote: > > > Regtested on x86_64-linux and i686-linux, ok for trunk? > > > > The patch would be obvious but I wonder how the above can change > > anything... (but I can reproduce with even only that change) > > Haven't stepped through it in a debugger, but I bet it is the > fold_non_dependent_expr call in null_ptr_cst_p which is done for C++98 only. > That will mark it as TREE_USED in the end most likely and the > earlier fix for the PR44648 issues, r249083, was also about not trying to > fold the stuff early. Ah, OK, that makes "sense" (well, it doesn't really make sense for a function called null_ptr_cst_p to behave this way...) Richard. > > > 2019-04-25 Jakub Jelinek > > > > > > PR c++/44648 > > > * g++.dg/warn/Wunused-var-35.C: Remove xfail. > > > > > > --- gcc/testsuite/g++.dg/warn/Wunused-var-35.C.jj 2019-02-04 09:44:31.365413407 +0100 > > > +++ gcc/testsuite/g++.dg/warn/Wunused-var-35.C 2019-04-25 13:24:49.717065815 +0200 > > > @@ -11,9 +11,8 @@ int main() > > > else > > > return 1; > > > > > > - if (const bool b2 = 1) // { dg-warning "\\\[-Wunused-variable\\\]" "bug" { xfail c++98_only } } > > > + if (const bool b2 = 1) // { dg-warning "\\\[-Wunused-variable\\\]" } > > > return 0; > > > else > > > return 1; > > > } > > > - > > Jakub > -- Richard Biener SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Felix Imendörffer, Mary Higgins, Sri Rasiah; HRB 21284 (AG Nürnberg) ---1609908220-1004244944-1556193341=:27537--