From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YJz1AzAXUGMecA4AWB0awg (envelope-from ) for ; Wed, 19 Oct 2022 11:26:40 -0400 Received: by simark.ca (Postfix, from userid 112) id 0D2AC1E112; Wed, 19 Oct 2022 11:26:40 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=Zk+DR5hp; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C2F341E0D3 for ; Wed, 19 Oct 2022 11:26:39 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 754A8385C310 for ; Wed, 19 Oct 2022 15:26:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 754A8385C310 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666193199; bh=oO0hSlTLXnxt49LqH9/Iv2Mt5hC+V+dnsE31Nwx8vWk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Zk+DR5hpcUeIPepiO1SritKYB7rn0yl8qkM5l56cq7N0iBph1913fCM55+5loCo9c 0ZrI1rxqbfBK7R+unlN6udof1gCpuHM2ftUi0i3P5lGXUypBdb72GJ4YEUWcoNBm9D kuaxhy39OGElnw/bD0sN9rmZJ4sTTe0BnIFLceAY= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C9EDE3850864 for ; Wed, 19 Oct 2022 15:25:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C9EDE3850864 Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-93-uwWY6YyiOmyGn1anVwWA9w-1; Wed, 19 Oct 2022 11:25:11 -0400 X-MC-Unique: uwWY6YyiOmyGn1anVwWA9w-1 Received: by mail-qk1-f199.google.com with SMTP id v1-20020a05620a440100b006eee30cb799so8335875qkp.23 for ; Wed, 19 Oct 2022 08:25:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oO0hSlTLXnxt49LqH9/Iv2Mt5hC+V+dnsE31Nwx8vWk=; b=Et1CGgNWJtnrxj/F3vurtY+XN58ztLS3q0ua/D9lucKQ6qHM3GDc4mDl+FxYl7C4pb 51WDo3gFX31s/c5Qe9YOKInEzZ0vkpMRyRp+mc23EWQUEPJ9hw26VlQ1cmNKhv2F/WVn eDRYfaqGQOGD1+Dp5myvhKPs6Nz70a6kYQhxcxuvT84m7HDCCeiXSyte1EMt8Tseyd+9 QPaAiOaW21AwAW5EPPdWPjAc7x2OyxzaBFstFPenDNXFIwdByNaeriINa65UmzdRNSbl ddd04pxq0pbjH3zKw7UWNl/mvT5oRSaAySs2D0EQk/dAAlUvSIq9Rv3fPCIQkv/jrXY8 p1DA== X-Gm-Message-State: ACrzQf3CgKuqQm1VKlc6HZx1gSQr6RFfBwTUeArTrbR+ccyeoBI19/nn 10D6QecrT4kOgwgeyMw824Yf0cbxMhsbOlogG40VfifzHE9QKVFNSzBdX2cCdZSU494jLprekrO Prb0x8lHK7Zlt5tSFV5ArvUYnu06yYBoKXqQgZL///a1RtcWbMbU5NXM9xonQgCpUx+qlAAkNFQ == X-Received: by 2002:a05:620a:158f:b0:6ee:93d5:e249 with SMTP id d15-20020a05620a158f00b006ee93d5e249mr5912439qkk.505.1666193110559; Wed, 19 Oct 2022 08:25:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Tw5hBZLNbADHX/ithfqW0DrTBBtBjup0PXE5ed2/8oy78bQ6X/Gs8yFm4Fel8iLOZydHJZQ== X-Received: by 2002:a05:620a:158f:b0:6ee:93d5:e249 with SMTP id d15-20020a05620a158f00b006ee93d5e249mr5912424qkk.505.1666193110268; Wed, 19 Oct 2022 08:25:10 -0700 (PDT) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id o24-20020ac85558000000b0039bde72b14asm4104677qtr.92.2022.10.19.08.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 08:25:10 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCH 08/10] sim/h8300: avoid self assignment Date: Wed, 19 Oct 2022 16:24:47 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" There are two places in the h8300 simulator where we assign a variable to itself. Clang gives a warning for this, which is converted into an error by -Werror. Silence the warning by removing the self assignments. As these assignments were in a complex if/then/else tree, rather than try to adjust all the conditions, I've just replaced the self assignments with a comment and an empty statement. --- sim/h8300/compile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index 9be7dd565a9..5f64b4752f0 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -4141,7 +4141,7 @@ step_once (SIM_DESC sd, SIM_CPU *cpu) res = GET_B_REG (code->src.reg); /* FIXME fetch? */ if (!c && (0 <= (res >> 4) && (res >> 4) <= 9) && !h && (0 <= (res & 0xf) && (res & 0xf) <= 9)) - res = res; /* Value added == 0. */ + /* Nothing. */; /* Value added == 0. */ else if (!c && (0 <= (res >> 4) && (res >> 4) <= 8) && !h && (10 <= (res & 0xf) && (res & 0xf) <= 15)) res = res + 0x6; /* Value added == 6. */ @@ -4174,7 +4174,7 @@ step_once (SIM_DESC sd, SIM_CPU *cpu) res = GET_B_REG (code->src.reg); /* FIXME fetch, fetch2... */ if (!c && (0 <= (res >> 4) && (res >> 4) <= 9) && !h && (0 <= (res & 0xf) && (res & 0xf) <= 9)) - res = res; /* Value added == 0. */ + /* Nothing. */; /* Value added == 0. */ else if (!c && (0 <= (res >> 4) && (res >> 4) <= 8) && h && (6 <= (res & 0xf) && (res & 0xf) <= 15)) res = res + 0xfa; /* Value added == 0xfa. */ -- 2.25.4