From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id TbjYFh92e2XgjSAAWB0awg (envelope-from ) for ; Thu, 14 Dec 2023 16:39:43 -0500 Received: by simark.ca (Postfix, from userid 112) id 4D7E11E0C3; Thu, 14 Dec 2023 16:39:43 -0500 (EST) Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3DDE21E091 for ; Thu, 14 Dec 2023 16:39:41 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CD7D3384DB63 for ; Thu, 14 Dec 2023 21:39:40 +0000 (GMT) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id A85BE38618CD for ; Thu, 14 Dec 2023 21:39:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A85BE38618CD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A85BE38618CD Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702589969; cv=none; b=kqoz9DBomi2WioYXfgeXn/PknZbFr+0P9kdfLfJbEVuB5out/Y6QomP3ixb5wdLg0V2ujmAixMkrFAcFxDX3SrETBptcLtWGOx7ygNAsk0DYBZ8uBqlV0kFq2gkKTKEIeANMl9PSByIJYjT7KVFYMaCYVrRrJqr4pX2fqj335F8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702589969; c=relaxed/simple; bh=Ai3DTupQQAv8iwbe+90adee+WscC0DpWUQE0KVd2H0A=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=af0lNyq+6BQQnriGbN94XtkaoaYN27KJL6bM/8p0U90tFHAzTxfKl88zE9knzHxlQFX9u/cosxTLwPw/qHN8/3BVtduODxArQHSBEAkNG/uZMAZvwqSAm+VMrOhNZ5BXkdrkUWpNcTinRO3NHaGyjpx0wPhAFQJ4I0XLlMVKfMw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 430F633D0AF; Thu, 14 Dec 2023 21:39:27 +0000 (UTC) Date: Thu, 14 Dec 2023 16:39:25 -0500 From: Mike Frysinger To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] sim: add __attribute__((unused)) to _fill_argbuf_tp function Message-ID: References: <20231214162139.8415-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8Y1jafTn7f0greYp" Content-Disposition: inline In-Reply-To: <20231214162139.8415-1-simon.marchi@efficios.com> X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org --8Y1jafTn7f0greYp Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 14 Dec 2023 11:21, Simon Marchi wrote: > I get this when building with --enable-targets=3Dall: >=20 > CC m32r/mloopx.o > m32r/mloopx.c:37:1: error: =E2=80=98m32rxf_fill_argbuf_tp=E2=80=99 de= fined but not used [-Werror=3Dunused-function] > 37 | m32rxf_fill_argbuf_tp (const SIM_CPU *cpu, ARGBUF *abuf, > | ^~~~~~~~~~~~~~~~~~~~~ >=20 > CC m32r/mloop2.o > m32r/mloop2.c:37:1: error: =E2=80=98m32r2f_fill_argbuf_tp=E2=80=99 de= fined but not used [-Werror=3Dunused-function] > 37 | m32r2f_fill_argbuf_tp (const SIM_CPU *cpu, ARGBUF *abuf, > | ^~~~~~~~~~~~~~~~~~~~~ >=20 > I don't know this code, so I didn't do an in-depth analysis of the > situation. Adding the __attribute__((unused)) makes the warning go away > (this is what this patch does), but perhaps there's a better way or the > warning is the sign that something is wrong. pretty sure this is a shortcoming in the m32r mloop2.in & mloopx.in files a= nd we should fix it there. the patch below should fix it. it also seems like the loop files are not respecting fast_p, but one thing = at a time i guess. -mike --- a/sim/m32r/mloop2.in +++ b/sim/m32r/mloop2.in @@ -90,8 +90,7 @@ emit_full16 (SIM_CPU *current_cpu, PCADDR pc, CGEN_INSN_I= NT insn, SCACHE *sc, @cpu@_emit_before (current_cpu, sc, pc, 1); id =3D emit_16 (current_cpu, pc, insn, sc + 1, 0, 0); @cpu@_emit_after (current_cpu, sc + 2, pc); - sc[1].argbuf.trace_p =3D trace_p; - sc[1].argbuf.profile_p =3D profile_p; + @cpu@_fill_argbuf_tp (current_cpu, &sc[1].argbuf, trace_p, profile_p); return id; } =20 @@ -140,15 +139,13 @@ emit_full_parallel (SIM_CPU *current_cpu, PCADDR pc, = CGEN_INSN_INT insn, =20 /* FIXME: No need to handle this parallelly if second is nop. */ id =3D emit_16 (current_cpu, pc, insn >> 16, sc + 1, 0, 1); - sc[1].argbuf.trace_p =3D trace_p; - sc[1].argbuf.profile_p =3D profile_p; + @cpu@_fill_argbuf_tp (current_cpu, &sc[1].argbuf, trace_p, profile_p); =20 @cpu@_emit_before (current_cpu, sc + 2, pc, 0); =20 /* Note that this can never be a cti. No cti's go in the S pipeline. */ id2 =3D emit_16 (current_cpu, pc + 2, insn & 0x7fff, sc + 3, 0, 0); - sc[3].argbuf.trace_p =3D trace_p; - sc[3].argbuf.profile_p =3D profile_p; + @cpu@_fill_argbuf_tp (current_cpu, &sc[3].argbuf, trace_p, profile_p); =20 /* Set sc/snc insns notion of where to skip to. */ if (IDESC_SKIP_P (id)) @@ -184,8 +181,7 @@ emit_full32 (SIM_CPU *current_cpu, PCADDR pc, CGEN_INSN= _INT insn, SCACHE *sc, @cpu@_emit_before (current_cpu, sc, pc, 1); id =3D emit_32 (current_cpu, pc, insn, sc + 1, 0); @cpu@_emit_after (current_cpu, sc + 2, pc); - sc[1].argbuf.trace_p =3D trace_p; - sc[1].argbuf.profile_p =3D profile_p; + @cpu@_fill_argbuf_tp (current_cpu, &sc[1].argbuf, trace_p, profile_p); return id; } =20 --- a/sim/m32r/mloopx.in +++ b/sim/m32r/mloopx.in @@ -90,8 +90,7 @@ emit_full16 (SIM_CPU *current_cpu, PCADDR pc, CGEN_INSN_I= NT insn, SCACHE *sc, @cpu@_emit_before (current_cpu, sc, pc, 1); id =3D emit_16 (current_cpu, pc, insn, sc + 1, 0, 0); @cpu@_emit_after (current_cpu, sc + 2, pc); - sc[1].argbuf.trace_p =3D trace_p; - sc[1].argbuf.profile_p =3D profile_p; + @cpu@_fill_argbuf_tp (current_cpu, &sc[1].argbuf, trace_p, profile_p); return id; } =20 @@ -140,15 +139,13 @@ emit_full_parallel (SIM_CPU *current_cpu, PCADDR pc, = CGEN_INSN_INT insn, =20 /* FIXME: No need to handle this parallelly if second is nop. */ id =3D emit_16 (current_cpu, pc, insn >> 16, sc + 1, 0, 1); - sc[1].argbuf.trace_p =3D trace_p; - sc[1].argbuf.profile_p =3D profile_p; + @cpu@_fill_argbuf_tp (current_cpu, &sc[1].argbuf, trace_p, profile_p); =20 @cpu@_emit_before (current_cpu, sc + 2, pc, 0); =20 /* Note that this can never be a cti. No cti's go in the S pipeline. */ id2 =3D emit_16 (current_cpu, pc + 2, insn & 0x7fff, sc + 3, 0, 0); - sc[3].argbuf.trace_p =3D trace_p; - sc[3].argbuf.profile_p =3D profile_p; + @cpu@_fill_argbuf_tp (current_cpu, &sc[3].argbuf, trace_p, profile_p); =20 /* Set sc/snc insns notion of where to skip to. */ if (IDESC_SKIP_P (id)) @@ -184,8 +181,7 @@ emit_full32 (SIM_CPU *current_cpu, PCADDR pc, CGEN_INSN= _INT insn, SCACHE *sc, @cpu@_emit_before (current_cpu, sc, pc, 1); id =3D emit_32 (current_cpu, pc, insn, sc + 1, 0); @cpu@_emit_after (current_cpu, sc + 2, pc); - sc[1].argbuf.trace_p =3D trace_p; - sc[1].argbuf.profile_p =3D profile_p; + @cpu@_fill_argbuf_tp (current_cpu, &sc[1].argbuf, trace_p, profile_p); return id; } =20 --8Y1jafTn7f0greYp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmV7dg0ACgkQQWM7n+g3 9YFCvxAAgzy4onk29MS0x3rJoy93M8YEoRRkHBn6pjj7aY9279Fcs/sgR/TXeyoS wxf2MpXv2wFNR6/olNKZtz6lRJpcyoi6YRqdjWU0YwW3LaOEDS2Uxoo7/nhPOmTW ph54LkVZQ7iM0kYRPbvku4HSWyHG05CAQYMpjGYk+kjIEXaqRZzuLUy484WVCH7B K4ManLt8ytLvLFWEWguxhGS6LqqfP1kyLJS+qyjXY+r9I5wXfvj+z/Kh4sxyMk8V 0/aOGCQin6zDjIVRCZHVwEDmE30vRakDzns9Y0Rdg8McelO3MhySjzVK0hUPRyBU AubvbnHcOFqzwGgfqL9DpY3yD94yixmdZax47GxuglyGGwG5a8qfp0rbnPEr8LVS TgyU/ZVLIKFwW3V/rashGewtOFu5CbF17SHPdt3BpPpNCB5Fq1L36PkBsmsvWuug fdVevA5QrCMsTmvX0lUDInSWHyCzoWV4GTcMsoAhnme1SbS3FJESqQGaorm/3ozX 2I/GrI3xjPpJ4USYg6KKXCzX9arjqvzait8nxwvcbpGRuzqRFNg9w4P3sAsrO9W9 rt6hfY8CoLaMbDYGg5InK1+d02+a2yse1/zRPDyW3IAWp6OXCOZTKI9jroajuqL1 BuD8fDNHQ5WEhPnOny4TssdVHOCK0r/KLYBQ8Xj/ZPFstGJ5g6A= =15mq -----END PGP SIGNATURE----- --8Y1jafTn7f0greYp--