This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] AAPCS complex value return [csl-arm-branch]


Hi,

This patch alters the ABI for functions returning complex values to conform with the ARM AAPCS. Previously, multi-word complex values were returned in registers. With this patch they are treated the same as multi-word aggregates, i.e. they are returned in memory at an address passed in through r0.

ABIs other than AAPCS shouldn't be affected.

This should be applied to both csl-arm-branch and mainline.

Cheers,

Julian

--
Julian Brown
CodeSourcery, LLC
Index: gcc/config/arm/arm.c
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.303.2.65
diff -c -p -r1.303.2.65 arm.c
*** gcc/config/arm/arm.c	18 Nov 2004 15:57:28 -0000	1.303.2.65
--- gcc/config/arm/arm.c	5 Jan 2005 17:09:51 -0000
*************** arm_return_in_memory (tree type)
*** 2280,2287 ****
  {
    HOST_WIDE_INT size;
  
!   if (!AGGREGATE_TYPE_P (type))
!     /* All simple types are returned in registers.  */
      return 0;
  
    size = int_size_in_bytes (type);
--- 2280,2289 ----
  {
    HOST_WIDE_INT size;
  
!   if (!AGGREGATE_TYPE_P (type) &&
!       !(TARGET_AAPCS_BASED && TREE_CODE (type) == COMPLEX_TYPE))
!     /* All simple types are returned in registers.
!        For AAPCS, complex types are treated the same as aggregates.  */
      return 0;
  
    size = int_size_in_bytes (type);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]