From patchwork Tue Aug 13 00:07:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 818750 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp54215wrm; Mon, 12 Aug 2024 17:08:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUSMCI1VSWsKjc32kLRqfZrSCctdj2UGMngdV5aGbrLHdSKl2JKId4tXFOEfOVx/SXnBTkCGJWKdJTp0z2V3IeA X-Google-Smtp-Source: AGHT+IEoZOwB/HGjPy+EMIWAHupEyBFdl9ZYB0gb5iERUf6Qcn25xz3flLtVYMt1npZqjXfdotCv X-Received: by 2002:a05:622a:4290:b0:44f:ee55:4dd7 with SMTP id d75a77b69052e-45349ae715dmr19504491cf.55.1723507729896; Mon, 12 Aug 2024 17:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723507729; cv=none; d=google.com; s=arc-20160816; b=bNJ/7MudY8IycHy7I3ueEYYad91wG4W0uOX3BNYWhKqhcwLvrOWzIZO+85B4Uo4FnH SsO+HbF5RUzW38BXn10z1bYe4pLe7EjL5zyUPcM/Kn3uGHJHbeC9BMDSX6mSyxOOhF52 bETViKnKMz8m7lRyKx2cjbuULtVexUwooVK0khpreWGB3NxWJywqigu89910TOQBS5Dv dYDAvY77JCA06H045uD3Ja4+Q0mfz533CEUVYIN7UfLJEpy7cNXHRKy+PSY1hbqQVDtW GLuTnk0nxojmY0UJy6LCWHsXgMwSubmTs8rOU7gCBETflK8pmb5TNh7AC19ubKVobRFz ASpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=157xaMoQ1wBHg5AP7mTAiNkrbkrM8xUbKEuFo0jGCag=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=U/PqnX0AI6aQYawRXuVPK0czLCk14yxtHtG79H2V2OYWPrRem8U0PYroYlMxi6jl6E ggc3+cLhmZsAVqJWEgpUloKWlYhi3UeV8oxThSJCI2UFSj4ATVRgdZ9bn+WGnNRvTfYX HH40RmMEsazDCPBFNmUHsR9nkq5gs/wHMBAwJrzXr/t0sxkoJWrRBICl5w69MMDaW32k gqFpg7Yh/lU1CzwsZzRPSMsloVvzpK5QP2KTn/Fr6VIOP+jxAmNZx3P99l9Tvid85Vy7 vqKDAlbW+OjEp1a/Zqm/HlE60As94krUk0khKuecwOVUrZGgGhxLU020v1MX2Bv3+xVa ZLDA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yqwYrGos; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4531c26742esi71088611cf.261.2024.08.12.17.08.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Aug 2024 17:08:49 -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=pass header.i=@linaro.org header.s=google header.b=yqwYrGos; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdf4q-00028K-KH; Mon, 12 Aug 2024 20:07:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdf4m-00027e-Cl for qemu-devel@nongnu.org; Mon, 12 Aug 2024 20:07:48 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sdf4j-0002zb-DB for qemu-devel@nongnu.org; Mon, 12 Aug 2024 20:07:48 -0400 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2cd5e3c27c5so3214418a91.3 for ; Mon, 12 Aug 2024 17:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723507663; x=1724112463; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=157xaMoQ1wBHg5AP7mTAiNkrbkrM8xUbKEuFo0jGCag=; b=yqwYrGosr2rDd4kKFvOUmtM2btTIFbyLSm8mbvpQYnEuOPQss0hbtFoAN/o7iuSdCe 6cpUAWz9xSRqkC5mMqpkK9EJH2bZ25+2kNx0fAyMmwXepueX0sCxgrIzGRbRovln6xl3 0sYhhF8AF5HXgDWjTU/JhHTyVzjxnYHqczFgsiiOM2EfGwQGHcx05hgYrzT+5awMjh3q LhL9DLeLU5SYdWP762FAMBH9K6rUSKjevmFTA/45ISRkDw5IGr3crcNVbfJb+YsV3g8d OtRt8HiOAleHElR7tAbcqrJ1iJMl3eCUqmGUZ9mGE3dfy7i2xjvCQIektJx++jP3G3bV yp4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723507663; x=1724112463; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=157xaMoQ1wBHg5AP7mTAiNkrbkrM8xUbKEuFo0jGCag=; b=m/dOa/p44Z63yWoufNg3nIrQnzUGQzT+DebyTM9fp9goyfViInInw0xoKiIxSs+4wU TQwlqiEvvUG13gtv+o4usqH5y6/GmoMdK9pT55t7XoLK8tfYhk8/f0nqutSUR4HW+9nA 5N0mP1SLQW4soJ7JBJvmOZmuew7ULR2Q5IkrDUAmXZyNNW2SGrSOQxtsTla8boPfKgHc qT4n6PzgZqqBJLcmqdVZZ2d3JeG10wPhFlO/wbtS9jnbWK/esS6I11mKphuzLAyjrzcU F6ygr+S1QYPaaPQJC7MqHVYHI6Z+E3jw4jFAyZVekwG40BEaWFBSHgLUOcM0syDiHhNy GWAw== X-Gm-Message-State: AOJu0YwH2sNWZ8G9XjEkAey/eFLqtV1S0Vskby0v/SeCeaFRe09kLcBJ vbDNFliJnlmKjrWbQnyXa7yu2dZCktwmWxHwkq+hYUiBv8hGQxSn5ReOuMrp3lJvKEOPrmsnq3W FxOw= X-Received: by 2002:a17:90a:4b0c:b0:2cd:b938:770b with SMTP id 98e67ed59e1d1-2d3924e0bdemr2033227a91.5.1723507663297; Mon, 12 Aug 2024 17:07:43 -0700 (PDT) Received: from stoup.. ([203.30.4.111]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2d1c9c7ad59sm9055186a91.13.2024.08.12.17.07.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Aug 2024 17:07:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH for-9.1] target/m68k: Always return a temporary from gen_lea_mode Date: Tue, 13 Aug 2024 10:07:37 +1000 Message-ID: <20240813000737.228470-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Returning a raw areg does not preserve the value if the areg is subsequently modified. Fixes, e.g. "jsr (sp)", where the return address is pushed before the branch. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2483 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/m68k/translate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index fb5ecce0c3..5e2be846b7 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -723,7 +723,9 @@ static TCGv gen_lea_mode(CPUM68KState *env, DisasContext *s, } /* fallthru */ case 2: /* Indirect register */ - return get_areg(s, reg0); + tmp = tcg_temp_new(); + tcg_gen_mov_i32(tmp, get_areg(s, reg0)); + return tmp; case 4: /* Indirect predecrememnt. */ if (opsize == OS_UNSIZED) { return NULL_QREG;