From patchwork Tue Jul 18 07:42:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lehua Ding X-Patchwork-Id: 121830 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1570862vqt; Tue, 18 Jul 2023 00:44:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlGinJQK+SF6UCWV+5b8EakXW89mCRF7esJ0SPZpOuPLuhzA37AFgMV6rGTen6P96oMtTcr1 X-Received: by 2002:aa7:d64c:0:b0:51b:ebd7:641a with SMTP id v12-20020aa7d64c000000b0051bebd7641amr12852119edr.7.1689666254445; Tue, 18 Jul 2023 00:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689666254; cv=none; d=google.com; s=arc-20160816; b=rmZbfAkuqBYRiY8HTWrcX2xZ/ZLKs4ULkPii0Y9veEow7AwMR4IZ4ooCDHCNlPpflS COFR86VDbka+jHRRaRdIxQ9gQlUOJvdDanzmTpoQZaP5iPG/EE+yvUb3kkrGNd1O1ZM/ /3smQeD2m9yw71g8z3NLi2Zr0My6/kV9OoO6nquKVek0i1/8pNIAtR9Yi+1to4MO4Vu2 MT/pweqFDuiqr4Hod11G7duGi/Q0Lp2EM8Um9TaYz6kRoPQYCYqnvHfLN3SGthmyj9Du AwrRToiAe1iB9492x4Zv8RDNP5KGmaLcRylHXoz00AFhWlL/dc4PmYxkQaxn5ONQnPut YFfg== 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:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dmarc-filter:delivered-to; bh=/xKxyMu1DUoS+ZRc6Ntogx7HT4obY/WSuhlCErxjddE=; fh=gTyau+cNmEmsMakPG5hn1BgV9dZ8F3BLCRVmJIys8DA=; b=aWPzQ8G6zOTv9eT4TctXZ8E96YGY293z/m4dGZsmsZZCOpwjhDNd4dcNavcbLEhasr qNKgDdYo7n9FUstwuu8+dPcd9X2rVPgayITVr81+71Za6sKQQ4s0MLtOBzBIR2QU+9/Z eG+JJNKUz6wGMZj1FVem4Wz0z2b3YWIh2ICoSCCtB4Rc9ywHyWS0YNLBcwzd3nxH3qRy Gy4pU3xjIwNxgCt0TloBWy2QI812RsI9boPHWqSKHhWdLW7zhBcn58ZP9/M2u2D/i9QY OlRjZHlnfUyUdI+pWxN83xNU9X4H6c8Vss4gfgiHciC50NCFRiWJakbEOXxA6e3GKNix MKJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id e2-20020a056402148200b0051e3c92a1f9si807873edv.675.2023.07.18.00.44.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 00:44:14 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 275AA385C6DD for ; Tue, 18 Jul 2023 07:43:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) by sourceware.org (Postfix) with ESMTPS id 1869D38582A1 for ; Tue, 18 Jul 2023 07:42:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1869D38582A1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp84t1689666170tjal16oq Received: from server1.localdomain ( [58.60.1.22]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 18 Jul 2023 15:42:49 +0800 (CST) X-QQ-SSF: 01400000000000B0F000000A0000000 X-QQ-FEAT: y0qVOEbMWtdD7V7UhsKV0AeHs8dnCthhzREIPSZ6eUmTvsQxJON9UL/6D2Q5t M2LQIAMPfdRGKIPKWFyCejcpJiJpl7K5Rd9xKfDxKizoeGZ1gbvBebLHZiRMPE1P4VlmkGR j2EnwAueUI/pRG4mr46vPsjW7V1AQgv5ZUxp9/pHx5SpdOANy9Az3fdxqkhIR581UErFKf9 J/ebR8T1TB6xpGDNoXSt9rlW6TAQoJ7+75S/TL754tXnPFawlk5m6q6V6QpMnO+RP1bgvks +x5OHt/bBUjvVmVYoNxQQRpDthJdzUnr3ziTCZE2oZtM/c+m9BbffbG/O2OyWqG+oprd9l+ /cN1cLRuoqPxz3d6M2kQjJfBJlv7GRQZS89OYMdyWm/KBwzn1R46Y7y5q05HMJ7JFqXIviz X-QQ-GoodBg: 2 X-BIZMAIL-ID: 11176714498835685664 From: Lehua Ding To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, rdapp.gcc@gmail.com, kito.cheng@gmail.com, palmer@rivosinc.com, jeffreyalaw@gmail.com Subject: [PATCH] RISC-V: Fix testcase failed when default -mcmodel=medany Date: Tue, 18 Jul 2023 15:42:49 +0800 Message-Id: <20230718074249.236825-1-lehua.ding@rivai.ai> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz6a-0 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771743482322322946 X-GMAIL-MSGID: 1771743482322322946 Hi, This patch fix testcase failed when I build RISC-V GCC with -mcmodel=medany as default. If set to medany, stack_save_restore.c testcase will fail because of the reduced use of s3 registers in assembly (thus calling __riscv_save/store_3 instead of __riscv_save/store_4). Explicitly add -mcmodel=medlow to solve this problem. Best, Lehua gcc/testsuite/ChangeLog: * gcc.target/riscv/stack_save_restore.c: Add -mcmodel=medlow --- gcc/testsuite/gcc.target/riscv/stack_save_restore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/riscv/stack_save_restore.c b/gcc/testsuite/gcc.target/riscv/stack_save_restore.c index 522e706cfbf..a2430783474 100644 --- a/gcc/testsuite/gcc.target/riscv/stack_save_restore.c +++ b/gcc/testsuite/gcc.target/riscv/stack_save_restore.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-march=rv32imafc -mabi=ilp32f -msave-restore -O2 -fno-schedule-insns -fno-schedule-insns2 -fno-unroll-loops -fno-peel-loops -fno-lto" } */ +/* { dg-options "-march=rv32imafc -mabi=ilp32f -msave-restore -O2 -fno-schedule-insns -fno-schedule-insns2 -fno-unroll-loops -fno-peel-loops -fno-lto -mcmodel=medlow" } */ /* { dg-final { check-function-bodies "**" "" } } */ char my_getchar();