This is the mail archive of the gcc@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: Work in progress: "Super Sib Calls"; opinions sought


On Tue, Sep 10, 2002 at 03:46:07PM +1000, Andreas Bauer wrote:
> ... but I do not see how
> I could possibly address indirect calls without making ARM maintainers
> (and others) unhappy.

The way you can make this work with the existing mechanism is to push
the "no indirect" check into every target's FUNCTION_OK_FOR_SIBCALL hook.
This, by itself, preserves the status quo.

Then, on a case-by-case basis, modify each target's sibcall patterns
(and if it doesn't have one, add it) such that there is a register
class available that is call-clobbered.

E.g. on i386, 

(define_insn "*sibcall_1"
  [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "s,c,d,a"))
	 (match_operand 1 "" ""))]
  "SIBLING_CALL_P (insn) && !TARGET_64BIT"
 ...


The four alternatives are "immediate", "ecx", "edx", and "eax";
the later three are the call clobbered registers.  This isn't
quite as good as having a ACD_REGS register class, but adding
too many register classes slows down the register allocator.

At which point you can remove the "no indirect" check from
FUNCTION_OK_FOR_SIBCALL.



r~


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