This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g++/i386: 4-byte inline struct return
- To: hasdi at umich dot edu (Hasdi R Hashim)
- Subject: Re: g++/i386: 4-byte inline struct return
- From: Joe Buck <jbuck at synopsys dot com>
- Date: Thu, 17 Sep 98 12:54:25 PDT
- Cc: amylaar at cygnus dot co dot uk, egcs at cygnus dot com
> On Thu, 17 Sep 1998, Joern Rennecke wrote:
> > This problem is ABI related. For instance, you will get better code for
> > i386-linuxaout that for i386-pc-linux-gnu.
> > Unless you use -freg-struct-return , but then, you can get problems with
> > library functions like inet_makeaddr.
>
> I'll try this when I get back home. I think gcc should return struct
> values in registers anyway (ignoring -fpcc-struct-return) if the caller
> and callee can follow the same struct-return convention (i.e. inline and
> static functions). Is there a fallacy in my thinking? I hope somebody more
> experience can tell me if this is easy to 'fix' in egcs.
Yes, it seems that if we know the caller and callee agree, then a more
efficient scheme can be used (e.g. for static functions). But there's the
matter of debugging; either this would break debugging or we'd have to
tell the debugger somehow that the normal rule isn't being followed.