From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 07EA03858D39 for ; Sun, 23 Oct 2022 16:20:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 07EA03858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 9EE1D3410B3; Sun, 23 Oct 2022 16:20:21 +0000 (UTC) Date: Sun, 23 Oct 2022 20:50:55 +0545 From: Mike Frysinger To: Tsukasa OI Cc: Andrew Burgess , Nick Clifton , gdb-patches@sourceware.org Subject: Re: [PATCH 27/40] sim/ppc: Add extra parenthesis to avoid ambiguity Message-ID: Mail-Followup-To: Tsukasa OI , Andrew Burgess , Nick Clifton , gdb-patches@sourceware.org References: <24f4d89aafc682360eb2b37005096f4b5b31124f.1666258361.git.research_trasio@irq.a4lg.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="FSoj+T5KWNtLUMwL" Content-Disposition: inline In-Reply-To: <24f4d89aafc682360eb2b37005096f4b5b31124f.1666258361.git.research_trasio@irq.a4lg.com> X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --FSoj+T5KWNtLUMwL Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 20 Oct 2022 09:32, Tsukasa OI wrote: > Clang generates a warning if it considers that an expression is misleading > due to a lack of parenthesis ("-Wparentheses"). > On the default configuration, it causes a build failure > (unless "--disable-werror" is specified). >=20 > This commit adds extra parenthesis to avoid ambiguity. > --- > sim/ppc/altivec.igen | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/sim/ppc/altivec.igen b/sim/ppc/altivec.igen > index 63fe95a53d5..eda7af9dd6a 100644 > --- a/sim/ppc/altivec.igen > +++ b/sim/ppc/altivec.igen > @@ -231,7 +231,7 @@ void::model-function::ppc_insn_vr_vscr:itable_index i= ndex, model_data *model_ptr > busy_ptr->vscr_busy =3D 1; > =20 > if (out_vmask) > - busy_ptr->nr_writebacks =3D 1 + (PPC_ONE_BIT_SET_P(out_vmask)) ? 1 : = 2; > + busy_ptr->nr_writebacks =3D (1 + (PPC_ONE_BIT_SET_P(out_vmask))) ? 1 = : 2; fairly certain this is incorrect. this pretty much guarantees that "1" will always be used and never "2". Andrew posted a diff fix that i think is correct. -mike --FSoj+T5KWNtLUMwL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmNVWFMACgkQQWM7n+g3 9YFS8w//TJ3PmJE1gWKIkHn64oJDJsNuvEsqBDufr0z0LgUeZHFa1k1etujiyXJa OMBtR99dQ9AcAg5LMOQVudBYRDaZGdsWs/iqZwwLmOELZzDs3qzmrCypsZ4cvWLh l+3CNaaadPZJXl2RNfB3nqW6P2FMmidaP1VzUa0cInkFds6jAo0yQahEggSvmddp 3Ef/Qawd/GqRpceHpcDSmbH1nxXHKp8DwRWbYH/nbOr1Dta9SFPqjTPFOSd/N02O C8hi0HsUtl11JVLQAldNTShHD+M6vzgmnjXZiSzLTM+TNsbewgUGwqKi8X/fIbrc JAZ1QEeJaQIJabEcEH2sQ1ApKLIE5eTDwQmsU2H1QssAIG4GnhLKgQjSEzDrPJqO 66ELFMYVtaiZY4nkF0auV58JJoPzreVQbyK7GS0nejQiDaXAuslb9QtG+7ukoX7f qV4kDvA49J/0oR4i7/C+ZQSryrEf7p9BwX2MC+TQdZOYYbr7VPsKaCraz7FLJDtS hsblLnxQWeyH2v/OVB0/h2vndA2BLaWhAQhlZFRz98r7ZMktgzzB5/hTm8Smw27I ZtgsrqSXziwKfSD79RDb5/FFQ7jk3lgjRuhMez9f+O/rDdqoJ7m8n4nQNyCYib3w g4hmT4FGi+1zpZ+btEwPM790zNFFv/hSkSGu8nWsFe5wQqf52jw= =83fZ -----END PGP SIGNATURE----- --FSoj+T5KWNtLUMwL--