This is the mail archive of the
mailing list for the GCC project.
Re: [patch i386]: Expand sibling-tail-calls via accumulator register
- From: Jeff Law <law at redhat dot com>
- To: Kai Tietz <ktietz at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Henderson <rth at redhat dot com>
- Date: Fri, 23 May 2014 12:16:12 -0600
- Subject: Re: [patch i386]: Expand sibling-tail-calls via accumulator register
- Authentication-results: sourceware.org; auth=none
- References: <356718653 dot 5712706 dot 1400794422397 dot JavaMail dot zimbra at redhat dot com>
On 05/22/14 15:33, Kai Tietz wrote:
I'm generally not a fan of explicitly mentioning hard registers in RTL.
Though most of the major problems related to doing that have been
resolved through the years.
This patch avoids for sibling-tail-calls the use of pseudo-register.
Instead it uses for load of memory-address the accumulator-register.
By this we avoid that IRA/LRA need to choose a register. So we
The accumulator-register is always a valid register on tail-call
case. All other registers might be callee-saved, or used for
argument-passing. The only case where we would use the accumulator
on call is the variadic-case for x86_64 ABI. Just that this function
never is a candidate for sibling-tail-calls.
2014-05-22 Kai Tietz <firstname.lastname@example.org>
* config/i386/i386.c (ix86_expand_call): Enforce for sibcalls on
memory the use of accumulator-register.
In the interest of defensive programming, can you verify that fnaddr
doesn't refer to a varardic function? Hmm, I guess we can't get to a
signature here. So, never mind.
Regression tested for x86_64-unknown-linux-gnu, x86_64-w64-mingw32,
and i686-pc-cygwin. Ok for apply?
So I think the way to go is to ensure that the x86 port always rejects
sibcalls to a varardic target, which I think can be done in
With that change this patch should be OK. But please post it one more
time for a final review.