From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27515 invoked by alias); 9 Mar 2015 14:35:11 -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 27504 invoked by uid 89); 9 Mar 2015 14:35:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 09 Mar 2015 14:35:09 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t29EZ6T2027987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 9 Mar 2015 10:35:06 -0400 Received: from tucnak.zalov.cz (ovpn-116-28.ams2.redhat.com [10.36.116.28]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t29EZ4Cu005429 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Mon, 9 Mar 2015 10:35:05 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t29EYwDk027990; Mon, 9 Mar 2015 15:35:03 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t29EYuWC027989; Mon, 9 Mar 2015 15:34:56 +0100 Date: Mon, 09 Mar 2015 14:35:00 -0000 From: Jakub Jelinek To: Jason Merrill Cc: "Joseph S. Myers" , gcc-patches@gcc.gnu.org Subject: Re: [C/C++ PATCH] -Wlogical-not-parentheses tweaks (PR c/65120) Message-ID: <20150309143456.GR1746@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20150220000326.GT1746@tucnak.redhat.com> <54F0EFDB.5030703@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54F0EFDB.5030703@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00467.txt.bz2 On Fri, Feb 27, 2015 at 05:29:47PM -0500, Jason Merrill wrote: > On 02/19/2015 07:03 PM, Jakub Jelinek wrote: > >+ /* Avoid warning for !!b == y where b is boolean. */ > >+ && (!DECL_P (current.lhs) > >+ || TREE_TYPE (current.lhs) == NULL_TREE > >+ || TREE_CODE (TREE_TYPE (current.lhs)) != BOOLEAN_TYPE)) > > There's something wrong here. If the type is null, trying to check its > TREE_CODE will SEGV. If the type is NULL, then it will just call warn_logical_not_parentheses and won't check TREE_CODE. Only when it is non-NULL, it will check TREE_CODE and if it is not BOOLEAN_TYPE, will call warn_logical_not_parentheses. Jakub