From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48308 invoked by alias); 25 Apr 2019 11:48:47 -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 48297 invoked by uid 89); 25 Apr 2019 11:48:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Apr 2019 11:48:46 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E857D308FF14; Thu, 25 Apr 2019 11:48:44 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.40.205.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8CEF71001DDE; Thu, 25 Apr 2019 11:48:44 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x3PBmgRY008017; Thu, 25 Apr 2019 13:48:42 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x3PBmdQ0008016; Thu, 25 Apr 2019 13:48:39 +0200 Date: Thu, 25 Apr 2019 11:55:00 -0000 From: Jakub Jelinek To: Richard Biener 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) Message-ID: <20190425114839.GK21066@tucnak> Reply-To: Jakub Jelinek References: <20190425112739.GJ21066@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg00980.txt.bz2 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. > > 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