GR8 as a return value

Christophe de Dinechin ddd at cup.hp.com
Wed Sep 27 00:00:33 UTC 2000


Jim,


(I thought I had sent an e-mail on this topic a while back, but I can't find it)

You proposed a change to GR8 (instead of being an implicit "normal" parameter)
for the return value of objects with non-trivial copy constructors, allegedly to
make it similar to what C does. Do you mind backing-out that change?

Our back-end (and I suspect many others) would have to special-case GR8 to do
that, whereas whatever input argument was used before was seen by the back-end
as any regular pointer argument.

It also has a rather negative (if small) effect of performance. GR8 is very
volatile, and is being destroyed by any function call. So this forces you to
save it very early. On the other hand, something like GR32 which was used before
is callee-save (through the register-stack engine), so it doesn't need to be
saved until any time it is actually used to make the constructor call. For small
functions with no stack frame of its own, there are fairly common cases where
the register being used (GR32) would just "fall through".


Thanks
Christophe




More information about the cxx-abi-dev mailing list