On Mon, Oct 17, 2011 at 02:57, Richard Guenther <richard.guent...@gmail.com> > It would simply be an alternate ABI that makes all registers callee-saved? > I suppose that would be not too hard to add.
That would be great. There are quite a few interfaces which have a trivial normal case and only in special situations you need something more. These interfaces could be translated into: retval fct(sometype arg) { return cond ? somevalue : complexfct(); } These would be candidates for this new ABI. The compiler might have to do minimal spilling to implement the 'cond' expression but the new ABI would be used unwise if this is expensive. Note that I would want registers used for passing parameters to also be preserved (except, of course, when they are needed for the return value). This proved really useful in the kernel syscall interface which behaves like that.