Report on IA64 C++ ABI

Christophe de Dinechin ddd at cup.hp.com
Fri Jul 2 21:35:01 UTC 1999


Cary,


Thank you for that comment. Do you think of other issues in the  
issue list that might be covered like this? Can you confirm that  
makingj a copy in registers (as for C objects) is also in the spirit  
of the C ABI? In particular, do you agree with the current proposal  
of passing empty structs with no ctor in zero slots.


Thank you
Christophe


Begin forwarded message:

> From: Cary Coutant <cary at cup.hp.com>
>
> >- How do we pass arguments that are extensons to C structs, but  
are not
> >covered by the C ABI: empty structs, structs with copy constructors, 
> >structs with a vptr. The agreement seems to be that the copy  
constructor
> >is the only real problem. When it's there, we don't use the C ABI  
at all
> >but pass a 'this' pointer. When there is none, we just copy the object 
> >in registers (as we would for a C object) and pass it in  
registers,even
> >if there is a vptr. Note that a memory to memory copy would go  
into the
> >registers first anyway, so this is always a good idea to pass a struct 
> >in registers when you want to copy it.
>
> This is already addressed in the common conventions document. From  
> Section 9.6:
>
> >Any object that requires a copy constructor must be passed by
> >copy-reference rather than by value (that is, the compiler must  
copy it to
> >a temporary location in memory and pass the address of this  
location in
> >the argument list). This guarantees that the object will have a valid  
> >memory address as required by the copy constructur. The temporary  
location
> >should be in the caller's memory stack frame.
>
>
> -cary
>
>




More information about the cxx-abi-dev mailing list