]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: erc32: fix -Wimplicit-fallthrough warnings
authorMike Frysinger <vapier@gentoo.org>
Thu, 21 Dec 2023 06:31:38 +0000 (01:31 -0500)
committerMike Frysinger <vapier@gentoo.org>
Thu, 21 Dec 2023 06:59:22 +0000 (01:59 -0500)
Add the attribute where it seems to make sense.

sim/erc32/erc32.c
sim/erc32/exec.c
sim/erc32/sis.c

index c4abab2889c58ab5844216dd7b0fdfed750a9bed..b37183a26af022c1405973537c280c4b845d39d0 100644 (file)
@@ -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);
index 1187bccfec78f4f883ac8e8a70cdf9071d74227d..10a9dae603c0e817b37248fc2c7ac77045c71b1b 100644 (file)
@@ -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;
index 7445c7b1a4bbe019dd8a7e44c0964a7ee3f758ae..2de493a3528e2f8734e17031cb3562a444c8f620 100644 (file)
@@ -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);