From patchwork Wed Oct 19 15:24:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 59069 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 451873853835 for ; Wed, 19 Oct 2022 15:26:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 451873853835 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666193203; 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=DQx/FG27gRH21nJV9vdVmFzeusw9CjOxwlAWbmUufyw+2q/wgIVcaErO3lDnLjiVI mutNzCGid7/9wfJ5+qbz3tAj2xk+nVLhXIde0SA5JKd850Cw1j0WA1RFoajqHwGIcg bJ8V4TYnWqPWU69rauE92/SHJh61i1n4wyk/g93U= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Burgess via Gdb-patches From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+patchwork=sourceware.org@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. */