From patchwork Thu Dec 21 07:01:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82637 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 DDDA6384CBA7 for ; Thu, 21 Dec 2023 07:01:44 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 71B823858407 for ; Thu, 21 Dec 2023 07:01:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 71B823858407 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 71B823858407 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=1703142091; cv=none; b=qEncbKtEdItCNl9DopygHPkX7V99B9MhPIPn51KEwB8WLmPITQXtcjWXaXT1HhwHGL/N2QPau6/MttM0Qwyfh3GyLPv1qyeD4zkb4FDc5aXst8XkXT2mOaqTe/mpv+RuIUj/7Kk8BAr6zReI5yrqiHVE2yXN4CGyC3+aBWwWJ8g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142091; c=relaxed/simple; bh=HGsgwAkJx7ZCKjzBBHofqftsck6L5lztZZWMoihNNn8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=mi0HzLMvg4ez1vFaV0PVm8RjsIPbqI8/XJmmauMQEzpNQoWSoCzdxNj2H8emL6DjAaegBvZ79Lqcex1S+VUZZLh0lXNsZ6nmxr+UQ+tcRUaYHH/c88WwzuRI2uwUkK8MQodphvy3MSGbLntdj32Iz5XeOZj+2UmURktLRL9F6WE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 21265340943; Thu, 21 Dec 2023 07:01:29 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 01/20] sim: signal: mark signal callback funcs as noreturn since they don't return Date: Thu, 21 Dec 2023 02:01:08 -0500 Message-ID: <20231221070127.19142-1-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 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 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 All funcs already call other funcs that don't return. The mips port is the only exception because its generic exception handler can return in the case of normal exceptions. So while the exceptions its signal handler triggers doesn't return, we can't express that conditional logic. So add some useless abort calls to make the compiler happy. --- sim/common/sim-core.h | 2 +- sim/cris/sim-main.h | 2 +- sim/frv/sim-main.h | 2 +- sim/iq2000/sim-main.h | 2 +- sim/lm32/sim-main.h | 2 +- sim/m32r/sim-main.h | 2 +- sim/m4/sim_ac_option_warnings.m4 | 1 + sim/mips/interp.c | 6 ++++-- sim/mips/sim-main.h | 2 +- sim/mn10300/mn10300-sim.h | 3 ++- sim/mn10300/sim-main.h | 2 +- 11 files changed, 15 insertions(+), 11 deletions(-) diff --git a/sim/common/sim-core.h b/sim/common/sim-core.h index 34826f76edb8..bad69876e4f6 100644 --- a/sim/common/sim-core.h +++ b/sim/common/sim-core.h @@ -40,7 +40,7 @@ typedef void (SIM_CORE_SIGNAL_FN) (SIM_DESC sd, sim_cpu *cpu, sim_cia cia, unsigned map, int nr_bytes, address_word addr, transfer_type transfer, sim_core_signals sig); -extern SIM_CORE_SIGNAL_FN sim_core_signal; +extern SIM_CORE_SIGNAL_FN sim_core_signal ATTRIBUTE_NORETURN; /* basic types */ diff --git a/sim/cris/sim-main.h b/sim/cris/sim-main.h index abebe2bafc1f..8fa6ff522bcc 100644 --- a/sim/cris/sim-main.h +++ b/sim/cris/sim-main.h @@ -201,7 +201,7 @@ struct cris_sim_cpu { /* Misc. */ /* Catch address exceptions. */ -extern SIM_CORE_SIGNAL_FN cris_core_signal; +extern SIM_CORE_SIGNAL_FN cris_core_signal ATTRIBUTE_NORETURN; #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \ cris_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \ (TRANSFER), (ERROR)) diff --git a/sim/frv/sim-main.h b/sim/frv/sim-main.h index f2fbcce2b214..b9f99fb3dede 100644 --- a/sim/frv/sim-main.h +++ b/sim/frv/sim-main.h @@ -102,7 +102,7 @@ struct frv_sim_cpu { /* Misc. */ /* Catch address exceptions. */ -extern SIM_CORE_SIGNAL_FN frv_core_signal; +extern SIM_CORE_SIGNAL_FN frv_core_signal ATTRIBUTE_NORETURN; #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \ frv_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \ (TRANSFER), (ERROR)) diff --git a/sim/iq2000/sim-main.h b/sim/iq2000/sim-main.h index dcd7ed4682f8..82865943e3bc 100644 --- a/sim/iq2000/sim-main.h +++ b/sim/iq2000/sim-main.h @@ -37,7 +37,7 @@ struct iq2000_sim_cpu { /* Misc. */ /* Catch address exceptions. */ -extern SIM_CORE_SIGNAL_FN iq2000_core_signal; +extern SIM_CORE_SIGNAL_FN iq2000_core_signal ATTRIBUTE_NORETURN; #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \ iq2000_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \ (TRANSFER), (ERROR)) diff --git a/sim/lm32/sim-main.h b/sim/lm32/sim-main.h index e0e967c4233b..c252dc8f6411 100644 --- a/sim/lm32/sim-main.h +++ b/sim/lm32/sim-main.h @@ -51,7 +51,7 @@ struct lm32_sim_cpu /* Misc. */ /* Catch address exceptions. */ -extern SIM_CORE_SIGNAL_FN lm32_core_signal; +extern SIM_CORE_SIGNAL_FN lm32_core_signal ATTRIBUTE_NORETURN; #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \ lm32_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \ (TRANSFER), (ERROR)) diff --git a/sim/m32r/sim-main.h b/sim/m32r/sim-main.h index 89502f2240e3..31758a153a10 100644 --- a/sim/m32r/sim-main.h +++ b/sim/m32r/sim-main.h @@ -21,7 +21,7 @@ /* Misc. */ /* Catch address exceptions. */ -extern SIM_CORE_SIGNAL_FN m32r_core_signal; +extern SIM_CORE_SIGNAL_FN m32r_core_signal ATTRIBUTE_NORETURN; #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \ m32r_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \ (TRANSFER), (ERROR)) diff --git a/sim/m4/sim_ac_option_warnings.m4 b/sim/m4/sim_ac_option_warnings.m4 index 9f1487f93d0c..3da1c6a2e4a8 100644 --- a/sim/m4/sim_ac_option_warnings.m4 +++ b/sim/m4/sim_ac_option_warnings.m4 @@ -45,6 +45,7 @@ dnl C++ -Wno-mismatched-tags -Wno-error=deprecated-register dnl C++ -Wsuggest-override -Wduplicated-cond +dnl -Wshadow=local dnl C++ -Wdeprecated-copy dnl C++ -Wdeprecated-copy-dtor dnl C++ -Wredundant-move diff --git a/sim/mips/interp.c b/sim/mips/interp.c index cb650a552483..255807f67906 100644 --- a/sim/mips/interp.c +++ b/sim/mips/interp.c @@ -2498,7 +2498,8 @@ mips_core_signal (SIM_DESC sd, (unsigned long) addr, (unsigned long) ip); COP0_BADVADDR = addr; SignalExceptionDataReference(); - break; + /* Shouldn't actually be reached. */ + abort (); case sim_core_unaligned_signal: sim_io_eprintf (sd, "mips-core: %d byte %s to unaligned address 0x%lx at 0x%lx\n", @@ -2509,7 +2510,8 @@ mips_core_signal (SIM_DESC sd, SignalExceptionAddressLoad(); else SignalExceptionAddressStore(); - break; + /* Shouldn't actually be reached. */ + abort (); default: sim_engine_abort (sd, cpu, cia, diff --git a/sim/mips/sim-main.h b/sim/mips/sim-main.h index d5a0dc81b628..5d358564f281 100644 --- a/sim/mips/sim-main.h +++ b/sim/mips/sim-main.h @@ -1038,7 +1038,7 @@ extern int DSPLO_REGNUM[4]; extern int DSPHI_REGNUM[4]; INLINE_SIM_MAIN (void) pending_tick (SIM_DESC sd, sim_cpu *cpu, address_word cia); -extern SIM_CORE_SIGNAL_FN mips_core_signal; +extern SIM_CORE_SIGNAL_FN mips_core_signal ATTRIBUTE_NORETURN; char* pr_addr (address_word addr); char* pr_uword64 (uword64 addr); diff --git a/sim/mn10300/mn10300-sim.h b/sim/mn10300/mn10300-sim.h index 3eadc0fe1780..493df3893e99 100644 --- a/sim/mn10300/mn10300-sim.h +++ b/sim/mn10300/mn10300-sim.h @@ -196,7 +196,8 @@ INLINE_SIM_MAIN (void) genericOr (uint32_t source, uint32_t destReg); INLINE_SIM_MAIN (void) genericXor (uint32_t source, uint32_t destReg); INLINE_SIM_MAIN (void) genericBtst (uint32_t leftOpnd, uint32_t rightOpnd); INLINE_SIM_MAIN (void) do_syscall (SIM_DESC sd); -void program_interrupt (SIM_DESC sd, sim_cpu *cpu, sim_cia cia, SIM_SIGNAL sig); +void program_interrupt (SIM_DESC sd, sim_cpu *cpu, sim_cia cia, SIM_SIGNAL sig) + ATTRIBUTE_NORETURN; void mn10300_cpu_exception_trigger(SIM_DESC sd, sim_cpu* cpu, address_word pc); void mn10300_cpu_exception_suspend(SIM_DESC sd, sim_cpu* cpu, int exception); diff --git a/sim/mn10300/sim-main.h b/sim/mn10300/sim-main.h index d08b13dc5315..b0f0d12c6512 100644 --- a/sim/mn10300/sim-main.h +++ b/sim/mn10300/sim-main.h @@ -48,6 +48,6 @@ mn10300_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER), #include "mn10300-sim.h" #endif -extern SIM_CORE_SIGNAL_FN mn10300_core_signal; +extern SIM_CORE_SIGNAL_FN mn10300_core_signal ATTRIBUTE_NORETURN; #endif From patchwork Thu Dec 21 07:01:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82638 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 BC4613865C30 for ; Thu, 21 Dec 2023 07:01:46 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 8D6F63858030 for ; Thu, 21 Dec 2023 07:01:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8D6F63858030 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 8D6F63858030 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=1703142093; cv=none; b=QA3G9TrAxxzE78wFmYV8/Lj37TgUL63CU6Qxu2T4XZiZTiviFV1+H/3TUM7fhSb5aaR6itk+L4xu8Z4t2MjzZzn/Bf1FXKKrxmcxsvDg5oekc9NZ8rfZM3uHm9IlupqQ0kOlwZlTv5/UQ8Jc0A3KTRq+gI5P/k1FyPK9nQkxf/s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142093; c=relaxed/simple; bh=yD41uSxRdaEeRvsG7nGRyodiPrGiFFl8fU7tKGKmR8k=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=NMmKk/mwqUWuFtqPhgZyTqoepT3vVCmgM63dyngzXPxJmwUPdYspD1wQLn+29viQArfr3+CKAtYtxx7vXxcUyGmR2Y+DI8i6yq7vdIu5vzU21fxRtXroLIdoTN/jxy64MYqqS/r63u5UKZB8ujrpcDhE5HAv9i9EYsNNY3zGtAE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 29AC1340BEF; Thu, 21 Dec 2023 07:01:31 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 02/20] sim: add ATTRIBUTE_FALLTHROUGH for local code Date: Thu, 21 Dec 2023 02:01:09 -0500 Message-ID: <20231221070127.19142-2-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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=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'll replace various /* fall through */ comments so compilers can actually understand what the code is doing. --- sim/common/defs.h | 3 +++ sim/ppc/defs.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sim/common/defs.h b/sim/common/defs.h index 0f4062c2031d..01db1804b4cd 100644 --- a/sim/common/defs.h +++ b/sim/common/defs.h @@ -25,6 +25,9 @@ /* Include gnulib's various configure tests. */ #include "gnulib/config.h" +/* This comes from gnulib. Export it until ansidecl.h handles it. */ +#define ATTRIBUTE_FALLTHROUGH _GL_ATTRIBUTE_FALLTHROUGH + /* Reset macros that our config.h will provide. */ #undef PACKAGE #undef PACKAGE_BUGREPORT diff --git a/sim/ppc/defs.h b/sim/ppc/defs.h index 276063d4b74e..ab7a142b8994 100644 --- a/sim/ppc/defs.h +++ b/sim/ppc/defs.h @@ -23,6 +23,9 @@ /* Include gnulib's various configure tests. */ #include "gnulib/config.h" +/* This comes from gnulib. Export it until ansidecl.h handles it. */ +#define ATTRIBUTE_FALLTHROUGH _GL_ATTRIBUTE_FALLTHROUGH + /* Reset macros that our config.h will provide. */ #undef PACKAGE #undef PACKAGE_BUGREPORT From patchwork Thu Dec 21 07:01:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82641 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 68AD138582BD for ; Thu, 21 Dec 2023 07:02:02 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 99DC0386188F for ; Thu, 21 Dec 2023 07:01:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 99DC0386188F 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 99DC0386188F 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=1703142094; cv=none; b=mn61SQX8FUkcwwqjJN2vhPQD8J0DVVgAzlq7DJdiGTvSoIJqJJRlHTBFg8P1NbZ5R7N5u8BIDYTmwxAl38k/KKlZZfXai56Nz/nRrgZzwuB+SY4IYV+1KzzmwUgPYyc4Vu63hWcxLciZqSTMmQCZWN3sSpqEnr7zJbY3EMPB/Zg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142094; c=relaxed/simple; bh=pHLVo75Jr4CfeGSfZkunJXNErIso1Hi8Z4op/PIMVd8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=vsxxfPYTlcHEz4yKT0w2SANeVgGLEXPq3fsx/m+3Fi31ZRjgRWrnswUZfoJLnSMRmqbvrWl6+fMraNnwdmR9eDmK8zgszfPZUmt/+rdoOHteHHUauEzwVqB1A9mSzACbnEVdXZKf1r/XHPjBXLgVu3rnpQrxe2sDspUm3v6CnbI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 3867C340943; Thu, 21 Dec 2023 07:01:33 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 03/20] sim: common: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:10 -0500 Message-ID: <20231221070127.19142-3-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 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 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 Replace some fall through comments with the attribute. --- sim/common/dv-cfi.c | 6 ++++-- sim/common/hw-properties.c | 2 +- sim/common/sim-memopt.c | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sim/common/dv-cfi.c b/sim/common/dv-cfi.c index 95498d7a2f40..b9c9acdb6820 100644 --- a/sim/common/dv-cfi.c +++ b/sim/common/dv-cfi.c @@ -210,7 +210,7 @@ cfi_unshift_addr (struct cfi *cfi, unsigned addr) { switch (cfi->width) { - case 4: addr >>= 1; /* fallthrough. */ + case 4: addr >>= 1; ATTRIBUTE_FALLTHROUGH; case 2: addr >>= 1; } return addr; @@ -414,7 +414,7 @@ cfi_io_write_buffer (struct hw *me, const void *source, int space, goto done; } - /* Fall through. */ + ATTRIBUTE_FALLTHROUGH; default: if (!cfi->cmdset->write (me, cfi, source, offset, value, nr_bytes)) @@ -490,6 +490,8 @@ cfi_io_read_buffer (struct hw *me, void *dest, int space, break; } + ATTRIBUTE_FALLTHROUGH; + default: if (!cfi->cmdset->read (me, cfi, dest, offset, shifted_offset, nr_bytes)) HW_TRACE ((me, "unhandled state %s", state_names[cfi->state])); diff --git a/sim/common/hw-properties.c b/sim/common/hw-properties.c index f1d7a77ec50d..42b4d3a7426d 100644 --- a/sim/common/hw-properties.c +++ b/sim/common/hw-properties.c @@ -829,7 +829,7 @@ hw_find_string_array_property (struct hw *me, if (node->sizeof_array == 0 || ((char*)node->array)[node->sizeof_array - 1] != '\0') hw_abort (me, "property \"%s\" invalid for string array", property); - /* FALL THROUGH */ + ATTRIBUTE_FALLTHROUGH; case string_array_property: ASSERT (node->sizeof_array > 0); ASSERT (((char*)node->array)[node->sizeof_array - 1] == '\0'); diff --git a/sim/common/sim-memopt.c b/sim/common/sim-memopt.c index 7d46a864afc5..c179d6ab8109 100644 --- a/sim/common/sim-memopt.c +++ b/sim/common/sim-memopt.c @@ -300,10 +300,10 @@ parse_size (char *chp, break; case 'g': case 'G': /* Gigabyte suffix. */ *nr_bytes <<= 10; - /* Fall through. */ + ATTRIBUTE_FALLTHROUGH; case 'm': case 'M': /* Megabyte suffix. */ *nr_bytes <<= 10; - /* Fall through. */ + ATTRIBUTE_FALLTHROUGH; case 'k': case 'K': /* Kilobyte suffix. */ *nr_bytes <<= 10; /* Check for a modulo specifier after the suffix. */ From patchwork Thu Dec 21 07:01:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82640 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 5EC4C3865C1D for ; Thu, 21 Dec 2023 07:01:56 +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 D71F7385E456 for ; Thu, 21 Dec 2023 07:01:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D71F7385E456 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 D71F7385E456 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=1703142097; cv=none; b=Sv7I8r9RMbeOsqkMSkxnfZfbxkRZ2FaDj+je0GuMvUlbqPUq5RMVgyV24r3aVsBCfs0NQRmClCP/Qx5dqyfBbX4vPzsy74jE35+BdORl/q4gHwFw6XEs4cLH7DZfCGqJ1c9ZMG4ErHPeuTv3lcZErhtOP0nXMeVnU3lR9mMQiyM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142097; c=relaxed/simple; bh=30W8Ev903GRpF9gytTwzeGHe3VEEXbXI86kShfWkWi8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=HTKLhuNabVk7cSyc2KMVmibXljNFNPbAnEDWDjAjyCR9f4ol77spnuRAyVfaUxn6m1F6E8Gn7TnW9NUWtU6feta5F/GZaozz5tfHeh8M6E9CEz8wGYNXUteWXrMlJ/CsMjnYc+u20312Z1+729HQ9wbAZdW7OmNmCgbDRhcZSo0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 59288340943; Thu, 21 Dec 2023 07:01:35 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 04/20] sim: aarch64: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:11 -0500 Message-ID: <20231221070127.19142-4-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 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 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 Replace some fall through comments with the attribute, and add some default abort calls when the compiler can't figure out that the set of values were already fully enumerated in the switch statement. --- sim/aarch64/simulator.c | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/sim/aarch64/simulator.c b/sim/aarch64/simulator.c index 3dba1b7f0dc7..8825819a3910 100644 --- a/sim/aarch64/simulator.c +++ b/sim/aarch64/simulator.c @@ -129,11 +129,11 @@ expand_logical_immediate (uint32_t S, uint32_t R, uint32_t N) /* Replicate the value according to SIMD size. */ switch (simd_size) { - case 2: imm = (imm << 2) | imm; - case 4: imm = (imm << 4) | imm; - case 8: imm = (imm << 8) | imm; - case 16: imm = (imm << 16) | imm; - case 32: imm = (imm << 32) | imm; + case 2: imm = (imm << 2) | imm; ATTRIBUTE_FALLTHROUGH; + case 4: imm = (imm << 4) | imm; ATTRIBUTE_FALLTHROUGH; + case 8: imm = (imm << 8) | imm; ATTRIBUTE_FALLTHROUGH; + case 16: imm = (imm << 16) | imm; ATTRIBUTE_FALLTHROUGH; + case 32: imm = (imm << 32) | imm; ATTRIBUTE_FALLTHROUGH; case 64: break; default: return 0; } @@ -2040,12 +2040,12 @@ extreg32 (sim_cpu *cpu, unsigned int lo, Extension extension) { case UXTB: return aarch64_get_reg_u8 (cpu, lo, NO_SP); case UXTH: return aarch64_get_reg_u16 (cpu, lo, NO_SP); - case UXTW: /* Fall through. */ + case UXTW: ATTRIBUTE_FALLTHROUGH; case UXTX: return aarch64_get_reg_u32 (cpu, lo, NO_SP); case SXTB: return aarch64_get_reg_s8 (cpu, lo, NO_SP); case SXTH: return aarch64_get_reg_s16 (cpu, lo, NO_SP); - case SXTW: /* Fall through. */ - case SXTX: /* Fall through. */ + case SXTW: ATTRIBUTE_FALLTHROUGH; + case SXTX: ATTRIBUTE_FALLTHROUGH; default: return aarch64_get_reg_s32 (cpu, lo, NO_SP); } } @@ -3346,7 +3346,7 @@ do_vec_MOV_immediate (sim_cpu *cpu) case 0xa: /* 16-bit, shift by 8. */ val <<= 8; - /* Fall through. */ + ATTRIBUTE_FALLTHROUGH; case 0x8: /* 16-bit, no shift. */ for (i = 0; i < (full ? 8 : 4); i++) aarch64_set_vec_u16 (cpu, vd, i, val); @@ -3355,7 +3355,7 @@ do_vec_MOV_immediate (sim_cpu *cpu) case 0xd: /* 32-bit, mask shift by 16. */ val <<= 8; val |= 0xFF; - /* Fall through. */ + ATTRIBUTE_FALLTHROUGH; case 0xc: /* 32-bit, mask shift by 8. */ val <<= 8; val |= 0xFF; @@ -3416,6 +3416,7 @@ do_vec_MVNI (sim_cpu *cpu) case 0xa: /* 16-bit, 8 bit shift. */ val <<= 8; + ATTRIBUTE_FALLTHROUGH; case 0x8: /* 16-bit, no shift. */ val = ~ val; for (i = 0; i < (full ? 8 : 4); i++) @@ -3425,6 +3426,7 @@ do_vec_MVNI (sim_cpu *cpu) case 0xd: /* 32-bit, mask shift by 16. */ val <<= 8; val |= 0xFF; + ATTRIBUTE_FALLTHROUGH; case 0xc: /* 32-bit, mask shift by 8. */ val <<= 8; val |= 0xFF; @@ -4691,6 +4693,8 @@ do_vec_SCVTF (sim_cpu *cpu) aarch64_get_vec_##SOURCE##64 (cpu, vm, i) \ ? -1ULL : 0); \ return; \ + default: \ + HALT_UNALLOC; \ } \ } \ while (0) @@ -4726,6 +4730,8 @@ do_vec_SCVTF (sim_cpu *cpu) aarch64_get_vec_##SOURCE##64 (cpu, vn, i) \ CMP 0 ? -1ULL : 0); \ return; \ + default: \ + HALT_UNALLOC; \ } \ } \ while (0) @@ -5316,6 +5322,7 @@ do_vec_sub_long (sim_cpu *cpu) { case 2: /* SSUBL2. */ bias = 2; + ATTRIBUTE_FALLTHROUGH; case 0: /* SSUBL. */ switch (size) { @@ -5349,6 +5356,7 @@ do_vec_sub_long (sim_cpu *cpu) case 3: /* USUBL2. */ bias = 2; + ATTRIBUTE_FALLTHROUGH; case 1: /* USUBL. */ switch (size) { @@ -5811,6 +5819,7 @@ do_vec_xtl (sim_cpu *cpu) { case 2: /* SXTL2, SSHLL2. */ bias = 2; + ATTRIBUTE_FALLTHROUGH; case 0: /* SXTL, SSHLL. */ if (INSTR (21, 21)) { @@ -5851,6 +5860,7 @@ do_vec_xtl (sim_cpu *cpu) case 3: /* UXTL2, USHLL2. */ bias = 2; + ATTRIBUTE_FALLTHROUGH; case 1: /* UXTL, USHLL. */ if (INSTR (21, 21)) { @@ -8568,6 +8578,7 @@ dexSimpleFPIntegerConvert (sim_cpu *cpu) case 1: scvtd32 (cpu); return; case 2: scvtf (cpu); return; case 3: scvtd (cpu); return; + default: HALT_UNALLOC; } case 6: /* FMOV GR, Vec. */ @@ -8593,6 +8604,7 @@ dexSimpleFPIntegerConvert (sim_cpu *cpu) case 1: fcvtszd32 (cpu); return; case 2: fcvtszs (cpu); return; case 3: fcvtszd (cpu); return; + default: HALT_UNALLOC; } case 25: do_fcvtzu (cpu); return; @@ -9186,7 +9198,7 @@ do_scalar_FCM (sim_cpu *cpu) case 3: /* 011 */ val1 = fabs (val1); val2 = fabs (val2); - /* Fall through. */ + ATTRIBUTE_FALLTHROUGH; case 2: /* 010 */ result = val1 >= val2; break; @@ -9194,7 +9206,7 @@ do_scalar_FCM (sim_cpu *cpu) case 7: /* 111 */ val1 = fabs (val1); val2 = fabs (val2); - /* Fall through. */ + ATTRIBUTE_FALLTHROUGH; case 6: /* 110 */ result = val1 > val2; break; @@ -9219,7 +9231,7 @@ do_scalar_FCM (sim_cpu *cpu) case 3: /* 011 */ val1 = fabsf (val1); val2 = fabsf (val2); - /* Fall through. */ + ATTRIBUTE_FALLTHROUGH; case 2: /* 010 */ result = val1 >= val2; break; @@ -9227,7 +9239,7 @@ do_scalar_FCM (sim_cpu *cpu) case 7: /* 111 */ val1 = fabsf (val1); val2 = fabsf (val2); - /* Fall through. */ + ATTRIBUTE_FALLTHROUGH; case 6: /* 110 */ result = val1 > val2; break; From patchwork Thu Dec 21 07:01:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82639 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 32FE2384CB95 for ; Thu, 21 Dec 2023 07:01:54 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id CAA81384DEE1 for ; Thu, 21 Dec 2023 07:01:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CAA81384DEE1 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 CAA81384DEE1 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=1703142099; cv=none; b=d1gpHuPIJZz9zJORz9OHjW28T45AKAe17C9JNqnjBiQaZZOrKA6ZKYbR9rVNUghesk2K7usXI20zE1tnLvLKNhS2MFu/xF/wKz1E4GC/cs1R+t4pfTW7SyOmcGPAOPzXKHsRdMjeyBiLFyoFMq69jkc2Wj3eTwbX76HzxgCKYuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142099; c=relaxed/simple; bh=pKe+CityYpuSdR8yg+6SQ5ElaUbxZlZMzZzmrCdPMD0=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=lD4Ne+dvuQDE8MMAUzavoGOg8T/IEyToc+aC4I3GHOZakMsmo56/jEonPBqnWxyQFuCKRPgrEZcu7nPrG9V2JcdU81T/KpgBs9rh2jofR9DWZLt4ahbgvH5VAVCRAEO8/X2qAE63Clf+uHM7TQjyNYZaKBL5IjwFTWZlTjhd5xk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 62D3E340BEF; Thu, 21 Dec 2023 07:01:37 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 05/20] sim: arm: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:12 -0500 Message-ID: <20231221070127.19142-5-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 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 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 Replace some fall through comments with the attribute. --- sim/arm/armemu.c | 6 +++--- sim/arm/armos.c | 1 + sim/arm/thumbemu.c | 7 ++++--- sim/arm/wrapper.c | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sim/arm/armemu.c b/sim/arm/armemu.c index ab7454628ba0..2b8ae007cb56 100644 --- a/sim/arm/armemu.c +++ b/sim/arm/armemu.c @@ -4388,7 +4388,7 @@ check_PMUintr: ARMul_UndefInstr (state, instr); break; } - /* Drop through. */ + ATTRIBUTE_FALLTHROUGH; case 0xc0: /* Store , No WriteBack , Post Dec. */ ARMul_STC (state, instr, LHS); @@ -4435,7 +4435,7 @@ check_PMUintr: ARMul_UndefInstr (state, instr); break; } - /* Drop through. */ + ATTRIBUTE_FALLTHROUGH; case 0xc1: /* Load , No WriteBack , Post Dec. */ ARMul_LDC (state, instr, LHS); @@ -4622,7 +4622,7 @@ check_PMUintr: default: break; } - /* Drop through. */ + ATTRIBUTE_FALLTHROUGH; case 0xe0: case 0xe4: diff --git a/sim/arm/armos.c b/sim/arm/armos.c index 374861d7a5ec..6deb722d204d 100644 --- a/sim/arm/armos.c +++ b/sim/arm/armos.c @@ -832,6 +832,7 @@ ARMul_OSHandleSWI (ARMul_State * state, ARMword number) } break; } + ATTRIBUTE_FALLTHROUGH; default: unhandled = TRUE; diff --git a/sim/arm/thumbemu.c b/sim/arm/thumbemu.c index 6915d23ec4cc..99f51ef34691 100644 --- a/sim/arm/thumbemu.c +++ b/sim/arm/thumbemu.c @@ -308,7 +308,7 @@ handle_T2_insn (ARMul_State * state, * pvalid = t_branch; break; } - /* Fall through. */ + ATTRIBUTE_FALLTHROUGH; case 0x42: case 0x43: case 0x47: @@ -2261,7 +2261,7 @@ ARMul_ThumbDecode (ARMul_State * state, | ((tinstr & 0x0078) >> 3); /* Rd */ break; } - /* Drop through. */ + ATTRIBUTE_FALLTHROUGH; default: case 0x0: /* UNDEFINED */ case 0x4: /* UNDEFINED */ @@ -2415,7 +2415,7 @@ ARMul_ThumbDecode (ARMul_State * state, * ainstr = 0xE1200070 | ((tinstr & 0xf0) << 4) | (tinstr & 0xf); break; } - /* Drop through. */ + ATTRIBUTE_FALLTHROUGH; default: /* Everything else is an undefined instruction. */ handle_v6_thumb_insn (state, tinstr, next_instr, pc, ainstr, & valid); @@ -2601,6 +2601,7 @@ ARMul_ThumbDecode (ARMul_State * state, } /* else we fall through to process the second half of the BL */ pc += 2; /* point the pc at the 2nd half */ + ATTRIBUTE_FALLTHROUGH; case 31: /* BL instruction 2 */ if (state->is_v6) { diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index 52b4dc7d6e09..8d928a6f79f9 100644 --- a/sim/arm/wrapper.c +++ b/sim/arm/wrapper.c @@ -251,7 +251,7 @@ sim_create_inferior (SIM_DESC sd ATTRIBUTE_UNUSED, (sim_callback, "Unknown machine type '%d'; please update sim_create_inferior.\n", mach); - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case 0: /* We wouldn't set the machine type with earlier toolchains, so we @@ -310,7 +310,7 @@ sim_create_inferior (SIM_DESC sd ATTRIBUTE_UNUSED, ARMul_SelectProcessor (state, ARM_v5_Prop | ARM_v5e_Prop | ARM_XScale_Prop); break; } - /* Otherwise drop through. */ + ATTRIBUTE_FALLTHROUGH; case bfd_mach_arm_5T: ARMul_SelectProcessor (state, ARM_v5_Prop); From patchwork Thu Dec 21 07:01:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82643 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 37D39386F01D for ; Thu, 21 Dec 2023 07:02:13 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id BCB91384DEE7 for ; Thu, 21 Dec 2023 07:01:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BCB91384DEE7 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 BCB91384DEE7 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=1703142100; cv=none; b=FszvWI+WJUOGTNOILn+AoxPEzUjR0lqWEck38azQ4GFcaayzPyOw04b+deFgxx8iDTFdUl2j05oFNlDZulrYxfoWlGeQjZb4WBMRPMSMi1ZIuqJRWPLDyeyAQAfId/NaZPPOQmS/VoR2C9KAUA2BOWYWd6Ruvz/3T+oOWCTzkEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142100; c=relaxed/simple; bh=NLxHE+NXbAHnadnRpF+o8BQZWJYZm1cHSOx10FIxUfk=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ZVGhVlUEwpQI4rcxRUJD0DKoK39mQrwLeSQdNBXH7ve8j8oLpsKhVi31FpZEirK4o4Uw5+yzE7dTFQYiE5Xq6x6JxZVEaIW3gku71csUdfFC77oF1+GhouxmeRNc2+ryeKEm1apjKlQV3UiZ2Stnzk7Xr9dLl5RisBVtcp3yvno= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 6CBA0340943; Thu, 21 Dec 2023 07:01:39 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 06/20] sim: avr: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:13 -0500 Message-ID: <20231221070127.19142-6-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 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 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 Replace some fall through comments with the attribute. --- sim/avr/interp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/avr/interp.c b/sim/avr/interp.c index eef4ad96ec2f..377398e94e26 100644 --- a/sim/avr/interp.c +++ b/sim/avr/interp.c @@ -896,7 +896,7 @@ step_once (SIM_CPU *cpu) case OP_reti: sram[SREG] |= SREG_I; - /* Fall through */ + ATTRIBUTE_FALLTHROUGH; case OP_ret: { const struct avr_sim_state *state = AVR_SIM_STATE (CPU_STATE (cpu)); From patchwork Thu Dec 21 07:01:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82648 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 62B6538708AA for ; Thu, 21 Dec 2023 07:02:29 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id D9EAF384DB5E for ; Thu, 21 Dec 2023 07:01:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D9EAF384DB5E 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 D9EAF384DB5E 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=1703142103; cv=none; b=DPAcRpvD6r0vQmzVzQ9TZFy/JozrtDWCOTrQ2wLnRv0YHD8jB9sePY7crvpseYbbnrlRE4ov00ysmcdjJ1xsZwDl1z5qpvq4URaM0vX4XvB6/sqaMKJA4zBzY7InbpKmE1KJCJKJ5cjWtSSubzCuvjLb1Ljeg5Qr8IOsFFQwtew= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142103; c=relaxed/simple; bh=V8g1E8NHb4rB/ETLBEnHk6AVnc3mVTDr2RKbLPzHoWI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=MPMAk4PfvgpdszfizK+5J55rvXIhb3VlyYFnDZpbM/xj4EsbKe+WoWm0extm1s+FcBvj1yi/O7bA3YtnXnoSKcY8RiPOb/CUc+92rDR60SlerMIe/rQwzjvwf5mEVaTxxhAMo+oxiEivSb8Ievje94g8Ou5LXgJH3Yzv7RDPv9Y= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 8B500340943; Thu, 21 Dec 2023 07:01:41 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 07/20] sim: bfin: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:14 -0500 Message-ID: <20231221070127.19142-7-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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=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 Add the attribute to places where we want to fall thru. --- sim/bfin/dv-bfin_dma.c | 1 + sim/bfin/dv-bfin_twi.c | 1 + sim/bfin/dv-bfin_uart2.c | 1 + sim/bfin/interp.c | 2 ++ 4 files changed, 5 insertions(+) diff --git a/sim/bfin/dv-bfin_dma.c b/sim/bfin/dv-bfin_dma.c index a3384700b2bf..4d2b95d24836 100644 --- a/sim/bfin/dv-bfin_dma.c +++ b/sim/bfin/dv-bfin_dma.c @@ -173,6 +173,7 @@ bfin_dma_process_desc (struct hw *me, struct bfin_dma *dma) dma->ndph = _flows[1]; --ndsize; ++flows; + ATTRIBUTE_FALLTHROUGH; case DMAFLOW_SMALL: dma->ndpl = _flows[0]; --ndsize; diff --git a/sim/bfin/dv-bfin_twi.c b/sim/bfin/dv-bfin_twi.c index 0ea224ca63cb..5a25320cb10c 100644 --- a/sim/bfin/dv-bfin_twi.c +++ b/sim/bfin/dv-bfin_twi.c @@ -118,6 +118,7 @@ bfin_twi_io_write_buffer (struct hw *me, const void *source, int space, break; case mmr_offset(xmt_data8): value &= 0xff; + ATTRIBUTE_FALLTHROUGH; case mmr_offset(xmt_data16): twi->xmt_fifo = value; break; diff --git a/sim/bfin/dv-bfin_uart2.c b/sim/bfin/dv-bfin_uart2.c index 0b55a30a55d3..5c8a50659b3c 100644 --- a/sim/bfin/dv-bfin_uart2.c +++ b/sim/bfin/dv-bfin_uart2.c @@ -158,6 +158,7 @@ bfin_uart_io_read_buffer (struct hw *me, void *dest, case mmr_offset(lsr): uart->lsr &= ~(DR | THRE | TEMT); uart->lsr |= bfin_uart_get_status (me); + ATTRIBUTE_FALLTHROUGH; case mmr_offset(thr): case mmr_offset(msr): case mmr_offset(dll): diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c index df1d1b3f70f2..bb0b83c01c2f 100644 --- a/sim/bfin/interp.c +++ b/sim/bfin/interp.c @@ -396,12 +396,14 @@ bfin_syscall (SIM_CPU *cpu) goto sys_finish; case CB_SYS_setuid: sc.arg1 &= 0xffff; + ATTRIBUTE_FALLTHROUGH; case CB_SYS_setuid32: tbuf += sprintf (tbuf, "setuid(%u)", args[0]); sc.result = setuid (sc.arg1); goto sys_finish; case CB_SYS_setgid: sc.arg1 &= 0xffff; + ATTRIBUTE_FALLTHROUGH; case CB_SYS_setgid32: tbuf += sprintf (tbuf, "setgid(%u)", args[0]); sc.result = setgid (sc.arg1); From patchwork Thu Dec 21 07:01:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82647 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 AE06B386C5A4 for ; Thu, 21 Dec 2023 07:02:22 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 0B4A9385E456 for ; Thu, 21 Dec 2023 07:01:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B4A9385E456 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 0B4A9385E456 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=1703142105; cv=none; b=V/T9Lj6N5ExR4IT//LX/rL9UqoPZ4CnhHFNlBPwtlSV+G8c53cF2zt3HZ+SMJMHDA87uwaZJTFwEIzoXMxbam/d8jpHSGddWu0FbtXsGfukzxE4RnXBADgUK0TAhbwHYLfZnOqRb6qPBKkPNh5T88gxxd7Yud39oVSoKQ0hOrb8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142105; c=relaxed/simple; bh=seEXR3JdeFClNK9FFPq61cFsRHHVAh4bcLHeLHwyeM8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=OPlc8ht3VhVT4/s6vfejhy8Ci7HYMcmsk7mMqGMmOAmoYhJrbf98F1KNKyAl20kItI1fkT0scwKro4fl6AraAYO7a+d1FnvQtPMOgpEX9Wu5zm8ORhJGsk190HfD+WqjvUUaBh9ZUtaI9FN2GNCdaMHGddYmVK2M/+FA5xd/EEg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 98FEC340BEF; Thu, 21 Dec 2023 07:01:43 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 08/20] sim: cris: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:15 -0500 Message-ID: <20231221070127.19142-8-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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=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 Replace some fall through comments with the attribute. --- sim/cris/cris-tmpl.c | 4 ++++ sim/cris/traps.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sim/cris/cris-tmpl.c b/sim/cris/cris-tmpl.c index b39583cdb207..232085cf452e 100644 --- a/sim/cris/cris-tmpl.c +++ b/sim/cris/cris-tmpl.c @@ -67,6 +67,10 @@ MY (f_break_handler) (SIM_CPU *cpu, USI breaknum, USI pc) cris_break_13_handler (cpu, /* TARGET_SYS_exit */ 1, 0, 0, 0, 0, 0, 0, pc); + /* This shouldn't be reached, but we can't mark break 13 as noreturn + since there are some calls which should return. */ + ATTRIBUTE_FALLTHROUGH; + default: abort (); } diff --git a/sim/cris/traps.c b/sim/cris/traps.c index 29b1b7cfdb38..cd4cfd9f0208 100644 --- a/sim/cris/traps.c +++ b/sim/cris/traps.c @@ -1527,7 +1527,7 @@ cris_break_13_handler (SIM_CPU *current_cpu, USI callnum, USI arg1, retval = TARGET_O_WRONLY; break; } - /* FALLTHROUGH */ + ATTRIBUTE_FALLTHROUGH; default: /* Nothing else is implemented. */ retval From patchwork Thu Dec 21 07:01:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82642 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 7B174386C5A9 for ; Thu, 21 Dec 2023 07:02:04 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 089333858030 for ; Thu, 21 Dec 2023 07:01:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 089333858030 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 089333858030 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=1703142107; cv=none; b=mi7bbNWVfFQ/Pa9zDND9PWbRtyZaHuN7yJtusqiyKWFA1YkHcAQXe0Tkl6K6HpZHtuWOT5Uioz35jmlLmAJSG4buvA3t/OalyJXWPV0yJgGq5IbrdUSjT4yXjTC86pG+qkvLiU9FBFkIEf4OwM7dU/pAULyAESk5WiwvUu7W2Z4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142107; c=relaxed/simple; bh=Zj5wYy5zuZ691E7qe/2ztXXZtBfDVXnDHZXhdsMF4Ko=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=S8sqNUqjbV54NC+XlXlBbnCPIQZlj0mAJcbgEcfazhWE01yU1ez8NUOLYPHZT/G8fO8fL2rjz2tnCp5NXIjobm8/47u16qsopK9uw4AZQSAXCR/1jnZr7vXopZfbnoc8E4IXd06L+amSulK/exWFbDDSw0mJBmy/kFC66bu5BTU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id A4F81340DE6; Thu, 21 Dec 2023 07:01:45 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 09/20] sim: erc32: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:16 -0500 Message-ID: <20231221070127.19142-9-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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=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 Add the attribute where it seems to make sense. --- sim/erc32/erc32.c | 1 + sim/erc32/exec.c | 10 ++++++++++ sim/erc32/sis.c | 1 + 3 files changed, 12 insertions(+) diff --git a/sim/erc32/erc32.c b/sim/erc32/erc32.c index c4abab2889c5..b37183a26af0 100644 --- a/sim/erc32/erc32.c +++ b/sim/erc32/erc32.c @@ -799,6 +799,7 @@ mec_write(uint32_t addr, uint32_t data) case MEC_UARTA: case MEC_UARTB: if (data & 0xFFFFFF00) mecparerror(); + ATTRIBUTE_FALLTHROUGH; case MEC_UART_CTRL: if (data & 0xFF00FF00) mecparerror(); write_uart(addr, data); diff --git a/sim/erc32/exec.c b/sim/erc32/exec.c index 1187bccfec78..10a9dae603c0 100644 --- a/sim/erc32/exec.c +++ b/sim/erc32/exec.c @@ -1220,6 +1220,7 @@ dispatch_instruction(struct pstate *sregs) switch (op3) { case LDDA: if (!chk_asi(sregs, &asi, op3)) break; + ATTRIBUTE_FALLTHROUGH; case LDD: if (address & 0x7) { sregs->trap = TRAP_UNALI; @@ -1250,6 +1251,7 @@ dispatch_instruction(struct pstate *sregs) case LDA: if (!chk_asi(sregs, &asi, op3)) break; + ATTRIBUTE_FALLTHROUGH; case LD: if (address & 0x3) { sregs->trap = TRAP_UNALI; @@ -1265,6 +1267,7 @@ dispatch_instruction(struct pstate *sregs) break; case LDSTUBA: if (!chk_asi(sregs, &asi, op3)) break; + ATTRIBUTE_FALLTHROUGH; case LDSTUB: mexc = memory_read(asi, address, &data, 0, &ws); sregs->hold += ws; @@ -1288,6 +1291,7 @@ dispatch_instruction(struct pstate *sregs) case LDSBA: case LDUBA: if (!chk_asi(sregs, &asi, op3)) break; + ATTRIBUTE_FALLTHROUGH; case LDSB: case LDUB: mexc = memory_read(asi, address, &data, 0, &ws); @@ -1305,6 +1309,7 @@ dispatch_instruction(struct pstate *sregs) case LDSHA: case LDUHA: if (!chk_asi(sregs, &asi, op3)) break; + ATTRIBUTE_FALLTHROUGH; case LDSH: case LDUH: if (address & 0x1) { @@ -1426,6 +1431,7 @@ dispatch_instruction(struct pstate *sregs) case STA: if (!chk_asi(sregs, &asi, op3)) break; + ATTRIBUTE_FALLTHROUGH; case ST: if (address & 0x3) { sregs->trap = TRAP_UNALI; @@ -1439,6 +1445,7 @@ dispatch_instruction(struct pstate *sregs) break; case STBA: if (!chk_asi(sregs, &asi, op3)) break; + ATTRIBUTE_FALLTHROUGH; case STB: mexc = memory_write(asi, address, rdd, 0, &ws); sregs->hold += ws; @@ -1448,6 +1455,7 @@ dispatch_instruction(struct pstate *sregs) break; case STDA: if (!chk_asi(sregs, &asi, op3)) break; + ATTRIBUTE_FALLTHROUGH; case STD: if (address & 0x7) { sregs->trap = TRAP_UNALI; @@ -1505,6 +1513,7 @@ dispatch_instruction(struct pstate *sregs) break; case STHA: if (!chk_asi(sregs, &asi, op3)) break; + ATTRIBUTE_FALLTHROUGH; case STH: if (address & 0x1) { sregs->trap = TRAP_UNALI; @@ -1561,6 +1570,7 @@ dispatch_instruction(struct pstate *sregs) break; case SWAPA: if (!chk_asi(sregs, &asi, op3)) break; + ATTRIBUTE_FALLTHROUGH; case SWAP: if (address & 0x3) { sregs->trap = TRAP_UNALI; diff --git a/sim/erc32/sis.c b/sim/erc32/sis.c index 7445c7b1a4bb..2de493a3528e 100644 --- a/sim/erc32/sis.c +++ b/sim/erc32/sis.c @@ -281,6 +281,7 @@ main(int argc, char **argv) break; case CTRL_C: printf("\b\bInterrupt!\n"); + ATTRIBUTE_FALLTHROUGH; case TIME_OUT: printf(" Stopped at time %" PRIu64 " (%.3f ms)\n", ebase.simtime, ((double) ebase.simtime / (double) sregs.freq) / 1000.0); From patchwork Thu Dec 21 07:01:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82652 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 AA2A838708AA for ; Thu, 21 Dec 2023 07:02:43 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 09F77384DECA for ; Thu, 21 Dec 2023 07:01:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09F77384DECA 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 09F77384DECA 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=1703142109; cv=none; b=tdNBfFNOD10ueMErLrcG5lU91Db862qVPw9GwkZExSmd2TiMWZ1kWz55c4m07+5274RQJieCYqDHISqgZDUbm9Fe1zCiKcmNWxnWQNGsuz6Ao9zcp+55Rct09JkyU5/1yLad3YMeqyFlZTitnYqQBCKA/9zteTJ6mrTyAFU2qqk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142109; c=relaxed/simple; bh=KHtt9ONTllbBKUI4ep9Ph/m6IRKdiTW7VStgP0ybVpk=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=WaQ5DBx1mBwugg4lelyX8RAkAtf6dif2gHvEU7m/7Tri4McQ0y34Rrmbu2oV2ChZTa07ht6xEnrBvRgOuMMUPpg+xFUP2df5th1wRq+wT23lVTIf8Rk822NFHc6x/NveHiUDxvT7DQ7o2zm3GB8evKN/g8tlAvTCiBUXPXRGtLw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id AEC56342F65; Thu, 21 Dec 2023 07:01:47 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 10/20] sim: frv: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:17 -0500 Message-ID: <20231221070127.19142-10-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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=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 Replace some fall through comments with the attribute. --- sim/frv/cache.c | 2 +- sim/frv/interrupts.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sim/frv/cache.c b/sim/frv/cache.c index c2beb39d3ef8..2d0fe5a590e9 100644 --- a/sim/frv/cache.c +++ b/sim/frv/cache.c @@ -136,7 +136,7 @@ frv_cache_reconfigure (SIM_CPU *current_cpu, FRV_CACHE *cache) break; } } - /* fall through */ + ATTRIBUTE_FALLTHROUGH; default: /* Set the cache to its original settings. */ cache->sets = cache->configured_sets; diff --git a/sim/frv/interrupts.c b/sim/frv/interrupts.c index baf058f18d4a..979360738bab 100644 --- a/sim/frv/interrupts.c +++ b/sim/frv/interrupts.c @@ -835,7 +835,7 @@ set_exception_status_registers ( { case FRV_DIVISION_EXCEPTION: set_isr_exception_fields (current_cpu, item); - /* fall thru to set reg_index. */ + ATTRIBUTE_FALLTHROUGH; /* To set reg_index. */ case FRV_COMMIT_EXCEPTION: /* For fr550, always use ESR0. */ if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_fr550) @@ -855,7 +855,7 @@ set_exception_status_registers ( break; case FRV_DATA_ACCESS_EXCEPTION: set_daec = 1; - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case FRV_DATA_ACCESS_MMU_MISS: case FRV_MEM_ADDRESS_NOT_ALIGNED: /* Get the appropriate ESR, EPCR, EAR and EDR. From patchwork Thu Dec 21 07:01:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82655 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 1FD213870C37 for ; Thu, 21 Dec 2023 07:02:58 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 24DDC384DB5E for ; Thu, 21 Dec 2023 07:01:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 24DDC384DB5E 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 24DDC384DB5E 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=1703142111; cv=none; b=cN9faK8HAmh/y29IiaESlc5Ndmz8n/kVz7ecBU9fyuNPyeOBPMoImAhkB+PE5Lla8Kb7HXpkUDrxe/Ux4a4ei99u98M07+RwrrypH/Jq3t93hI8gLADs7vsT35m3fIzj77wu7tym/COPRK9fkVxUmqCgszMZVbvbaeNjTNBUs6k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142111; c=relaxed/simple; bh=la/nN4WqvxJRIjhCfGXcBWJh0Ln9junesHCaumiShtI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=qvi/jqSGKj+wbeR8+0iWTDTZBgjWthpQv2IlhgwZgaaK/YEIzAS/6w6MTc7lByLhDs14gU5rz2kBQhZHHbnw4sREd5bSeEg/f7A1o37mIj2lUdMB0teTmWmQpH+OIIGLYpIDG3OjHvNSlXLdzuNwfRl4Lj3aHaNne3/P9uJwXlA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id CA892340DE6; Thu, 21 Dec 2023 07:01:49 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 11/20] sim: m68hc11: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:18 -0500 Message-ID: <20231221070127.19142-11-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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=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 Seems like these register operations intended on falling thru. --- sim/m68hc11/dv-m68hc11sio.c | 1 + sim/m68hc11/dv-m68hc11spi.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sim/m68hc11/dv-m68hc11sio.c b/sim/m68hc11/dv-m68hc11sio.c index d5ecbe4f822e..03b44613c180 100644 --- a/sim/m68hc11/dv-m68hc11sio.c +++ b/sim/m68hc11/dv-m68hc11sio.c @@ -523,6 +523,7 @@ m68hc11sio_io_read_buffer (struct hw *me, case M6811_SCSR: controller->rx_clear_scsr = m68hc11_cpu->ios[M6811_SCSR] & (M6811_RDRF | M6811_IDLE | M6811_OR | M6811_NF | M6811_FE); + ATTRIBUTE_FALLTHROUGH; case M6811_BAUD: case M6811_SCCR1: diff --git a/sim/m68hc11/dv-m68hc11spi.c b/sim/m68hc11/dv-m68hc11spi.c index e552fd5de9a8..ac44e6ed7e2f 100644 --- a/sim/m68hc11/dv-m68hc11spi.c +++ b/sim/m68hc11/dv-m68hc11spi.c @@ -405,6 +405,7 @@ m68hc11spi_io_read_buffer (struct hw *me, case M6811_SPSR: controller->rx_clear_scsr = m68hc11_cpu->ios[M6811_SCSR] & (M6811_SPIF | M6811_WCOL | M6811_MODF); + ATTRIBUTE_FALLTHROUGH; case M6811_SPCR: val = m68hc11_cpu->ios[base]; From patchwork Thu Dec 21 07:01:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82645 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 7BA7C386EC0D for ; Thu, 21 Dec 2023 07:02:21 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 31815384CB9D for ; Thu, 21 Dec 2023 07:01:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31815384CB9D 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 31815384CB9D 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=1703142114; cv=none; b=dXg1vTiVcoyx5evk9xp7RmJALRDigmK6esNw46+Hs+RkDf69qTsldkzg695Y0waG6PYkKjN4OtdoiDkq+CsmAVenuMYbkG9TCuYS0NXrHh23IjpBHBwS9u7LNQXoxeMoT8NjJQzpEg4MHuU9e0OeKx4tJcEzIK6kdqd5BudsKhE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142114; c=relaxed/simple; bh=yDC5UHiwGuKwLmnWhjEAdnl73PnhzQXQGaL++Tou2LQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=GTWb14bm+QmEdcMF0JACcmkudgjZxYh+ZwiUGFvcT1x+2rFTrX6lZ0L4LCc3ygDjas/D/avM0KuB0udoFEUVnVBnj0yG6geVVE24fWFD3afarmtCiKAd+rULqmunZFO8wT6ubC7xz9Sj+Vd+w2HNg0pHiEYh3QuQu49Z223ZKrE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id D52F5340943; Thu, 21 Dec 2023 07:01:51 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 12/20] sim: mcore: fix Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:19 -0500 Message-ID: <20231221070127.19142-12-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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=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 Seems like these decodes were intended to fallthru. --- sim/mcore/interp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sim/mcore/interp.c b/sim/mcore/interp.c index b0c2cc2b3177..d24af0d94720 100644 --- a/sim/mcore/interp.c +++ b/sim/mcore/interp.c @@ -1105,6 +1105,7 @@ step_once (SIM_DESC sd, SIM_CPU *cpu) fprintf (stderr, "func call: r2 = %x r3 = %x r4 = %x r5 = %x r6 = %x r7 = %x\n", gr[2], gr[3], gr[4], gr[5], gr[6], gr[7]); + ATTRIBUTE_FALLTHROUGH; case 0x70: /* jmpi */ pc = rlat ((pc + ((inst & 0xFF) << 2)) & 0xFFFFFFFC); memops++; @@ -1192,6 +1193,7 @@ step_once (SIM_DESC sd, SIM_CPU *cpu) case 0xF8: case 0xF9: case 0xFA: case 0xFB: case 0xFC: case 0xFD: case 0xFE: case 0xFF: /* bsr */ gr[15] = pc; + ATTRIBUTE_FALLTHROUGH; case 0xF0: case 0xF1: case 0xF2: case 0xF3: case 0xF4: case 0xF5: case 0xF6: case 0xF7: /* br */ { From patchwork Thu Dec 21 07:01:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82646 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 1C66B386EC02 for ; Thu, 21 Dec 2023 07:02:22 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 5D902384DEF1 for ; Thu, 21 Dec 2023 07:01:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5D902384DEF1 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 5D902384DEF1 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=1703142115; cv=none; b=lC0KNcfCsTqBbunlXfKJaongg/KNP7aEqqx9xG1O6eqYXz7bCSE/nq4qCfxT9cSDKey18owLKpJlwacGLPi9GB/W7rfHmDCdFQfUUluKcrAwdW95XI9l6RtQgEkslg7MlzDeOhMrLnIMY8MKbZoYpkZOgBF4ZHtAnLqt/6EfBPE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142115; c=relaxed/simple; bh=wjRB+Y+aXT/hHyuOKhfs5reNp0LE/ptCbn99ktcVF/c=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Go7+eRzkC2sZeuAC+ZbHLOxamH1ifWomP/iagQVsyDnbXtqTNVR2KWdZgniOoYPmm8bq2JWQ/FdiETIYC0yG6Eanil0vv+B05NQIy6J/PfKuLOHnx3/SZ5T5Xb/Cb85stbY2cbLsx1JHe3jO7KLHZI2trAWwHiFneU14dIIfD5s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 0F10C340C42; Thu, 21 Dec 2023 07:01:54 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 13/20] sim: mips: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:20 -0500 Message-ID: <20231221070127.19142-13-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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=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 Seems like these cases were meant to fallthru. --- sim/mips/cp1.c | 4 ++++ sim/mips/interp.c | 4 +++- sim/mips/m16e.igen | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sim/mips/cp1.c b/sim/mips/cp1.c index 3e2d5d9f474d..9d1dfe5d8dde 100644 --- a/sim/mips/cp1.c +++ b/sim/mips/cp1.c @@ -262,6 +262,7 @@ store_fpr (sim_cpu *cpu, { case fmt_uninterpreted_32: fmt = fmt_uninterpreted; + ATTRIBUTE_FALLTHROUGH; case fmt_single: case fmt_word: if (STATE_VERBOSE_P (SD)) @@ -274,6 +275,7 @@ store_fpr (sim_cpu *cpu, case fmt_uninterpreted_64: fmt = fmt_uninterpreted; + ATTRIBUTE_FALLTHROUGH; case fmt_uninterpreted: case fmt_double: case fmt_long: @@ -294,6 +296,7 @@ store_fpr (sim_cpu *cpu, { case fmt_uninterpreted_32: fmt = fmt_uninterpreted; + ATTRIBUTE_FALLTHROUGH; case fmt_single: case fmt_word: FGR[fpr] = (value & 0xFFFFFFFF); @@ -302,6 +305,7 @@ store_fpr (sim_cpu *cpu, case fmt_uninterpreted_64: fmt = fmt_uninterpreted; + ATTRIBUTE_FALLTHROUGH; case fmt_uninterpreted: case fmt_double: case fmt_long: diff --git a/sim/mips/interp.c b/sim/mips/interp.c index 255807f67906..708e27f6b2b7 100644 --- a/sim/mips/interp.c +++ b/sim/mips/interp.c @@ -1247,7 +1247,7 @@ sim_monitor (SIM_DESC sd, if (A0 == 0) /* waitflag == NOWAIT */ V0 = (unsigned_word)-1; } - /* Drop through to case 11 */ + ATTRIBUTE_FALLTHROUGH; case 11: /* char inbyte(void) */ { @@ -1904,6 +1904,7 @@ signal_exception (SIM_DESC sd, } /* else fall through to normal exception processing */ sim_io_eprintf(sd,"ReservedInstruction at PC = 0x%s\n", pr_addr (cia)); + ATTRIBUTE_FALLTHROUGH; } default: @@ -2329,6 +2330,7 @@ decode_coproc (SIM_DESC sd, "Warning: PC 0x%lx:interp.c decode_coproc DEADC0DE\n", (unsigned long)cia); GPR[rt] = 0xDEADC0DE; /* CPR[0,rd] */ + ATTRIBUTE_FALLTHROUGH; /* CPR[0,rd] = GPR[rt]; */ default: if (op == cp0_mfc0 || op == cp0_dmfc0) diff --git a/sim/mips/m16e.igen b/sim/mips/m16e.igen index fda54cacad99..9facbd47bd61 100644 --- a/sim/mips/m16e.igen +++ b/sim/mips/m16e.igen @@ -212,16 +212,22 @@ switch (xsregs) { case 7: do_store (SD_,AccessLength_WORD, temp -= 4, 0, GPR[30]); + ATTRIBUTE_FALLTHROUGH; case 6: do_store (SD_,AccessLength_WORD, temp -= 4, 0, GPR[23]); + ATTRIBUTE_FALLTHROUGH; case 5: do_store (SD_,AccessLength_WORD, temp -= 4, 0, GPR[22]); + ATTRIBUTE_FALLTHROUGH; case 4: do_store (SD_,AccessLength_WORD, temp -= 4, 0, GPR[21]); + ATTRIBUTE_FALLTHROUGH; case 3: do_store (SD_,AccessLength_WORD, temp -= 4, 0, GPR[20]); + ATTRIBUTE_FALLTHROUGH; case 2: do_store (SD_,AccessLength_WORD, temp -= 4, 0, GPR[19]); + ATTRIBUTE_FALLTHROUGH; case 1: do_store (SD_,AccessLength_WORD, temp -= 4, 0, GPR[18]); } From patchwork Thu Dec 21 07:01:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82644 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 43DFF386C597 for ; Thu, 21 Dec 2023 07:02:13 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 65D6D3849792 for ; Thu, 21 Dec 2023 07:01:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65D6D3849792 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 65D6D3849792 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=1703142117; cv=none; b=YFaa3qXny7US1KB6g+mht6DCGoC0XSbVSaTNPRrBPe847/aUHQS2HBf5PhCMXspHGoz1KkoppbHsGPl3XS9jruhuv0Sq7g8h8S+ArVrKqIetLG343yOb68NK26W/T87uQfba2w7UXZg9dB0f4DSFDYIuviviQq2hjmaQZtfGGCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142117; c=relaxed/simple; bh=wxj0BSO7aq0qMdxb8Fef/KUERJl12Q5RwIFzL1gXOcY=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Ocxjlc7V8ATgyqUhpdd2Z13vuhw8tyrkQNjkSgsxUTjOILfVvMY5TeRzlWDN1DP/1JpsgARKkrhgkLZgZDC6r1lQ1pWZ3ARGY2bMNW8czp3Ek3crnL3QfOldZdkSIOLz6o9z1sqd6vrxXa/6UAX5lpjejJsWKMASuHyfDC/OoDg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 17073340DE6; Thu, 21 Dec 2023 07:01:56 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 14/20] sim: or1k: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:21 -0500 Message-ID: <20231221070127.19142-14-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 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 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 Replace some fall through comments with the attribute. --- sim/or1k/or1k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/or1k/or1k.c b/sim/or1k/or1k.c index 73ddeac87ade..b32e9b1e6401 100644 --- a/sim/or1k/or1k.c +++ b/sim/or1k/or1k.c @@ -270,7 +270,7 @@ or1k32bf_nop (sim_cpu *current_cpu, USI uimm16) case NOP_EXIT: sim_io_printf (CPU_STATE (current_cpu), "exit(%d)\n", GET_H_GPR (3)); - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case NOP_EXIT_SILENT: sim_engine_halt (sd, current_cpu, NULL, CPU_PC_GET (current_cpu), sim_exited, GET_H_GPR (3)); From patchwork Thu Dec 21 07:01:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82650 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 04CD63870844 for ; Thu, 21 Dec 2023 07:02:37 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 93781384DED6 for ; Thu, 21 Dec 2023 07:01:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 93781384DED6 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 93781384DED6 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=1703142120; cv=none; b=l32or4xZuQvujdm27AeQnGakiwvf3HIzXdq7B2CzbPbp+3hJkl38a+2l4io+Jjr2HK6HlxEKGUMQTTmRpB/ztZHXRCCFBRRBAyrjuWq8GYJq+OJdxFW43NHYv+P9OKcCFVZgL1uK7nbuCrOfXARuYFAf03LlUaYAH0tq489D0uo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142120; c=relaxed/simple; bh=BPv92K2xnfON3eUtn3vdRJN8hUC2QbJEBcXWU7xHBrM=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Jq7Wn+OHg1cyMYWOR/m9FWmrKZaZtYYLhcCPy3GEC9wHpEtmCRswb99n85kU9GlDHcXi9KKLrYSBgcG91FTElyWrANK4UFgebz9PbIGRvf1GnuO4yrl2iaedV8LGEJlv1wNkaY0xo89nwlkRB5tgp+d4DUeGnY7n43WLv+pbukY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 16BBB340DE6; Thu, 21 Dec 2023 07:01:58 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 15/20] sim: ppc: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:22 -0500 Message-ID: <20231221070127.19142-15-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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=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 Replace some fall through comments with the attribute. --- sim/ppc/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/ppc/device.c b/sim/ppc/device.c index 4537e89b38dc..45dda89caa83 100644 --- a/sim/ppc/device.c +++ b/sim/ppc/device.c @@ -1453,7 +1453,7 @@ device_find_string_array_property(device *me, if (node->sizeof_array == 0 || ((char*)node->array)[node->sizeof_array - 1] != '\0') device_error(me, "property %s invalid for string array", property); - /* FALL THROUGH */ + ATTRIBUTE_FALLTHROUGH; case string_array_property: ASSERT(node->sizeof_array > 0); ASSERT(((char*)node->array)[node->sizeof_array - 1] == '\0'); From patchwork Thu Dec 21 07:01:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82649 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 767E838708BA for ; Thu, 21 Dec 2023 07:02:29 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 7EFB8384DEFC for ; Thu, 21 Dec 2023 07:02:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7EFB8384DEFC 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 7EFB8384DEFC 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=1703142122; cv=none; b=QrpbSTq8nSaCANEuRouSIMtN89jM6yOc0oSbtquheFx+mT/kEH51tHygENZNcvsz6SsV9VajyViV8z/yQvudTIznFpPukq1/J7RJvtsqo+dJd+kqOlwKJJ01e+bduBr9mLEzQW2k/XxjZINRykBm1cFqYyuTw2dvwiQrqcBqS1Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142122; c=relaxed/simple; bh=1kyPM/lHjka3mhBv490Pv8RylZfr85NLB+L+97FEiKg=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=cZy5plBPW3naFiAnD6lOs/lq4ilPniTowxa47LwV1HLfX15CY+ttI9HdaXC4hwD0JNoUbTy8mezbH/BJrTNJKKMJsApDgQLRGpwv/EhhxkY90inB4mhrhUf4kw04J7Fad0qCwlpEN+fT08LbNEy+M/SnVheRATf3yEHuLL+JqQ0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 30FE3340CC9; Thu, 21 Dec 2023 07:02:00 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 16/20] sim: riscv: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:23 -0500 Message-ID: <20231221070127.19142-16-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 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 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 --- sim/riscv/sim-main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sim/riscv/sim-main.c b/sim/riscv/sim-main.c index afdfcf506566..4d2053453950 100644 --- a/sim/riscv/sim-main.c +++ b/sim/riscv/sim-main.c @@ -126,6 +126,7 @@ store_csr (SIM_CPU *cpu, const char *name, int csr, unsigned_word *reg, case CSR_INSTRETH: case CSR_TIMEH: RISCV_ASSERT_RV32 (cpu, "CSR: %s", name); + ATTRIBUTE_FALLTHROUGH; /* All the rest are immutable. */ default: From patchwork Thu Dec 21 07:01: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: 82651 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 87D053882AF0 for ; Thu, 21 Dec 2023 07:02:42 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 85CF0384CBA9 for ; Thu, 21 Dec 2023 07:02:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 85CF0384CBA9 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 85CF0384CBA9 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=1703142123; cv=none; b=hyLnMCKILmWibzTkgnuhmOllG9TNkWpCyzh4aJV0jrNVnFb08aQQsN3F6iDGGKVl8doaGZCYOmzpMOfoGlYTjn5VMZAv3YuDDcGWr9r2riSKSd214s/8IQCFdkkpx27PIDJPqEFeFEoW3N+BDpbEb3H2epvqw7DgZoMfmVcbkUY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142123; c=relaxed/simple; bh=P+wfKjljO4ni4WZhL+mPWCHTyB5VqJSrxTo5Lygi0Wo=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=DK0p2upkhdXBixBgVmwVsi5HamMpVcQxW8AzHnD7jlPgQhr+ULLTvD/EZr1ZivkAXvpSHseqS3RbQ3TFomb2yADPBm5PBMvHZ39hoP+rYCq3JvBnA5SzwV7YTUwjO3GfV5hs4kMlL0lzAAPz1x+UmKjGJNkOPTjBBEHkl6B5MBs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 35C83340DE6; Thu, 21 Dec 2023 07:02:02 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 17/20] sim: rl78: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:24 -0500 Message-ID: <20231221070127.19142-17-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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=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 Seems like this code was meant to fallthru. --- sim/rl78/rl78.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sim/rl78/rl78.c b/sim/rl78/rl78.c index 8f11c09d87d8..447f56fe02f0 100644 --- a/sim/rl78/rl78.c +++ b/sim/rl78/rl78.c @@ -499,6 +499,7 @@ decode_opcode (void) CLOCKS (3); /* note: adds two clocks, total 5 clocks */ else CLOCKS (2); /* note: adds one clock, total 4 clocks */ + ATTRIBUTE_FALLTHROUGH; case RLO_branch: tprintf ("BRANCH: "); v = GPC (); From patchwork Thu Dec 21 07:01:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82654 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 B464F3881D33 for ; Thu, 21 Dec 2023 07:02:52 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 9334D384DEFC for ; Thu, 21 Dec 2023 07:02:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9334D384DEFC 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 9334D384DEFC 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=1703142127; cv=none; b=bhSOwNo80lhWIKwsKRi3B81YWkeBXz4QMuFIvhk9cbLm1rDVmyqZwyCHV0QAiiHBE23BP7yUXHeUiudjLxWJe2gzrRmHWqqyb7ycrkJprXOZM7JqWuGeMP5xXGZ0evCuokEi4P2ttl1NbShj/3xpzlh8SI0n0OqhMETOp9cSeyA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142127; c=relaxed/simple; bh=d2DdgsicnYecSNgHXwTJn9PTapChveihmtSm4KOv0EY=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=QxvRBRXlgSHlCO7rmI3ChhYVLw5CpZzDt0DD4ryvNKfrvoikEKK+v86S3jjG+RwATlwT/r+I4E446plfRAz6+vEYjvR/l++JVvj71i3UAhN9BrRzlfzmn9Q3TM3DpIi60/mvmfSWNvqVSXR4Ldn9iL2+3LZ+xrdtMIX7cCoG0cY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 43164340C42; Thu, 21 Dec 2023 07:02:04 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 18/20] sim: rx: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:25 -0500 Message-ID: <20231221070127.19142-18-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 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 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 Replace some fall through comments with the attribute. --- sim/rx/rx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim/rx/rx.c b/sim/rx/rx.c index 7c02a336bd59..f4f785b938b5 100644 --- a/sim/rx/rx.c +++ b/sim/rx/rx.c @@ -411,7 +411,7 @@ get_op (const RX_Opcode_Decoded *rd, int i) case RX_Operand_Predec: /* [-Rn] */ put_reg (o->reg, get_reg (o->reg) - size2bytes[o->size]); - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case RX_Operand_Postinc: /* [Rn+] */ case RX_Operand_Zero_Indirect: /* [Rn + 0] */ case RX_Operand_Indirect: /* [Rn + addend] */ @@ -583,7 +583,7 @@ put_op (const RX_Opcode_Decoded *rd, int i, int v) case RX_Operand_Predec: /* [-Rn] */ put_reg (o->reg, get_reg (o->reg) - size2bytes[o->size]); - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case RX_Operand_Postinc: /* [Rn+] */ case RX_Operand_Zero_Indirect: /* [Rn + 0] */ case RX_Operand_Indirect: /* [Rn + addend] */ From patchwork Thu Dec 21 07:01:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82653 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 A1285388300D for ; Thu, 21 Dec 2023 07:02:43 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id A1C0B38618F5 for ; Thu, 21 Dec 2023 07:02:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A1C0B38618F5 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 A1C0B38618F5 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=1703142128; cv=none; b=glwOJQRkZdjjN9WEf2RphMYRDbKaxYSmMo7KK7jc4lEynJxA/4iAHr6ah94hZTrYsLxKE4Cj7tvGx1Bo0iepqQMb7QbmoEjgweZqlFNHBoQRZQEcPqVRX5fhKCqLe5JXqdW60rJMi8pujtpLTFyjzXqWE9rzx704GEJxf5wfjuU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142128; c=relaxed/simple; bh=CwTN45UvZQTzEeuq4i+gRKC9uI9NBXxK3awHsIFc130=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=cZdM733tw/8+QBdxU+69iQf8oCPhXJI3GkMTf+O7C4gvTlN1DQMWvPyo3GmFnFX4JVFiCNFRyM46oRBWq2LcwuOOF0m9QR2YuHhS5+cx6Zi1eoP1QWlC9pH0//O1ikhIvlb6TNu0mI3is3ZSANlVzVy8WBo47lfTNLD91zEUkwA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 5203E342F64; Thu, 21 Dec 2023 07:02:06 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 19/20] sim: sh: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:26 -0500 Message-ID: <20231221070127.19142-19-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 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 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 These generate conditional insns where it tests, then fallsthru. --- sim/sh/gencode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c index 1835cf92ff3f..9683dc46b86a 100644 --- a/sim/sh/gencode.c +++ b/sim/sh/gencode.c @@ -3296,6 +3296,7 @@ ppi_gensim (void) case 'c': printf (" if ((((iword >> 8) ^ DSR) & 1) == 0)\n"); printf ("\treturn;\n"); + printf (" ATTRIBUTE_FALLTHROUGH;\n"); printf (" }\n"); printf (" case %d:\n", p->index + 1); printf (" {\n"); From patchwork Thu Dec 21 07:01:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82656 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 46E12386F800 for ; Thu, 21 Dec 2023 07:03:12 +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 A67D938618FC for ; Thu, 21 Dec 2023 07:02:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A67D938618FC 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 A67D938618FC 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=1703142130; cv=none; b=aAOqKvy4UMqfmafC8u2pJWCDSTdXgUGgEnCGIIiV1zSmjazSz+kuP1T2wYHjmboOa1N7G5WpV7GNbc8YPfRye9Mm8vzeXD++LklfV4I3BCE7DiMOyPd1BTfeehHwSVn5D0EbhnrjPaXpd0wooUWlebQ6PZIvMQ6YcKgf6f4V2qQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142130; c=relaxed/simple; bh=9VVnWK+bHKXSb/3z0KWtjvPzqfNmLADb8VrYj0/O6Tw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=KukUMwcKe1weLgQxjiPiL+/61wm8vZjngJEWVZXJl6H9Sa05TsHTbiHy0/A7GN9sjHZQLNyvUj2hzncnQpSgyjSAoC70v+pkJx2YLKtvJVvjjz2X8l9RNL1YkHziXgh+n9/hoAjEFvcHjApxk1b+aARJK7QnZujTjnZAYywlZp4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 58D3D340943; Thu, 21 Dec 2023 07:02:08 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 20/20] sim: warnings: enable -Wimplicit-fallthrough=5 Date: Thu, 21 Dec 2023 02:01:27 -0500 Message-ID: <20231221070127.19142-20-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_NUMSUBJECT, 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 It caught some legitimate bugs, so clearly it's helpful. --- sim/configure | 1 + sim/m4/sim_ac_option_warnings.m4 | 1 + 2 files changed, 2 insertions(+) diff --git a/sim/m4/sim_ac_option_warnings.m4 b/sim/m4/sim_ac_option_warnings.m4 index 3da1c6a2e4a8..bdb99c496527 100644 --- a/sim/m4/sim_ac_option_warnings.m4 +++ b/sim/m4/sim_ac_option_warnings.m4 @@ -44,6 +44,7 @@ build_warnings="-Wall -Wpointer-arith dnl C++ -Wno-mismatched-tags -Wno-error=deprecated-register dnl C++ -Wsuggest-override +-Wimplicit-fallthrough=5 -Wduplicated-cond dnl -Wshadow=local dnl C++ -Wdeprecated-copy