From patchwork Fri Apr 7 18:36:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 671025 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp465439wrt; Fri, 7 Apr 2023 11:37:33 -0700 (PDT) X-Google-Smtp-Source: AKy350b9rzt1wHcs3gXnzG530Qjzv6BX7E/DSWzAMPYissu5K53DyZFkcsHQo6oA3Wx3CvLFNNxp X-Received: by 2002:a05:622a:8:b0:3e4:cee3:7e4a with SMTP id x8-20020a05622a000800b003e4cee37e4amr5743039qtw.22.1680892653252; Fri, 07 Apr 2023 11:37:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680892653; cv=none; d=google.com; s=arc-20160816; b=Z+kAfxeU6101lDsX1rZD9lZNWXIErwOkJmHE0sF3GIBmGmksS/PCOKE1+MYDC/1SCT AmXc0cqZHLphBI/zkTLmNzmiRw1MkmHhDaBpUjkC94ftWkYnFOSMD6xZ1dREoEOiHg7r 0jZASfWO9gJpIwabOeiJJo71/WisoC1Kz8lAAAE3i7j5nuh2KnhafsV4duWvA0a3ueGq zRFpvPi1H9Zn6u0Qy1kTNWJuPSKe0yG0jzf3LtCVYdKKJ1lmM2hj/Dzm90yD3wGr9Q0S lK9aCCH7eZ1voiq9CkuDkHUSL+m/un0XA5ItRV0K4pdVlu8N0AO2UFLXFnnJeIfT4iaN UlTg== 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:cc:to:from:dkim-signature; bh=lCbBH9TLJkbgg63E9qjRamQ6nLyVwGqt9gRUwFu0CdM=; b=D00msElgrnLrBnB2dg94b8sLAwpGcwC9iUsShnpOL83ttjN9jJO+/ihSPUjrihn/Zv 95OUZks8l/xkmgvszhc2Xp45fg6LrQHIMFSh9yJ3NUH9jU+9EWpxfDwsf7jyUC81mScD /Fx6iG05HyrKNFbjMGo0XYjYr9urwK6uY7peqNQma+KdSh2IPx7zyVHV6aKiZjpIu7I0 C1JOxQZweQOn20aSfiMh8joaktelmkQFD5zeDRqlmgk9jEVlUZ9wd4QPTN2NIkKzgV+9 4lfLjWOKjstSa0NlLZr6QUF2tw/VWmTaM8lfoR7/8MJmSYqDuATDq2fF3cRwE/FgaEvo a9OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oi1V6qNZ; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c20-20020a05622a025400b003df80029ac7si3261469qtx.19.2023.04.07.11.37.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Apr 2023 11:37:33 -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=Oi1V6qNZ; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkqwt-0001uS-3G; Fri, 07 Apr 2023 14:36:35 -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 1pkqwr-0001tv-Dc for qemu-devel@nongnu.org; Fri, 07 Apr 2023 14:36:33 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkqwp-0000cK-RQ for qemu-devel@nongnu.org; Fri, 07 Apr 2023 14:36:33 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1a5197f00e9so1139125ad.1 for ; Fri, 07 Apr 2023 11:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680892590; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=lCbBH9TLJkbgg63E9qjRamQ6nLyVwGqt9gRUwFu0CdM=; b=Oi1V6qNZRNLJryreRgQ/9/HhK7Y4GqfDmzY8xPrHCtMMcwVzXYvMJOv9f/VHLmzFRB pIcrFXTni+0TsgP/LUj8YNkUhh4eIxTDooIoNfWB50LodiuD4voJQz59v2GD6XY7nrDL JvfqGHB/Hgv+G+lh4pxht0TLtUJRA36pmTuj6rI5xAJ+G2yB/IQh7WjyIbdaM+cHLdjR VpvEmM14b23xcJ0VSAzsNR539MVZ7qTErCeI2CazkdqP74Vg7TEnL9Y4wLcoDvpfCBDt aWyn166BhIy8srGh4MOcNjrOIBsM0qZ9AMG0q3tF3UEtejc9fTPDmG2sP4bm4ydqVcES cuyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680892590; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lCbBH9TLJkbgg63E9qjRamQ6nLyVwGqt9gRUwFu0CdM=; b=urJ15rZkqWCPe181fRQN5Y9Hb7Rtt8kMU0Nr4RxhoQtCm+m96rfoXJ2HEIeE1V0Hz2 umfzndd0Y6oP8yiGt9nspKS7mnPorbegHAXdBqiPrQL3sE/XFsKO/DHfcM2bPOKchgmZ Z2Vw1ZA2e04iubG+c54sxfvH1dB5WRDfL+RPGryIUUHnqzhHicJ0JymhFSTRq69Qgo54 s3V0wuXAsAYup4UGwLcwJKcbpkkNZcqnk1VNofsdFLGCGEe7XSfv3pIjFgL9R+nmZPVO yEXIEbpQwa+ohTb+ZASBwQo+uR9fKkKJ6Z63ypT/lPvWR0wJJPdwxuALPSc535EfUjV4 G95Q== X-Gm-Message-State: AAQBX9c2iBeg0P6orHEJU1pPjKWF5BGturmMYIOfOjKwNk1lXWkNGwCI FXmOKBaR/osh5GDzS18sLTuFbOhnAzgrmE4XW+s= X-Received: by 2002:aa7:9809:0:b0:627:ef23:1f95 with SMTP id e9-20020aa79809000000b00627ef231f95mr3210654pfl.31.1680892590234; Fri, 07 Apr 2023 11:36:30 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id c12-20020aa78e0c000000b0062b5a55835dsm3344020pfr.213.2023.04.07.11.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 11:36:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: danielhb413@gmail.com, david@gibson.dropbear.id.au, clg@kaod.org, groug@kaod.org, qemu-ppc@nongnu.org, Nicholas Piggin Subject: [PATCH for-8.0] target/ppc: Fix temp usage in gen_op_arith_modw Date: Fri, 7 Apr 2023 11:36:28 -0700 Message-Id: <20230407183628.3239304-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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 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 Fix a crash writing to 't3', which is now a constant. Instead, write the result of the remu to 'ret'. Fixes: 7058ff5231a ("target/ppc: Avoid tcg_const_* in translate.c") Reported-by: Nicholas Piggin Signed-off-by: Richard Henderson Reviewed-by: Anton Johansson --- target/ppc/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 9d05357d03..906fc46723 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -1807,8 +1807,8 @@ static inline void gen_op_arith_modw(DisasContext *ctx, TCGv ret, TCGv arg1, TCGv_i32 t2 = tcg_constant_i32(1); TCGv_i32 t3 = tcg_constant_i32(0); tcg_gen_movcond_i32(TCG_COND_EQ, t1, t1, t3, t2, t1); - tcg_gen_remu_i32(t3, t0, t1); - tcg_gen_extu_i32_tl(ret, t3); + tcg_gen_remu_i32(ret, t0, t1); + tcg_gen_extu_i32_tl(ret, ret); } }