From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by sourceware.org (Postfix) with ESMTPS id 6234E3858D35 for ; Sun, 25 Jun 2023 01:43:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6234E3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=fastmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fastmail.com Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 20C9F32005BC; Sat, 24 Jun 2023 21:43:17 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Sat, 24 Jun 2023 21:43:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1687657396; x=1687743796; bh=9Z NaUYCjGGdBqrhOILY4jmE1vybKlSnxhWYDuYh86Ng=; b=CSo6frZioF2j/KL6v2 2OLCcddg+CYlXylZFw8Xvr8nxMD1jSxuJU02mzOsCINyvoipIiRX5ZsAaRDA/g2L gZxJHxwrkXMDH8RdgUHilB0lCVHMssbtuXAmEA/FPnvCKzoUingT8fKSSK4VPPby mfGc24XjrlcwCcTclkw4KUoj00kBUXFy2u89Ve8bomIEb1kEJkE3rz+NGMej4QTE Yro9HKQ9sV9MIDbvnkTfmHiW1ymjhK31yzaOvLdIXSeg6hieU0nqQ3ZaL8Tndi5n M/T1ZCQJBRw5akVq7ZG8ZRqtCg7sLkRDNd48PTTQCC4OCbi8xBY6/H8E31ESigcZ 7o5w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1687657396; x=1687743796; bh=9ZNaUYCjGGdBq rhOILY4jmE1vybKlSnxhWYDuYh86Ng=; b=E2ghxlG5GQClnSnXj7xToRcdySowh pmEP11wymmDgipvruam/7wDPElAeYHTkkwH8LP/iKqoXQO3dade9RO8Xvl3t7kgi TgD1ABCCGpkOmADOwR937/F7ZZTfaYieudSHUQeFSMagMI3e65cFfaC4IrrGjgjH jB4YtNhAifTMYLvHronq30kHvlEN7pv0CePuYwqTzR3ZtA6O9dUw9ZYQkjeetmJW XrnjWCAiGaae2J511QA5qX2WnJLa5VpLV+fszhe7uY4kzDnT1pqUZWzRZpnxkIsA /UPnVT6BSlY7M0Gf+c2Nz6QK6c7erZJtyN2YfZiys5NET4PkLLrn1qzGg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeegledgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedfufht vghfrghnucfqkdftvggrrhdfuceoshhorhgvrghrsehfrghsthhmrghilhdrtghomheqne cuggftrfgrthhtvghrnhepfedujedvjeduvdejjedukefgieekveevveeliedtvdetudej geejjefguefgiedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshhorhgvrghrsehfrghsthhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i84414492:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2B15C170009C; Sat, 24 Jun 2023 21:43:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-499-gf27bbf33e2-fm-20230619.001-gf27bbf33 Mime-Version: 1.0 Message-Id: <4024e3a5-a2d1-4a66-abb4-481ea15013ec@app.fastmail.com> In-Reply-To: <5b8d6f90-6668-84ac-53dc-5c5272d179ef@gmail.com> References: <20230602070726.3807539-1-yanzhang.wang@intel.com> <7fb7d7d5-0e9a-d8b8-5dc6-7db946e67a00@gmail.com> <5b8d6f90-6668-84ac-53dc-5c5272d179ef@gmail.com> Date: Sat, 24 Jun 2023 21:40:46 -0400 From: "Stefan O'Rear" To: "Jeff Law" , "Wang, Yanzhang" , "gcc-patches@gcc.gnu.org" Cc: "juzhe.zhong@rivai.ai" , "kito.cheng@sifive.com" , "Li, Pan2" Subject: Re: [PATCH] RISCV: Add -m(no)-omit-leaf-frame-pointer support. Content-Type: text/plain X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,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 List-Id: On Sat, Jun 24, 2023, at 11:01 AM, Jeff Law via Gcc-patches wrote: > On 6/21/23 02:14, Wang, Yanzhang wrote: >> Hi Jeff, sorry for the late reply. >> >>> The long branch handling is done at the assembler level. So the clobbering >>> of $ra isn't visible to the compiler. Thus the compiler has to be >>> extremely careful to not hold values in $ra because the assembler may >>> clobber $ra. >> >> If assembler will modify the $ra behavior, it seems the rules we defined in >> the riscv.cc will be ignored. For example, the $ra saving generated by this >> patch may be modified by the assmebler and all others depends on it will be >> wrong. So implementing the long jump in the compiler is better. > Basically correct. The assembler potentially clobbers $ra. That's why > in the long jump patches $ra becomes a fixed register -- the compiler > doesn't know when it's clobbered by the assembler. > > Even if this were done in the compiler, we'd still have to do something > special with $ra. The point at which decisions about register > allocation and such are made is before the point where we know the final > positions of jumps/labels. It's a classic problem in GCC's design. Do you have a reference for more information on the long jump patches? I'm particularly curious about why $ra was selected as the temporary instead of $t1 like the tail pseudoinstruction uses. -s