From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129071 invoked by alias); 21 Apr 2015 14:19:36 -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 129055 invoked by uid 89); 21 Apr 2015 14:19:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f177.google.com Received: from mail-wi0-f177.google.com (HELO mail-wi0-f177.google.com) (209.85.212.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 21 Apr 2015 14:19:30 +0000 Received: by wiax7 with SMTP id x7so108498190wia.0 for ; Tue, 21 Apr 2015 07:19:28 -0700 (PDT) X-Received: by 10.194.77.230 with SMTP id v6mr42368643wjw.25.1429625968077; Tue, 21 Apr 2015 07:19:28 -0700 (PDT) Received: from [164.15.10.85] (euclides.ulb.ac.be. [164.15.10.85]) by mx.google.com with ESMTPSA id i6sm2849654wjf.29.2015.04.21.07.19.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Apr 2015 07:19:27 -0700 (PDT) Message-ID: <55365C6E.1080100@gmail.com> Date: Tue, 21 Apr 2015 14:19:00 -0000 From: =?windows-1252?Q?Manuel_L=F3pez-Ib=E1=F1ez?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Marek Polacek , gcc-patches@gcc.gnu.org Subject: Re: [C/C++ PATCH] Improve -Wlogical-op (PR c/63357) References: <20150421111638.GB28950@redhat.com> In-Reply-To: <20150421111638.GB28950@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2015-04/txt/msg01193.txt.bz2 On 21/04/15 13:16, Marek Polacek wrote: > (-Wlogical-op still isn't enabled neither by -Wall nor by -Wextra.) The reason is https://gcc.gnu.org/PR61534 which means we don't want to warn for: extern int xxx; #define XXX xxx int test (void) { if (!XXX && xxx) return 4; else return 0; } (gcc/testsuite/gcc.dg/pr40172-3.c, although it should be moved to c-c++-common) As noted in the PR: The problem is that !XXX becomes XXX == 0, but it has the location of "!", which is not virtual. If we look at the argument of the expression, then XXX is actually a var_decl, whose location corresponds to the declaration and not the use, and it is not virtual either. This is PR43486. > Bootstrapped/regtested on x86_64-linux, ok for trunk? Does it pass bootstrap if you enable it? That is, is GCC itself -Wlogical-op clean? Cheers, Manuel.