]> gcc.gnu.org Git - gcc.git/commitdiff
arm.c (arm_return_in_memory): Implement ATPCS return-in-memory rules.
authorJason Thorpe <thorpej@wasabisystems.com>
Thu, 5 Sep 2002 17:11:47 +0000 (17:11 +0000)
committerJason Thorpe <thorpej@gcc.gnu.org>
Thu, 5 Sep 2002 17:11:47 +0000 (17:11 +0000)
* config/arm/arm.c (arm_return_in_memory): Implement ATPCS
return-in-memory rules.
* config/arm/arm.h (ARM_FLAG_ATPCS, TARGET_ATPCS): Define.

From-SVN: r56858

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/config/arm/arm.h

index a3ec8a0d4a2c4aadbd51d3c140517e47e8eb1259..708503640b9feb5932f127b11b590bfd62cc1562 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-05  Jason Thorpe  <thorpej@wasabisystems.com>
+
+       * config/arm/arm.c (arm_return_in_memory): Implement ATPCS
+       return-in-memory rules. 
+       * config/arm/arm.h (ARM_FLAG_ATPCS, TARGET_ATPCS): Define.
+
 2002-09-05  David Edelsohn  <edelsohn@gnu.org>
 
        * config/rs6000/xcoff.h (HOT_TEXT_SECTION_NAME): Delete.
index 336f1821bd278ff4483b9b87e7307de89d038069..93c571dd534595a4da1977f2d2cd6d8c54bf0c66 100644 (file)
@@ -1756,9 +1756,20 @@ int
 arm_return_in_memory (type)
      tree type;
 {
+  HOST_WIDE_INT size;
+
   if (!AGGREGATE_TYPE_P (type))
     /* All simple types are returned in registers.  */
     return 0;
+
+  size = int_size_in_bytes (type);
+
+  if (TARGET_ATPCS)
+    {
+      /* ATPCS returns aggregate types in memory only if they are
+        larger than a word (or are variable size).  */
+      return (size < 0 || size > UNITS_PER_WORD);
+    }
   
   /* For the arm-wince targets we choose to be compitable with Microsoft's
      ARM and Thumb compilers, which always return aggregates in memory.  */
@@ -1767,7 +1778,7 @@ arm_return_in_memory (type)
      Also catch the case where int_size_in_bytes returns -1.  In this case
      the aggregate is either huge or of varaible size, and in either case
      we will want to return it via memory and not in a register.  */
-  if (((unsigned int) int_size_in_bytes (type)) > UNITS_PER_WORD)
+  if (size < 0 || size > UNITS_PER_WORD)
     return 1;
   
   if (TREE_CODE (type) == RECORD_TYPE)
index 58654729884bac4e2c14cdf8559d010ebb7b72b3..ce1961ddf057db4a3f7db51ab11b629df54aa8f8 100644 (file)
@@ -373,6 +373,9 @@ Unrecognized value in TARGET_CPU_DEFAULT.
 /* Nonzero means target uses VFP FP.  */
 #define ARM_FLAG_VFP           (1 << 21)
 
+/* Nonzero means to use ARM/Thumb Procedure Call Standard conventions.  */
+#define ARM_FLAG_ATPCS         (1 << 22)
+
 #define TARGET_APCS_FRAME              (target_flags & ARM_FLAG_APCS_FRAME)
 #define TARGET_POKE_FUNCTION_NAME      (target_flags & ARM_FLAG_POKE)
 #define TARGET_FPE                     (target_flags & ARM_FLAG_FPE)
@@ -380,6 +383,7 @@ Unrecognized value in TARGET_CPU_DEFAULT.
 #define TARGET_APCS_STACK              (target_flags & ARM_FLAG_APCS_STACK)
 #define TARGET_APCS_FLOAT              (target_flags & ARM_FLAG_APCS_FLOAT)
 #define TARGET_APCS_REENT              (target_flags & ARM_FLAG_APCS_REENT)
+#define TARGET_ATPCS                   (target_flags & ARM_FLAG_ATPCS)
 #define TARGET_MMU_TRAPS               (target_flags & ARM_FLAG_MMU_TRAPS)
 #define TARGET_SOFT_FLOAT              (target_flags & ARM_FLAG_SOFT_FLOAT)
 #define TARGET_HARD_FLOAT              (! TARGET_SOFT_FLOAT)
This page took 0.102896 seconds and 5 git commands to generate.