This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: New C++ ABI and -freg-struct-return?
- To: Ralph Loader <suckfish at ihug dot co dot nz>
- Subject: Re: New C++ ABI and -freg-struct-return?
- From: Jamie Lokier <egcs at tantalophile dot demon dot co dot uk>
- Date: Thu, 22 Jun 2000 14:20:33 +0200
- Cc: gcc at gcc dot gnu dot org
- References: <14673.54367.770323.938277@sucky.fish>
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