From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37747 invoked by alias); 27 Sep 2016 14:11:07 -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 37705 invoked by uid 89); 27 Sep 2016 14:11:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: albireo.enyo.de Received: from albireo.enyo.de (HELO albireo.enyo.de) (5.158.152.32) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Sep 2016 14:11:04 +0000 Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1bot61-0005qO-QE; Tue, 27 Sep 2016 16:10:57 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.84_2) (envelope-from ) id 1bot61-00086G-LO; Tue, 27 Sep 2016 16:10:57 +0200 From: Florian Weimer To: Bernd Edlinger Cc: Jason Merrill , "gcc-patches\@gcc.gnu.org" , Jeff Law Subject: Re: [PATCH] Make -Wint-in-bool-context warn on suspicious shift ops References: <87shslv769.fsf@mid.deneb.enyo.de> Date: Tue, 27 Sep 2016 14:34:00 -0000 In-Reply-To: (Bernd Edlinger's message of "Tue, 27 Sep 2016 13:53:57 +0000") Message-ID: <87fuol77ri.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg01999.txt.bz2 * Bernd Edlinger: >> =E2=80=9C0 << 0=E2=80=9D is used in a similar context, to create a zero = constant for a >> multi-bit subfield of an integer. >> >> This example comes from GDB, in bfd/elf64-alpha.c: >> >> | insn =3D INSN_ADDQ | (16 << 21) | (0 << 16) | (0 << 0); >> > > Of course that is not a boolean context, and will not get a warning. > > Question is if "if (1 << 0)" is possibly a miss-spelled "if (1 < 0)". > > Maybe 1 and 0 come from macro expansion.... But what's the intent of treating 1 << 0 and 0 << 0 differently in the patch, then?