This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch i386]: Expand sibling-tail-calls via accumulator register


On 05/22/14 15:33, Kai Tietz wrote:
Hello,

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
reduce register-pressure.

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.

ChangeLog

2014-05-22  Kai Tietz  <ktietz@redhat.com>

* config/i386/i386.c (ix86_expand_call): Enforce for sibcalls on
memory the use of accumulator-register.
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.



Regression tested for x86_64-unknown-linux-gnu, x86_64-w64-mingw32,
and i686-pc-cygwin. Ok for apply?
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.

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 ix86-function_ok_for_sibcall.

With that change this patch should be OK. But please post it one more time for a final review.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]