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]

[arm] Fix big-endian function argument.


The attached patch fixes integer function arguments < 4 bytes passed in memory 
on big-endian arm targets. DEFAULT_FUNCTION_ARG_PADDING returns an enum, not 
true/false.

Tested with cross to arm-none-elf/-mbig-endian.
Applied to mainline and csl-arm-branch.
4.0 is not effected.

Paul

2005-07-07  Paul Brook  <paul@codesourcery.com>

	* config/arm/arm.c (arm_pad_arg_upward): Compare return value of
	DEFAULT_FUNCTION_ARG_PADDING to upward.
Index: gcc/config/arm/arm.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.303.2.81
diff -u -p -r1.303.2.81 arm.c
--- gcc/config/arm/arm.c	20 May 2005 14:48:30 -0000	1.303.2.81
+++ gcc/config/arm/arm.c	7 Jul 2005 20:35:13 -0000
@@ -2685,14 +2685,16 @@ arm_must_pass_in_stack (enum machine_mod
 
 
 /* For use by FUNCTION_ARG_PADDING (MODE, TYPE).
-   Return true if an argument passed on the stack should be padded upwards,
-   i.e. if the least-significant byte has useful data.  */
+   Return true if an argument passed on the stack should be padded upwards,
+   i.e. if the least-significant byte has useful data.
+   For legacy APCS ABIs we use the default.  For AAPCS based ABIs small
+   aggregate types are placed in the lowest memory address.  */
 
 bool
 arm_pad_arg_upward (enum machine_mode mode, tree type)
 {
   if (!TARGET_AAPCS_BASED)
-    return DEFAULT_FUNCTION_ARG_PADDING(mode, type);
+    return DEFAULT_FUNCTION_ARG_PADDING(mode, type) == upward;
 
   if (type && BYTES_BIG_ENDIAN && INTEGRAL_TYPE_P (type))
     return false;

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