From patchwork Mon Jan 29 09:20:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jin Ma X-Patchwork-Id: 1892135 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=ZthNpKg1; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TNjTP03nGz23fD for ; Mon, 29 Jan 2024 20:20:57 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EAE553858407 for ; Mon, 29 Jan 2024 09:20:54 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by sourceware.org (Postfix) with ESMTPS id B095E3858407 for ; Mon, 29 Jan 2024 09:20:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B095E3858407 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.alibaba.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B095E3858407 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=115.124.30.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706520035; cv=none; b=YV75Zrh7IEiKQLbOol+94Wa54pD5c5hiep3M0uzB07XIVbidxLr/wA9xd6Vd/1BBoiA6SoCRFv7q7tvqy1KonwKB6VtIHOWU9xw3t12cJo0Rn3FAX/krn+ug0UyplyeTtCoBFq/hSulRbM3FT5TAcXOWKMtgsW1WQmQf1G7aX6k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706520035; c=relaxed/simple; bh=U4k9RPUxFXOEqfQwwBmtS2tGKpMPFKxtvLKJhSg3/z0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=B9LT3tj81WLljrap6eLCpZhZOX+qrH6KXoY51zk9mGxf9c3Z7krDI2nHE9N2GIuoEml1qJzHOLmj45kUEK4mJMRKK5v7vYLkWaQmMiFF6wdP9xwvAy3ohbc5V6i6/2mgrO+qxIsuR+hkF4Qeak9zkXTfyYP4l2ygpZT/wDNXT+E= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1706520029; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=dFM1pbgQC5dwSMOK/4WHzgL2+5dEOJs2GgXRyqEn+yw=; b=ZthNpKg1kHPKDlz66UqWZsC/bhtJ0+9eDlG4pTNMI7zOtZ1h2n3dEmHZlqOas7bVq5S6BmCFOOB82t/mJ3fpwz7WojsnNXD8JoNmmK3I+tWThXxisFkC4Q0u+73zD9gF51rJ2sDYVMlUXI2q8MIX5sf6/z27Ph1Z2WyjpbcslNE= X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R151e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018045192; MF=jinma@linux.alibaba.com; NM=1; PH=DS; RN=10; SR=0; TI=SMTPD_---0W.Ziigt_1706520025; Received: from localhost.localdomain(mailfrom:jinma@linux.alibaba.com fp:SMTPD_---0W.Ziigt_1706520025) by smtp.aliyun-inc.com; Mon, 29 Jan 2024 17:20:27 +0800 From: Jin Ma To: gcc-patches@gcc.gnu.org Cc: jeffreyalaw@gmail.com, palmer@dabbelt.com, richard.sandiford@arm.com, kito.cheng@gmail.com, christoph.muellner@vrull.eu, rdapp.gcc@gmail.com, juzhe.zhong@rivai.ai, jinma.contrib@gmail.com, Jin Ma Subject: [PATCH] RISC-V: THEAD: Fix improper immediate value for MODIFY_DISP instruction on 32-bit systems. Date: Mon, 29 Jan 2024 17:20:16 +0800 Message-Id: <20240129092016.1176-1-jinma@linux.alibaba.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Spam-Status: No, score=-29.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org When using '%ld' to print 'long long int' variable, 'fprintf' will produce messy output on a 32-bit system, in an incorrect instruction being generated, such as 'th.lwib a1,(a0),-16,4294967295'. And the following error occurred during compilation: Assembler messages: Error: improper immediate value (18446744073709551615) gcc/ChangeLog: * config/riscv/thead.cc (th_print_operand_address): Change %ld to %lld. --- gcc/config/riscv/thead.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/riscv/thead.cc b/gcc/config/riscv/thead.cc index 2955bc5f8a9..9ee6444b627 100644 --- a/gcc/config/riscv/thead.cc +++ b/gcc/config/riscv/thead.cc @@ -1141,7 +1141,7 @@ th_print_operand_address (FILE *file, machine_mode mode, rtx x) return true; case ADDRESS_REG_WB: - fprintf (file, "(%s),%ld,%u", reg_names[REGNO (addr.reg)], + fprintf (file, "(%s),%lld,%u", reg_names[REGNO (addr.reg)], INTVAL (addr.offset) >> addr.shift, addr.shift); return true;