From patchwork Tue Mar 12 16:18:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 160128 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp13315198jad; Tue, 12 Mar 2019 09:40:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyo4SdFrIVE6OH1k5AzVtIZso+TsK40OyJJfukPCh4xq6ZIowkF5886kQ58m/fClZjGT9Bi X-Received: by 2002:a25:7ac1:: with SMTP id v184mr16327770ybc.348.1552408859275; Tue, 12 Mar 2019 09:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552408859; cv=none; d=google.com; s=arc-20160816; b=Vb+o0/K0VGFY0Mz/qbZocYP0GM+683T2AIJL0rLNijUe9C5pWnh+Sm808Asp/Cd2ml mrYmUjVUZyRHytuEqFgylGM6JjkLgkfwDqBQD5hUFw8G2tPGK77+I5WFUoelCqb2vrqI 4cVs3LX4hUOUXeBRBQHYFDDZaaH88UgaDOx7j9fk8IlUg/SmgYToFjdtrqv3GlbDZxNP J6L6KOZXlTk69C2hE7UgqAa/mg8ZI50EbXqPZY9PE7H3HGsLEV9D3HUaaYK/PmbFLJxL ieqvthxS1sh3H0uz4QirmBCpnZ55GQvJwapYNiEJvBmVcaubkz5ysr1pP11KfpwhrVt1 JneQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=lgmFLWb2AoBtsnhfwAW1Z+5LTMVI/a7+ZtnRExYBsYY=; b=f+Q9CauXvXQ1cBm649siLYruWwSdml161y8gB4BufBtDto1Q5pVVx3P5G/kYUDtWYu JP4QjXvcEgQNKaa5qg3s5dcivLP+MD2xhIhT5LP2fKM3iLgpwBVJTeebAk8nbW0CC/M+ L36uoglnuKgFZIzL0f9KOLqnJ/VZ5wTxsjCsVCmLCGEbf6cqDTlGMlknjK4xuZd0zhM2 RURIWoPG436P7/5j1zxsGWj7iMx6J0mVogz6a32P7+vaGNNCU5nSrbl2k+g9de41s1UY bGNr45JubwT64s270NokKjzz9er/gYWpD1pswR2BqGq+pD7ejBoxkcA5xSuMPhMWsQrA vhsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yncss9S0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s15si5913407ybc.182.2019.03.12.09.40.59 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 12 Mar 2019 09:40:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yncss9S0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:55579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3kSY-0007Jo-OP for patch@linaro.org; Tue, 12 Mar 2019 12:40:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3k7W-0005vf-W6 for qemu-devel@nongnu.org; Tue, 12 Mar 2019 12:19:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3k7V-0003rh-I8 for qemu-devel@nongnu.org; Tue, 12 Mar 2019 12:19:14 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:46173) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3k7V-0003qb-4a for qemu-devel@nongnu.org; Tue, 12 Mar 2019 12:19:13 -0400 Received: by mail-pf1-x436.google.com with SMTP id s23so2151939pfe.13 for ; Tue, 12 Mar 2019 09:19:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lgmFLWb2AoBtsnhfwAW1Z+5LTMVI/a7+ZtnRExYBsYY=; b=yncss9S0IjsjLgykvQKaveLciaoYw1AHk9ISDV7jIdwjVjbcG0K485DRVToFQYFW+I 7yxzomihx9W0gA/0e5cdScqpo53bgF6rIL96TgQhqAaVlVDJIDNtCmud5u87lNAVO439 QgeM9663G4tJjq5XQVEa3ThkReIjwWBjrzuDGxWoWLr0qGPOShYUATi9uu1YV1KWrm/H MC1hcVPQPQV3seYBFu+X8/oEtfxUekvEcr/nM1fUo3279mp4hJELZK5dzZ4U516QxL/e 79z/ceUc+m2rrTicPwgnMQKSWDrB/V3jYjxQFATIqCSZCc1Y9lq0aw24pfqJ4xKea3v5 CTJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lgmFLWb2AoBtsnhfwAW1Z+5LTMVI/a7+ZtnRExYBsYY=; b=m29kyVoR7FUyp3sSoeKK3WSCfeW00OlG8O3z7FL+xnh2r4Gj0+YLqLZi63AjUnrjI2 9OVWdUCEh77f+K3W58xZKDcF+pWM2avE5PbqvwJzhT9D6DAVA2PgP1nl6JQqskTrutz4 p93ro0sF9mW0B/Oj7ctVqVtlUHP2NVv70svjSqpRmF9rwDkImju5cC1IO+SJxn180Oqf qupf7taGnVLSofa+uTHCmxWO6qc4WSuqPsEMRc/qIv6qpxQUJ1BhB8blelgbeiIBWJP4 Do9pH5ArqEqdqqW0+DASaZZcrlFekm5kaZKxZVwO1T0P9SHj7KeEEM5batPeOF2xejlH vCMQ== X-Gm-Message-State: APjAAAWA4u3dBp5Nrze7OM0dtW+17tUftx6QLYxoMoQCFhyfUoQMAibq UMjI6S7K1yTEgFPdT/5UpX+DUZBhIN4= X-Received: by 2002:a63:3d0e:: with SMTP id k14mr18293294pga.302.1552407550511; Tue, 12 Mar 2019 09:19:10 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id q62sm12605644pga.32.2019.03.12.09.19.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Mar 2019 09:19:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 12 Mar 2019 09:18:55 -0700 Message-Id: <20190312161904.31130-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190312161904.31130-1-richard.henderson@linaro.org> References: <20190312161904.31130-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::436 Subject: [Qemu-devel] [PULL 02/11] target/hppa: fix overwriting source reg in addb X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Sven Schnelle Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Sven Schnelle When one of the source registers is the same as the destination register, the source register gets overwritten with the destionation value before do_add_sv() is called, which leads to unexpection condition matches. Signed-off-by: Sven Schnelle Message-Id: <20190311191602.25796-2-svens@stackframe.org> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- target/hppa/translate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.2 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 6c815e05c2..c4815d7e1a 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3031,7 +3031,7 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, DisasCond cond; in2 = load_gpr(ctx, r); - dest = dest_gpr(ctx, r); + dest = tcg_temp_new(); sv = NULL; cb_msb = NULL; @@ -3047,6 +3047,8 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, } cond = do_cond(c * 2 + f, dest, cb_msb, sv); + save_gpr(ctx, r, dest); + tcg_temp_free(dest); return do_cbranch(ctx, disp, n, &cond); }