From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id AERdO7hbVWPewQ8AWB0awg (envelope-from ) for ; Sun, 23 Oct 2022 11:20:24 -0400 Received: by simark.ca (Postfix, from userid 112) id EE8711E112; Sun, 23 Oct 2022 11:20:24 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=KBGIwKy/; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9E4941E0D3 for ; Sun, 23 Oct 2022 11:20:24 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0AA653858294 for ; Sun, 23 Oct 2022 15:20:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0AA653858294 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666538424; bh=S+u+GaOLz50L6/0si/VT3q04mrTrHlS8tguRVzwzN3E=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=KBGIwKy/rJ69HaAfD8C3dUxj0W5UwkY7QJ86T9B5oaQrK2F96j7qf+ukGEo6XsDZz Vys3Lk3WYOxAP/3K8PMRJQzt6PAiLkDqnyPzVcYjrt+xzt7kdMSIbUIQP0rBvAQjb1 wLfJYgaz/fvAY5DEM9UZTn0MHrjcf+CW35S+F0h4= Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 607433857C76 for ; Sun, 23 Oct 2022 15:20:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 607433857C76 Received: by smtp.gentoo.org (Postfix, from userid 559) id E70EE340D22; Sun, 23 Oct 2022 15:20:04 +0000 (UTC) Date: Sun, 23 Oct 2022 19:50:39 +0545 To: Tsukasa OI Subject: Re: [PATCH 15/40] sim/h8300: Add "+ 0x0" to avoid self-assignments Message-ID: Mail-Followup-To: Tsukasa OI , Andrew Burgess , Nick Clifton , gdb-patches@sourceware.org References: <5ab303a5bdfc1da7832f8fa22f57678c9ef1a5fa.1666258361.git.research_trasio@irq.a4lg.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="x4ZGELYVn8Ch1BZb" Content-Disposition: inline In-Reply-To: <5ab303a5bdfc1da7832f8fa22f57678c9ef1a5fa.1666258361.git.research_trasio@irq.a4lg.com> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: Nick Clifton , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" --x4ZGELYVn8Ch1BZb 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 there is a redundant self-assignment > ("-Wself-assign"). On the default configuration, it causes a build failu= re > (unless "--disable-werror" is specified). >=20 > However, removing self-assignments in step_once function makes the code l= ess > readable. Instead, this commit inserts dummy addition to match the comme= nts > "Value added =3D=3D 0". This is redundant but will suppress warnings and > matches with other branches better. It will be also optimized away so we > can ignore performance impact on this. > --- > sim/h8300/compile.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > --- a/sim/h8300/compile.c > +++ b/sim/h8300/compile.c > @@ -4141,7 +4141,7 @@ step_once (SIM_DESC sd, SIM_CPU *cpu) > res =3D GET_B_REG (code->src.reg); /* FIXME fetch? */ > if (!c && (0 <=3D (res >> 4) && (res >> 4) <=3D 9) &&=20 > !h && (0 <=3D (res & 0xf) && (res & 0xf) <=3D 9)) > - res =3D res; /* Value added =3D=3D 0. */ > + res =3D res + 0x0; /* Value added =3D=3D 0. */ Andrew posted a patch to just delete the assignment. either is fine with m= e. -mike --x4ZGELYVn8Ch1BZb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmNVSjMACgkQQWM7n+g3 9YFPgg/+MO33oCJ0Xj3uy0+509pUsfrke8sKdSiNIMfvpjsbJJ8cIhz/dPcny0KE OYQHgKESzlItX1vuTMxrsW4SMdmXYSfGB9SRUnJ+PxcLfHnAvcyfIh6o0kobOBnb JfPcrIsvOcnaosh12PD2ih5D6xbIR5pcg35cvhowhpmx6M8D10GamgO3U1o7zl4e 6BupLJL69FHr9Mw/AYUf0aFctwX7WGa2luDNr0lFpDaEX5JJjQVa3ylf4tix2Ls7 6riuQ86RUnsqHc8F8upAupEcdiK5DM67aPrj86hCXajhqz2qCRqznA5zkDHao9jA 1Y/x0Ff6oMXXzqr1Af7XOi/0RFWp4p3d/xeON/kyc2abbNX9psb7P8C8tHYcve0K ldnm2cEGpfxad+y07DDAfigpsWOYVsKpqeoJDsIln0iQtd1M8ov96ejiFa2LFYDI CAbeb+pckYAMUNQCMBf54Rw+cjn2E0aivTW6SABiTDAs9K0iLFJAyfhNBcJnURHD oztdG486X8VYsbWxAOC8XzmVoA+1plIEijCMQkr5jgiz72H3K6TQuh6T/0CR+LHP TjgwEj8Ep7UKlDwTIRjKHqgwIo7Jf2bU9TXB63vauwdxCiydwpVlubMenQP408qw Arda5a0S2ohb7Hst/w9ThkyVQOtov/4rf7/fCRMCch6JxcX6f5k= =x8D6 -----END PGP SIGNATURE----- --x4ZGELYVn8Ch1BZb--