From: "Jose E. Marchesi" <jemarch@gnu.org>
To: Mike Frysinger via Cgen <cgen@sourceware.org>
Cc: Mike Frysinger <vapier@gentoo.org>, hp@sourceware.org
Subject: Re: [PATCH v2] sim: mark local insn var as unused [PR sim/31181]
Date: Fri, 22 Dec 2023 11:35:16 +0100 [thread overview]
Message-ID: <874jgar0d7.fsf@gnu.org> (raw)
In-Reply-To: <20231222004020.11100-1-vapier@gentoo.org> (Mike Frysinger via Cgen's message of "Thu, 21 Dec 2023 19:40:20 -0500")
Looks good to me.
> Some insns are fully decoded by the time they execute here, and don't
> need to extract any more fields. This leads to the local insn var
> being unused which triggers compiler warnings. Mark it as unused so
> we don't require ports to stub it themselves.
>
> Bug: https://sourceware.org/PR31181
> ---
> v2
> - move decl to after the var name, not before the type
>
> sim-decode.scm | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/sim-decode.scm b/sim-decode.scm
> index 19c0d4677424..5284da074166 100644
> --- a/sim-decode.scm
> +++ b/sim-decode.scm
> @@ -436,7 +436,13 @@ void
> " const IDESC *idesc = &" IDESC-TABLE-VAR "[itype];\n"
> (if (> (length (sfmt-iflds sfmt)) 0)
> (string-append
> - " CGEN_INSN_WORD insn = "
> + " CGEN_INSN_WORD insn"
> + ; Some insns are fully decoded by the time they get here, so they won't
> + ; access the insn variable. Mark it as unused to avoid warnings.
> + (if (adata-integral-insn? CURRENT-ARCH)
> + ""
> + " ATTRIBUTE_UNUSED")
> + " = "
> (if (adata-integral-insn? CURRENT-ARCH)
> "entire_insn;\n"
> "base_insn;\n"))
prev parent reply other threads:[~2023-12-22 10:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-21 4:28 [PATCH] " Mike Frysinger
2023-12-22 0:40 ` [PATCH v2] " Mike Frysinger
2023-12-22 10:35 ` Jose E. Marchesi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874jgar0d7.fsf@gnu.org \
--to=jemarch@gnu.org \
--cc=cgen@sourceware.org \
--cc=hp@sourceware.org \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).