public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
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	[thread overview]
Message-ID: <20231221070127.19142-13-vapier@gentoo.org> (raw)
In-Reply-To: <20231221070127.19142-1-vapier@gentoo.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]);
   }
-- 
2.43.0


  parent reply	other threads:[~2023-12-21  7:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21  7:01 [PATCH/committed 01/20] sim: signal: mark signal callback funcs as noreturn since they don't return Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 02/20] sim: add ATTRIBUTE_FALLTHROUGH for local code Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 03/20] sim: common: fix -Wimplicit-fallthrough warnings Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 04/20] sim: aarch64: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 05/20] sim: arm: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 06/20] sim: avr: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 07/20] sim: bfin: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 08/20] sim: cris: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 09/20] sim: erc32: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 10/20] sim: frv: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 11/20] sim: m68hc11: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 12/20] sim: mcore: fix Wimplicit-fallthrough warnings Mike Frysinger
2023-12-21  7:01 ` Mike Frysinger [this message]
2023-12-21  7:01 ` [PATCH/committed 14/20] sim: or1k: fix -Wimplicit-fallthrough warnings Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 15/20] sim: ppc: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 16/20] sim: riscv: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 17/20] sim: rl78: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 18/20] sim: rx: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 19/20] sim: sh: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 20/20] sim: warnings: enable -Wimplicit-fallthrough=5 Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231221070127.19142-13-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).