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