From patchwork Thu Dec 7 03:59:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 81578 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DCF76386185C for ; Thu, 7 Dec 2023 04:00:08 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 865E1385277E for ; Thu, 7 Dec 2023 03:59:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 865E1385277E 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 865E1385277E 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=1701921587; cv=none; b=EVdOaqk8uhiiQAarzh9rh42lqfJSSXH0lhQ6C7IOIpaLyLlaxtkvRU6pzRYKRNaHTkX5WZ8SKyc5mpyfmkD1Ew5IXpTli/GfL1ldsYG41yla9pf76yQvITFimFA1hzz7HZt2uLYb2C1eh/Mp7T4byL1VbQ7Ids05m9kgZA2dTzA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701921587; c=relaxed/simple; bh=A4qVXAUrZEmnaQxqJ56lTXtAHvgCRDiaGL0xJK/O16w=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=nQgwtwVjoeZi9OkdPvPZf2qjhG3F4HRs0ZmVJxWjve/McFUpFwdKPuQZNbr0NQMmAX2wAbOmW3Xy4CFYl+Y4FQrATqqUdW3N4emqyUfcfzzAf63LyV53NrzSLoZ/jpFS+K6V6nCH1Z4rY/32cgHUYgRg370mhcE7SdIJRExGXJg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 16E2A335D76; Thu, 7 Dec 2023 03:59:45 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 04/17] sim: cris: fix -Wunused-but-set-variable warnings Date: Wed, 6 Dec 2023 20:59:24 -0700 Message-ID: <20231207035937.14920-4-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231207035937.14920-1-vapier@gentoo.org> References: <20231207035937.14920-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, 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 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+patchwork=sourceware.org@sourceware.org We suppress the warning in the generated switch file because the cris cpu file has a hack to workaround a cgen bug, but that generates a set but unused variable which makes the compiler upset. --- sim/Makefile.in | 2 ++ sim/cris/local.mk | 4 ++++ sim/cris/sim-if.c | 7 +++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sim/cris/local.mk b/sim/cris/local.mk index 12fa86b410d2..66ebc99376c4 100644 --- a/sim/cris/local.mk +++ b/sim/cris/local.mk @@ -16,6 +16,10 @@ ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . +## Some CGEN kludges are causing build-time warnings. See cris.cpu for details. +AM_CFLAGS_%C%_mloopv10f.o = -Wno-unused-but-set-variable +AM_CFLAGS_%C%_mloopv32f.o = -Wno-unused-but-set-variable + nodist_%C%_libsim_a_SOURCES = \ %D%/modules.c %C%_libsim_a_SOURCES = \ diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c index cad71693ede9..12baafbf323d 100644 --- a/sim/cris/sim-if.c +++ b/sim/cris/sim-if.c @@ -337,7 +337,6 @@ cris_set_section_offset_iterator (bfd *abfd, asection *s, void *vp) static void cris_offset_sections (SIM_DESC sd, int offset) { - bfd_boolean ret; struct bfd *abfd = STATE_PROG_BFD (sd); asection *text; struct offsetinfo oi; @@ -350,7 +349,7 @@ cris_offset_sections (SIM_DESC sd, int offset) oi.offset = offset; bfd_map_over_sections (abfd, cris_set_section_offset_iterator, &oi); - ret = bfd_set_start_address (abfd, bfd_get_start_address (abfd) + offset); + bfd_set_start_address (abfd, bfd_get_start_address (abfd) + offset); STATE_START_ADDR (sd) = bfd_get_start_address (abfd); } @@ -516,7 +515,7 @@ cris_handle_interpreter (SIM_DESC sd, struct bfd *abfd) for (i = 0; i < n_hdrs; i++) { int interplen; - bfd_size_type interpsiz, interp_filesiz; + bfd_size_type interpsiz; struct progbounds interp_bounds; if (phdr[i].p_type != PT_INTERP) @@ -563,7 +562,7 @@ cris_handle_interpreter (SIM_DESC sd, struct bfd *abfd) perhaps should. */ interp_load_addr = 0x40000; interpsiz = interp_bounds.endmem - interp_bounds.startmem; - interp_filesiz = interp_bounds.end_loadmem - interp_bounds.startmem; + /* interp_filesiz = interp_bounds.end_loadmem - interp_bounds.startmem; */ /* If we have a non-DSO or interpreter starting at the wrong address, bail. */