From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id B69B73858D33; Fri, 22 Dec 2023 00:40:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B69B73858D33 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 B69B73858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703205628; cv=none; b=el47QrBbOun9axU35xdcucxrp7oeL99lwyU68EzkvCjqHVF9oounvy9lKrpTsPhJo69kROi6FcQ234cY+aThNCE8vFEygL+1b7tWUz1riu5a+txoj/XWtlEFwoJV3nne5ErpzG3Gxvw0RSTVvF/FiKgVQOEkuBdbkKbGyVaA/Gw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703205628; c=relaxed/simple; bh=xxEIkBv/uFvwoOpjpDVpvPkllkjOF+NgwaFN6di4J40=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=v+BwXHXpl8gIl4ch4VXxOQ8V9IohgEzHoqAOtWc1QrydDqGhnklFy9iCW/3wHJXcG2akujIl+vlpoM2lUblR8pKPSvRHUoFIO7yFUDlKYrXSNXAuS44ViOL9rzfVxJ1fgk+sGlH8I5LijKBxS4YSDqJfXeuk+vioUkaUbOXEXGM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 18B623408DD; Fri, 22 Dec 2023 00:40:26 +0000 (UTC) From: Mike Frysinger To: cgen@sourceware.org Cc: hp@sourceware.org Subject: [PATCH v2] sim: mark local insn var as unused [PR sim/31181] Date: Thu, 21 Dec 2023 19:40:20 -0500 Message-ID: <20231222004020.11100-1-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221042831.3589-1-vapier@gentoo.org> References: <20231221042831.3589-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,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: 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")) -- 2.43.0