From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29211 invoked by alias); 26 Sep 2002 19:54:23 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 29127 invoked from network); 26 Sep 2002 19:54:22 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 26 Sep 2002 19:54:22 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 95A153DC7; Thu, 26 Sep 2002 15:54:23 -0400 (EDT) Message-ID: <3D9365EF.3060904@redhat.com> Date: Thu, 26 Sep 2002 12:54:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Elena Zannoni Cc: "Clarke, Stephen" , gdb@sources.redhat.com Subject: Re: sh4 abi doc References: <287E4644B5249D449C56FA5409A874AE03EFBB@sh-us-ex01.us.w2k.superh.com> <15763.25405.302193.215110@localhost.redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00447.txt.bz2 > Clarke, Stephen writes: > > > From: Elena Zannoni [mailto:ezannoni@redhat.com] > > > Sent: Thursday, September 26, 2002 10:43 AM > > > > > > The cutoff is 8 bytes. > > > > Yes: anything bigger than 8 bytes is definitely > > returned in memory. > > > > But the cutoff is not "clean", because structs smaller > > than this could also be returned in memory, if they > > don't pass the "same size and alignment as an integer > > type" rule. > > > > For example, in > > > > struct s { char c[3]; } wibble; > > struct s foo(void) { return wibble; } > > > > the return value from foo() will be in memory, not > > in R0, because there is no 3-byte integer type. > > > > Sorry if that was obvious already, I just wanted to > > be sure. > > > > Steve. > > > Very helpful. I hadn't noticed this variant, indeed. Ah, the ``gcc struct return'' rule. Perhaphs we need a generic function that specifies this. enjoy, Andrew