From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26877 invoked by alias); 2 Jun 2002 19:24:18 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 26861 invoked from network); 2 Jun 2002 19:24:15 -0000 Received: from unknown (HELO egil.codesourcery.com) (66.92.14.122) by sources.redhat.com with SMTP; 2 Jun 2002 19:24:15 -0000 Received: from zack by egil.codesourcery.com with local (Exim 3.35 #1 (Debian)) id 17EaxQ-0005I1-00; Sun, 02 Jun 2002 12:24:04 -0700 Date: Sun, 02 Jun 2002 12:24:00 -0000 To: Jason R Thorpe , Andrew Cagney , Michael Elizabeth Chastain , gdb-patches@sources.redhat.com, gcc@gcc.gnu.org Subject: Re: [rfa:ppc] Fix PPC/NBSD struct return; Was: userdef.exp regression for ppc? Message-ID: <20020602192404.GA19552@codesourcery.com> References: <200206011546.g51FkMj30586@duracef.shout.net> <3CF902B0.50405@cygnus.com> <20020602115105.E27682@dr-evil.shagadelic.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020602115105.E27682@dr-evil.shagadelic.org> User-Agent: Mutt/1.3.28i From: Zack Weinberg X-SW-Source: 2002-06/txt/msg00031.txt.bz2 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