Index: config/arm/arm.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v retrieving revision 1.223 diff -c -r1.223 arm.c *** config/arm/arm.c 21 Aug 2002 02:41:45 -0000 1.223 --- config/arm/arm.c 30 Aug 2002 21:52:13 -0000 *************** *** 1756,1764 **** --- 1756,1775 ---- 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,1773 **** 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) return 1; if (TREE_CODE (type) == RECORD_TYPE) --- 1778,1784 ---- 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 (size < 0 || size > UNITS_PER_WORD) return 1; if (TREE_CODE (type) == RECORD_TYPE) Index: config/arm/arm.h =================================================================== RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.h,v retrieving revision 1.155 diff -c -r1.155 arm.h *** config/arm/arm.h 8 Aug 2002 11:08:34 -0000 1.155 --- config/arm/arm.h 30 Aug 2002 21:52:16 -0000 *************** *** 365,370 **** --- 370,381 ---- destination is non-Thumb aware. */ #define THUMB_FLAG_CALLER_SUPER_INTERWORKING (1 << 20) /* 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) *************** *** 372,380 **** --- 383,393 ---- #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) #define TARGET_VFP (target_flags & ARM_FLAG_VFP) #define TARGET_BIG_END (target_flags & ARM_FLAG_BIG_END) #define TARGET_INTERWORK (target_flags & ARM_FLAG_INTERWORK) #define TARGET_LITTLE_WORDS (target_flags & ARM_FLAG_LITTLE_WORDS)