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]

Re: New C++ ABI and -freg-struct-return?


Ralph Loader wrote:
> This would make some common C++ coding styles, such as smart pointer
> classes (and less common ones, like my GF(2^n) calculator :-) ), have
> less overhead.

As well as the style where a class contains a single integer or float...

> There is a 'minor' complication - we wouldn't want to break
> compatibility between C++ and C - so the rule would have to be
> something like:
> 
>    if a class (or struct) has a method (or is otherwise not a C
>    datatype), and fits into a register, then it is returned in a
>    register.

Another idea with more flexibility is a per-struct/class type attribute
that says whether to use a register or not.  It should be inherited of
course.

-- Jamie

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