From patchwork Fri Dec 22 02:06:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82733 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 AA0703858404 for ; Fri, 22 Dec 2023 02:06:18 +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 8E0A83857C42 for ; Fri, 22 Dec 2023 02:06:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8E0A83857C42 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 8E0A83857C42 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=1703210767; cv=none; b=JxlyXHn25F3gdxwbbxkGcAy4gmkUHmqoo4IogI2CqSAbnIL6xx/TXjujcC85yJI2k8K9in1oOejOXWUfsBBOxMSEnUaDZVVNmBhzyhLV4ANn2LIe9XtGnvkJePl8v6o7CZWNB37OpXoP+egh8Ss/MbVa3Y+1klneQr3ndGDQ5to= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703210767; c=relaxed/simple; bh=9euBbYTeuuTtYip0AesZxHMbzjht5miiI7HmY7WopXQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Ccgr/bP4O4zZ4npktktJa0/IO/9UwO/+jIqmKDC5E6cJBj0xJ8pCSVR4yuT3wW/lWUFCmvyKaR+yngzOyhYT8xmeIUS2YAbZvsFFtQ+7oEaqE7vqCpYCsab5br9nHUeowGpbSMNWUFguDfyepr+s9t+jasASAYAbLBsLvGbPHho= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 3EE323408DD; Fri, 22 Dec 2023 02:06:04 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed] sim: ppc: igen: fix -G handling Date: Thu, 21 Dec 2023 21:06:02 -0500 Message-ID: <20231222020602.10361-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, 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 weren't using the enable_p flag to see whether the option should be enabled or disabled, and we weren't breaking out when done parsing. --- sim/ppc/igen.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sim/ppc/igen.c b/sim/ppc/igen.c index 8aa19c757f59..9f642440541e 100644 --- a/sim/ppc/igen.c +++ b/sim/ppc/igen.c @@ -439,15 +439,22 @@ main(int argc, { case '=': icache_size = atoi (argp + strlen ("gen-icache") + 1); - code |= generate_with_icache; + if (enable_p) + code |= generate_with_icache; + else + code &= ~generate_with_icache; break; case '\0': - code |= generate_with_icache; + if (enable_p) + code |= generate_with_icache; + else + code &= ~generate_with_icache; break; default: error ("Expecting -Ggen-icache or -Ggen-icache=\n"); } } + break; } case 'I': {