Subject: EGCS and structure returns
To: Todd Vierling <tv@pobox.com>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm32
Date: 10/31/1998 18:08:54
This is a multipart MIME message.

--==_Exmh_-11436611300
Content-Type: text/plain; charset=us-ascii

Todd,

I've finally had a chance to look at the structure returning issue in EGCS 
(sorry it took so long, it's been a bad week).

Basically, the most important change in EGCS and gcc-2.8 (as far as NetBSD 
is concered) was to go from PCC structure returning conventions to ANSI 
style structure returning conventions.  Therefore, full userland library 
compatibility can be restored by reverting the compiler to using PCC 
structure returning conventions -- this is simply a matter of adding

#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 1

to arm/netbsd.h after the inclusion of the a.out and arm definition files.

This leaves only the handling of code which is specially compiled with 
-freg-struct-return, which to my knowledge is only softfloat.c in the C 
library.

Given the above, I'm now inclined not to re-add the old structure 
returning convention as a md flag to the C compiler since it doesn't 
really buy us anything; however, as a work-around for now, I would suggest 
you also undef RETURN_IN_MEMORY in arm/netbsd.h.  Longer term, I think we 
should investigate adding the special return-in-regs attribute I was 
discussing before so that we can eliminate the undef of RETURN_IN_MEMORY, 
but that is not important at the moment.

Richard.

Sat Oct 31 18:08:37 1998  Richard Earnshaw (rearnsha@arm.com)

	* arm/netbsd.h (DEFAULT_PCC_STRUCT_RETURN): Override default ARM 
	value.
	(RETURN_IN_MEMORY): Be compatible with previous releases for NetBSD.



--==_Exmh_-11436611300
Content-Type: application/x-patch ; name="st-ret.patch"
Content-Description: st-ret.patch
Content-Disposition: attachment; filename="st-ret.patch"

Index: netbsd.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/arm/netbsd.h,v
retrieving revision 1.4.2.1
diff -p -r1.4.2.1 netbsd.h
*** netbsd.h	1998/08/14 00:28:17	1.4.2.1
--- netbsd.h	1998/10/31 18:00:10
*************** the Free Software Foundation, 675 Mass A
*** 116,121 ****
--- 116,130 ----
  #undef TYPE_OPERAND_FMT
  #define TYPE_OPERAND_FMT "%%%s"
  
+ /* NetBSD uses the old PCC style aggregate returning conventions. */
+ #undef DEFAULT_PCC_STRUCT_RETURN
+ #define DEFAULT_PCC_STRUCT_RETURN 1
+ 
+ /* Although not normally relevant (since by default, all aggregates
+    are returned in memory, compiling some parts of libc requires
+    non-APCS style struct returns.  */
+ #undef RETURN_IN_MEMORY
+ 
  /* VERY BIG NOTE : Change of structure alignment for RiscBSD.
     There are consequences you should be aware of...
  

--==_Exmh_-11436611300--