This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[arm] Fix alignment of complex double types.
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Thu, 29 Apr 2004 23:45:43 +0100
- Subject: [arm] Fix alignment of complex double types.
- Organization: CodeSourcery
The following patch fixes the alignment of complex doubleword arguments under
aapcs based ABIs. It looks at the alignment of the mode, rather than
hardcoding specific modes.
Tested with cross to arm-none-elf.
Ok?
Paul
2004-04-30 Paul Brook <paul@codesourcery.com>
* arm.c (arm_needs_doubleword_align): Use mode alignment.
Index: arm.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.353
diff -u -p -r1.353 arm.c
--- a/arm.c 27 Apr 2004 14:20:10 -0000 1.353
+++ b/arm.c 29 Apr 2004 15:48:36 -0000
@@ -2318,11 +2319,8 @@ arm_init_cumulative_args (CUMULATIVE_ARG
bool
arm_needs_doubleword_align (enum machine_mode mode, tree type)
{
- return (mode == DImode
- || mode == DFmode
- || VECTOR_MODE_SUPPORTED_P (mode)
- || (mode == BLKmode
- && TYPE_ALIGN (type) > PARM_BOUNDARY));
+ return (GET_MODE_ALIGNMENT (mode) > PARM_BOUNDARY
+ || (type && TYPE_ALIGN (type) > PARM_BOUNDARY));
}