From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75749 invoked by alias); 5 Sep 2016 12:03:35 -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 75732 invoked by uid 89); 5 Sep 2016 12:03:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Frankly, ccp 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; Mon, 05 Sep 2016 12:03:34 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A091B81F01; Mon, 5 Sep 2016 12:03:32 +0000 (UTC) Received: from redhat.com (ovpn-204-23.brq.redhat.com [10.40.204.23]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u85C3TRr007166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 5 Sep 2016 08:03:31 -0400 Date: Mon, 05 Sep 2016 14:08:00 -0000 From: Marek Polacek To: Bernd Edlinger Cc: Joseph Myers , "gcc-patches@gcc.gnu.org" Subject: Re: C/C++ PATCH for c/77423 (bogus warning with -Wlogical-not-parentheses) Message-ID: <20160905120329.GC19950@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.0 (2016-08-17) X-SW-Source: 2016-09/txt/msg00202.txt.bz2 On Fri, Sep 02, 2016 at 03:51:49PM +0000, Bernd Edlinger wrote: > Hi, > > > + r += !a == ~b; > > + r += !a == ~(int) b; > > I don't understand why ~b should not be warned at -Wall. Yeah, there was an RFE for this but I'm not finding it. > Frankly I don't even understand why the above statements are > completely optimized away. > > r += !a == ~b; > is optimized away, but > > b = ~b; > r += !a == b; > > Is not. Why? Something in ccp I suppose. But I didn't investigate closely because it's not really relevant to this patch, sorry. Marek