diff options
author | Jason Thorpe <thorpej@wasabisystems.com> | 2002-09-05 17:11:47 +0000 |
---|---|---|
committer | Jason Thorpe <thorpej@gcc.gnu.org> | 2002-09-05 17:11:47 +0000 |
commit | dc0ba55a5b813f1f91ca6d472d70de3021e8be9e (patch) | |
tree | 0c7617f2763292e8f72c2f38843a0ca80d8b2964 | |
parent | b5b620a4e85314de0ee24d004f2192193d28fe46 (diff) | |
download | gcc-dc0ba55a5b813f1f91ca6d472d70de3021e8be9e.zip gcc-dc0ba55a5b813f1f91ca6d472d70de3021e8be9e.tar.gz gcc-dc0ba55a5b813f1f91ca6d472d70de3021e8be9e.tar.bz2 |
arm.c (arm_return_in_memory): Implement ATPCS return-in-memory rules.
* 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
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 13 | ||||
-rw-r--r-- | gcc/config/arm/arm.h | 4 |
3 files changed, 22 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a3ec8a0..7085036 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 336f182..93c571d 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -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) diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 5865472..ce1961d 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -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) |