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]); }