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]
Other format: [Raw text]

Re: mutually-recursive types and an old puzzle


Nathan Sidwell <nathan@codesourcery.com> writes:

> Joe Buck wrote:
>
>> Then this would not prevent STL iterators from being returned in
>> registers, as they don't have destructors and they don't have non-trivial
>> copy constructors (when not in debug mode).  But neither did my FsmState
>> example, and Zack says it can't be returned in a register.  So what gives?
>> In both cases, the iterator is generally a one-field object, where the one
>> field is a pointer; the copy constructor is the default one that just
>> copies the fields, and there is no destructor.
> In the FSM example, I'm not sure why Zack says it can't be returned in
> a register.  And given what you say about iterators, I don't see
> why they can't be either (modulo underlying CABI restrictions).

Zack was mistaken; it is returned in a register on e.g. powerpc.  I
had misremembered the requirements of the C++ ABI.  It is *not*
returned in a register on x86 but that is, as Gaby says, down to the
psABI.

zw


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