From patchwork Fri Apr 28 06:12:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_M=C3=BCllner?= X-Patchwork-Id: 88453 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp728828vqo; Thu, 27 Apr 2023 23:15:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7iwfxc2KUSDNJ3E15n4Xph/DZpFXFn//gm4mxUC3VfCPwgy9dhYBcaYwFfaIkMrJPb4Dd4 X-Received: by 2002:a17:907:360b:b0:959:c6cb:9fc8 with SMTP id bk11-20020a170907360b00b00959c6cb9fc8mr4140073ejc.29.1682662556507; Thu, 27 Apr 2023 23:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682662556; cv=none; d=google.com; s=arc-20160816; b=EHgCBJQxm2ZEnhsvN8qgCOjH8lGzFfrGvdNPWuZSO3O9gOSTXT45uy3nvgcY8MmVgB qI8TPck04SiGxTreeUuB2R7SPG0nJ1hscKAc/asF4IHWkpnoEWHHuPEjsVemG3fOtoez S8/YbJUoBfKvIjA4T9eCCixTwKGhLFCWZq1INHm6g37vcopjfZfKDJKBlhbOvL/13mka 2NloDT40wwymfrCSK5hYCL9kO7Vvi4hlomxobGQ4v8SUhlmbmgTGBb4mSjKvqUKCgtSj QCO8Eta+WSXGUOgNWqKcojE5TrRh4uh0VLBvIezAtxLOSjTFYC9mM0v3v+L6jFWsb0PB d9zw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=ohp0gfELIvykSXFEyot2xr0UlJwfpKLVOzaa1pyLhhk=; b=Yse1M3OEJFb3O10nhK9NXKwBcOXiKG8Sq8Cnwi0eP46UkvpY5Nk+qMjfEtpd/oEIu7 HHslRdmCEHc6FsdOrLvOkCrLOm5JdhlZ//0WiXKXBJaIILuxHD/gkPtVUDoH8OTjGZfX SXum1qiR3o4EcgrFsGuFiOh9eAILd/qrOxAyTiJ9KdDgJoSO6aALAtc1Qav0oXSWgusy 8PrX//XhD0AHUDvamkMIUnOHokI3+lbiFF3dfG5xSaIMPJq46s1KZcjybkJY5UToD9Wr 2ia22FYV58tN7V4j5bkBEfoiVUgXyIDtq4v4s9mIH1XDJg3uxRQJ9Ma4zwW6kCfpdf0A H7Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=M6p5PQ2R; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id p18-20020a05640210d200b00506a7d9c0fdsi15911506edu.133.2023.04.27.23.15.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 23:15:56 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=M6p5PQ2R; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 68610388552F for ; Fri, 28 Apr 2023 06:13:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id B6DC63858C52 for ; Fri, 28 Apr 2023 06:12:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B6DC63858C52 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5068e99960fso16367558a12.1 for ; Thu, 27 Apr 2023 23:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1682662337; x=1685254337; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ohp0gfELIvykSXFEyot2xr0UlJwfpKLVOzaa1pyLhhk=; b=M6p5PQ2RLxJ/rXvZH0LhMoY1cS6GGxm+uLdauQVG/x2awThqSJh3v2jTbKeSTB90ui H9/rylKRV3/t4yY3nVDP2Ts3WrFLa7MofPQ1Nrd81/tZX4zdZ7//JDUIHCdX4c5l39Nt EoOvdqC57Vr8m2vbloJoViSiPl72jYT0VADNr1ggDUA0P+oHtWosPnQZHwRrL3gM7kOm WdS4qWbHOpC+6al38QZCWP/QATDdPa5KRJwQUvaK2s+MwxpniHHn4FztC1KKTfFeUni4 mxUyU2k7OWmxJCiZIXYl7kZ0lVGINuiuD7Q2QYJaLkOk3coaOJGXkenIErMO8v79FPuk Lh9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682662337; x=1685254337; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ohp0gfELIvykSXFEyot2xr0UlJwfpKLVOzaa1pyLhhk=; b=kqEI1Op4IEvrUCAi3jvCAnFegAiygUZHuLu1K8r7g6cLXpsq4P7KP+vYgr/TPaTvEm moCcYAv3vGml37vX9tAhlwXoFCovgcJ6ZDcNPL4WbpsR1HZyqPx1ah7vomswyN2JKLK0 F0fbKdPjfEbBW7SwQQa6S5/mPMQBxHh6PxtTPsCBLuIFGMfD0CUdVEKy2LAZVvyobyNf GfgZrRWxQ/HqzUnrPwLYJB8x3OC2cnRU6Af0kcVEyUjn2Ro1sotOnc4SDmVVKF6ne9U2 MDkQIsftdRjFQV3+3QotDEL4DShoR+2Pabue0XiLtd3f/ZgpwvBYncXpLZW0tqoO0lGt am2A== X-Gm-Message-State: AC+VfDxiWpHPREJWCUZEkN22S+RGaEN+yiBC2ohS3MHC7jIYaMvBbu22 0v5FMqrE6CZbPvNO6HkJ/82bFcdya6KbeyiutwY= X-Received: by 2002:a05:6402:10da:b0:502:1cae:8b11 with SMTP id p26-20020a05640210da00b005021cae8b11mr4101768edu.23.1682662336942; Thu, 27 Apr 2023 23:12:16 -0700 (PDT) Received: from beast.fritz.box (62-178-148-172.cable.dynamic.surfer.at. [62.178.148.172]) by smtp.gmail.com with ESMTPSA id x20-20020aa7d394000000b00504803f4071sm8669431edq.44.2023.04.27.23.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 23:12:16 -0700 (PDT) From: Christoph Muellner To: gcc-patches@gcc.gnu.org, Kito Cheng , Jim Wilson , Palmer Dabbelt , Andrew Waterman , Philipp Tomsich , Cooper Qu , Lifang Xia , Yunhai Shang , Zhiwei Liu Cc: =?utf-8?q?Christoph_M=C3=BCllner?= Subject: [PATCH 02/11] riscv: xtheadmempair: Fix CFA reg notes Date: Fri, 28 Apr 2023 08:12:03 +0200 Message-Id: <20230428061210.2988035-3-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230428061210.2988035-1-christoph.muellner@vrull.eu> References: <20230428061210.2988035-1-christoph.muellner@vrull.eu> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_MANYTO, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764399572779924391?= X-GMAIL-MSGID: =?utf-8?q?1764399572779924391?= From: Christoph Müllner The current implementation triggers an assertion in dwarf2out_frame_debug_cfa_offset() under certain circumstances. The standard code uses REG_FRAME_RELATED_EXPR notes instead of REG_CFA_OFFSET notes when saving registers on the stack. So let's do this as well. gcc/ChangeLog: * config/riscv/thead.cc (th_mempair_save_regs): Emit REG_FRAME_RELATED_EXPR notes in prologue. Signed-off-by: Christoph Müllner --- gcc/config/riscv/thead.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/config/riscv/thead.cc b/gcc/config/riscv/thead.cc index 75203805310..d7e3cf80d9b 100644 --- a/gcc/config/riscv/thead.cc +++ b/gcc/config/riscv/thead.cc @@ -368,8 +368,12 @@ th_mempair_save_regs (rtx operands[4]) rtx set2 = gen_rtx_SET (operands[2], operands[3]); rtx insn = emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, set1, set2))); RTX_FRAME_RELATED_P (insn) = 1; - add_reg_note (insn, REG_CFA_OFFSET, copy_rtx (set1)); - add_reg_note (insn, REG_CFA_OFFSET, copy_rtx (set2)); + + REG_NOTES (insn) = alloc_EXPR_LIST (REG_FRAME_RELATED_EXPR, + copy_rtx (set1), REG_NOTES (insn)); + + REG_NOTES (insn) = alloc_EXPR_LIST (REG_FRAME_RELATED_EXPR, + copy_rtx (set2), REG_NOTES (insn)); } /* Similar like riscv_restore_reg, but restores two registers from memory