This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: mutually-recursive types and an old puzzle
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: Gabriel Dos Reis <gdr at acm dot org>
- Cc: Zack Weinberg <zack at codesourcery dot com>,Chris Lattner <sabre at nondot dot org>, gcc at gcc dot gnu dot org
- Date: Thu, 1 Jul 2004 09:11:39 -0700
- Subject: Re: mutually-recursive types and an old puzzle
- References: <Pine.LNX.4.44.0406291930070.1537-100000@nondot.org><32877.::ffff:128.194.146.36.1088556186.squirrel@webmail.nerim.net><20040629175356.A11677@synopsys.com><32929.::ffff:128.194.146.36.1088557164.squirrel@webmail.nerim.net><20040630122238.A23557@synopsys.com> <877jtox2ef.fsf@taltos.codesourcery.com> <32822.::ffff:24.250.169.187.1088649121.squirrel@webmail.nerim.net>
I wrote:
> >> Here's one, if anyone's curious. The class has one member, which is
> >> a function pointer; the operator() overload calls the function pointer.
Zack Weinberg wrote:
> > This works, but doesn't get optimized down to ideal code, mainly
> > because the ABI prevents FsmState from being returned in a register
> > (since it's not a POD structure).
On Thu, Jul 01, 2004 at 04:32:01AM +0200, Gabriel Dos Reis wrote:
> That happens only with broken psABIs like Sparc-v7 or x86.
> That has nothing to do with being a POD or not. The generic
> ABI requires passing the object on stack only if they
> have a non trivial copy-constructor or destructor. FsmState
> does have trivial copy constructor and destructor.
ABIs that don't allow most STL iterators to be returned in a register
are, IMHO, broken. Unfortunately, it appears that we are stuck with
some broken ABIs.