From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id E962B3858D28; Fri, 22 Dec 2023 10:35:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E962B3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E962B3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703241361; cv=none; b=Fv6VcCo2B5hSSuAK8fpD2u2vJcjBiBaCr423oNPNh0+0Rc/eO7dcq6iSgpXSylLOzR/XJkdQVC2gYALjbLBml0q3M+wLBtPYgfSMWEd60+HnPAw+84dZ4OjF5wTQ9AkidmHMNSW+TYkBCqWN//J+Y9tLgoUqsybirzBKeTzyCZg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703241361; c=relaxed/simple; bh=quhhh++dbiGRTcilGcnhBkpocbmbdISoHxS+iymCz3M=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=YoLHZGNX66X/kj3x+atKGaDRn0MIDpmQW0zR6wHehqJ9iE8oQrU0GpYnb7htytUBV9AsZ44Q8LmFxymW7L77g6G2BQ7gEqixye1VOJ352sMR7Sjv59aREqW3imRTsl1eEgzQkR1EKBYXVTo2lpuxaGD3E3cYxFE9KzGxXulwzF8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGcso-0000aQ-Ly; Fri, 22 Dec 2023 05:35:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=+ec1fpkVV1jmSOEOUl4ppNgfAj1OMjpgWvxZb5Q/Cvo=; b=iTIa5cXwANxuClftgTHZ e+rOcSpEbYaLUwQ6ag31d7jMlm7aZWkwCujcWFpWHKmH2aNG2Aw7irVRzzBRSl15xiM7RH4XKi7/p /uJlRLdidiFIitEfeCTjif1f/uzHyDwKN3n2/v5Wn+qu1NdaYAMKfAPyHtgzxVnldjieUZmtjot0j Tgk9FFU/75354c3zRiS9vqgdHLs1cln1zvnjpnDEJJVZgddDme5GMmgi0cg6lo6pvjeNAevXT5klF +3o4zfTB4WTaLOyvZghdUTiAXvSJbBDnj9+3cXEH6BK5fladykmjnxB/mfVfXNNbcSIamigphxJbI Cg5GdRmNMQe0rA==; From: "Jose E. Marchesi" To: Mike Frysinger via Cgen Cc: Mike Frysinger , hp@sourceware.org Subject: Re: [PATCH v2] sim: mark local insn var as unused [PR sim/31181] In-Reply-To: <20231222004020.11100-1-vapier@gentoo.org> (Mike Frysinger via Cgen's message of "Thu, 21 Dec 2023 19:40:20 -0500") References: <20231221042831.3589-1-vapier@gentoo.org> <20231222004020.11100-1-vapier@gentoo.org> Date: Fri, 22 Dec 2023 11:35:16 +0100 Message-ID: <874jgar0d7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: 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"))