Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Zack Weinberg <zack@codesourcery.com>
To: Jason R Thorpe <thorpej@wasabisystems.com>,
	Andrew Cagney <ac131313@cygnus.com>,
	Michael Elizabeth Chastain <mec@shout.net>,
	gdb-patches@sources.redhat.com, gcc@gcc.gnu.org
Subject: Re: [rfa:ppc] Fix PPC/NBSD struct return; Was: userdef.exp regression for ppc?
Date: Sun, 02 Jun 2002 12:24:00 -0000	[thread overview]
Message-ID: <20020602192404.GA19552@codesourcery.com> (raw)
In-Reply-To: <20020602115105.E27682@dr-evil.shagadelic.org>

On Sun, Jun 02, 2002 at 11:51:05AM -0700, Jason R Thorpe wrote:
> On Sat, Jun 01, 2002 at 01:21:52PM -0400, Andrew Cagney wrote:
> 
>  > Yep!  The attached fixes it.  Looks like PPC/NetBSD's custom GCC has a 
>  > fixed struct return (I'm pretty sure that mainline GCC is broken).
> 
> Hmmmmm, both our 2.91 and 2.95 based compilers use:
> 
> #define RETURN_IN_MEMORY(TYPE)                                          \
>   (TYPE_MODE (TYPE) == BLKmode                                          \
>      && (DEFAULT_ABI != ABI_SOLARIS || int_size_in_bytes (TYPE) > 8))
> 
> ...and don't override this anywhere.  The DEFAULT_ABI ends up as ABI_V4,
> and not ABI_SOLARIS, so we definitely should be using the AIX structure
> return convention there.
> 
> However, the following:
[...]
> ...does indeed produce code that appears to follow the SVR4 ABI rules:
[...]
> AHA!  I see why.  In the 2.91 and 2.95 compilers, config/netbsd.h
> defines DEFAULT_PCC_STRUCT_RETURN to 0, which causes GCC's
> aggregate_value_p() to effecively give the SVR4 ABI semantics.
> 
> Yes, gcc 3.1 and gcc-current are definitely broken in this regard for
> NetBSD, then (I haven't had a chance to do much gcc work on powerpc-netbsd,
> but I'm obviously going to have to pay a bit more attention to it now).

I'm a little confused here.  Are you saying that the 2.9x native GCC
for NetBSD followed the SVR4 spec, returning small structures in
registers, but 3.1 and -current don't (because I incorrectly thought
the earlier compilers used the AIX convention)?  If so, the fix should
be as simple as removing the

/* For backward compatibility, we must continue to use the AIX
   structure return convention.  */
#undef DRAFT_V4_STRUCT_RET
#define DRAFT_V4_STRUCT_RET 1

from gcc/config/rs6000/netbsd.h...

zw


  reply	other threads:[~2002-06-02 19:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-01  8:46 Michael Elizabeth Chastain
2002-06-01 10:21 ` [rfa:ppc] Fix PPC/NBSD struct return; Was: " Andrew Cagney
2002-06-01 15:03   ` Jason R Thorpe
2002-06-02 11:15   ` Jason R Thorpe
2002-06-02 11:51   ` Jason R Thorpe
2002-06-02 12:24     ` Zack Weinberg [this message]
2002-06-02 13:29   ` Jason R Thorpe
2002-06-03  6:13     ` Andrew Cagney
2002-06-03 11:30 ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020602192404.GA19552@codesourcery.com \
    --to=zack@codesourcery.com \
    --cc=ac131313@cygnus.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec@shout.net \
    --cc=thorpej@wasabisystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox