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 built-in data types


Patch below corrects the types used for size_t and wchar_t under the AAPCS 
ABI.

Tested with cross to arm-none-elf.
Ok?

Paul

2004-05-06  Paul Brook  <paul@codesourcery.com>

	* config/arm/arm.c (arm_promote_prototypes): Use TARGET_AAPCS_BASED.
	* config/arm/arm.h (TARGET_AAPCS_BASED): Define.
	(TARGET_DOUBLEWORD_ALIGN): Use it.
	(WCHAR_TYPE): Define.
	(WCHAR_SIZE_TYPE): Define.
	(SIZE_TYPE): Define.

Index: config/arm/arm.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.357
diff -u -p -r1.357 arm.c
--- a/config/arm/arm.c	5 May 2004 23:11:53 -0000	1.357
+++ b/config/arm/arm.c	6 May 2004 16:49:42 -0000
@@ -14550,6 +14550,6 @@ arm_no_early_mul_dep (rtx producer, rtx 
 static bool
 arm_promote_prototypes (tree t ATTRIBUTE_UNUSED)
 {
-    return arm_abi == ARM_ABI_APCS || arm_abi == ARM_ABI_ATPCS;
+    return !TARGET_AAPCS_BASED;
 }
 
Index: config/arm/arm.h
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.232
diff -u -p -r1.232 arm.h
--- a/config/arm/arm.h	5 May 2004 23:11:53 -0000	1.232
+++ b/config/arm/arm.h	6 May 2004 16:48:22 -0000
@@ -307,6 +307,8 @@ extern GTY(()) rtx aof_pic_label;
 				         : (target_flags & THUMB_FLAG_BACKTRACE))
 #define TARGET_CIRRUS_FIX_INVALID_INSNS	(target_flags & 
CIRRUS_FIX_INVALID_INSNS)
 #define TARGET_LDRD			(arm_arch5e && ARM_DOUBLEWORD_ALIGN)
+#define TARGET_AAPCS_BASED \
+    (arm_abi != ARM_ABI_APCS && arm_abi != ARM_ABI_ATPCS)
 
 /* SUBTARGET_SWITCHES is used to add flags on a per-config basis.  */
 #ifndef SUBTARGET_SWITCHES
@@ -655,8 +657,8 @@ extern int arm_is_6_or_7;
 #define UNITS_PER_WORD	4
 
 /* True if natural alignment is used for doubleword types.  */
-#define ARM_DOUBLEWORD_ALIGN \
-    (arm_abi == ARM_ABI_AAPCS || arm_abi == ARM_ABI_IWMMXT)
+#define ARM_DOUBLEWORD_ALIGN	TARGET_AAPCS_BASED
+
 #define DOUBLEWORD_ALIGNMENT 64
 
 #define PARM_BOUNDARY  	32
@@ -716,6 +718,17 @@ extern const char * structure_size_strin
 /* Nonzero if move instructions will actually fail to work
    when given unaligned data.  */
 #define STRICT_ALIGNMENT 1
+
+/* wchar_t is unsigned under the AAPCS.  */
+#ifndef WCHAR_TYPE
+#define WCHAR_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "int")
+
+#define WCHAR_TYPE_SIZE BITS_PER_WORD
+#endif
+
+#ifndef SIZE_TYPE
+#define SIZE_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "long unsigned int")
+#endif
 
 /* Standard register usage.  */
 


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