Re: [PATCH] alpha: don't delete a caller's gp reload after a call

Alan Modra <[email protected]>
Newsgroups gmane.comp.gnu.binutils
Message-ID <[email protected]>
On Fri, Aug 14, 2026 at 03:27:12PM -0400, Matt Turner wrote:
> Recovering the optimization needs proof that the callee returns with gp
> intact.  A callee containing no tail call, direct or indirect, always
> does, but establishing that requires scanning the target function here.

A scan can be avoided if the target function advertises that
information somehow, for example, via callee st_other bits.  Just
saying, I don't expect you to implement any such scheme.

> 	* elf64-alpha.c (elf64_alpha_relax_with_lituse): Don't turn the
> 	GPDISP ldah/lda pair into unops when the callee shares our gp.
> 
> ld/
> 	* testsuite/ld-alpha/relax-gpdisp.s: New test.
> 	* testsuite/ld-alpha/relax-gpdisp.d: New test.

OK.

-- 
Alan Modra
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.