From owner-freebsd-ppc@freebsd.org Wed Dec 14 04:41:45 2016 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1334C760E2 for ; Wed, 14 Dec 2016 04:41:45 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-167.reflexion.net [208.70.211.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96455136B for ; Wed, 14 Dec 2016 04:41:44 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 23798 invoked from network); 14 Dec 2016 04:42:34 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 14 Dec 2016 04:42:34 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.20.0) with SMTP; Tue, 13 Dec 2016 23:41:46 -0500 (EST) Received: (qmail 18218 invoked from network); 14 Dec 2016 04:41:46 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 14 Dec 2016 04:41:46 -0000 Received: from [192.168.1.118] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 12E45EC9059; Tue, 13 Dec 2016 20:41:37 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: sys/powerpc/powerpc/trap.c has messed up masking operation?: use of || for bit field masling Message-Id: <0661C9A5-5D4C-4F00-9B0C-F80688BED8A4@dsl-only.net> Date: Tue, 13 Dec 2016 20:41:36 -0800 Cc: FreeBSD PowerPC ML To: Justin Hibbits , Nathan Whitehorn X-Mailer: Apple Mail (2.3251) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Dec 2016 04:41:46 -0000 clang 3.9.0 is complaining about: --- trap.o --- /usr/src/sys/powerpc/powerpc/trap.c:283:42: warning: use of logical '||' = with constant operand [-Wconstant-logical-operand] frame->cpu.booke.dbcr0 &=3D ~(DBCR0_IDM || = DBCR0_IC); ^ = ~~~~~~~~ /usr/src/sys/powerpc/powerpc/trap.c:283:42: note: use '|' for a bitwise = operation frame->cpu.booke.dbcr0 &=3D ~(DBCR0_IDM || = DBCR0_IC); ^~ | Looking around: # grep DBCR0_ /usr/src/sys/powerpc/include/spr.h . . . #define DBCR0_IDM 0x40000000 /* Internal Debug Mode */ . . . #define DBCR0_IC 0x08000000 /* Instruction Completion = debug event */ . . . || use seems unlikely to be correct for the context. There is also this that I happened to notice = sys/powerpc/powerpc/intr_machdep.c : --- intr_machdep.o --- /usr/src/sys/powerpc/powerpc/intr_machdep.c:454:15: warning: comparison = of constant -1 with expression of type 'enum intr_trigger' is always = false [-Wtautological-constant-out-of-range-compare] if (i->trig =3D=3D -1) ~~~~~~~ ^ ~~ /usr/src/sys/powerpc/powerpc/intr_machdep.c:500:16: warning: comparison = of constant -1 with expression of type 'enum intr_trigger' is always = false [-Wtautological-constant-out-of-range-compare] if (i->trig =3D=3D -1) ~~~~~~~ ^ ~~ There are other comparisons around with a constant=20 result at compile time. But they tend to be in less central areas like zfs. Similarly for some other types of compiler reports. =3D=3D=3D Mark Millard markmi at dsl-only.net