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] Default aapcs to short-enums


The following patch defaults short-enums to on when using an aapcs based ABI.

Tested with cross to arm-none-elf.
It introduces a couple of testsuite failures; builtin-types-compatible-p.c and 
gcc.dg/compare1.c. These are both existing problems with -fshort-enums.

Ok?

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

	* config/arm/arm.c (arm_default_short_enums): New function.
	(TARGET_DEFAULT_SHORT_ENUMS): Define.

Index: config/arm/arm.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.358
diff -u -p -r1.358 arm.c
--- a/config/arm/arm.c	10 May 2004 13:39:20 -0000	1.358
+++ b/config/arm/arm.c	11 May 2004 12:40:30 -0000
@@ -159,6 +159,7 @@ static rtx arm_struct_value_rtx (tree, i
 static void arm_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
 					tree, int *, int);
 static bool arm_promote_prototypes (tree);
+static bool arm_default_short_enums (void);
 
 
 /* Initialize the GCC target structure.  */
@@ -256,6 +257,9 @@ static bool arm_promote_prototypes (tree
 #undef  TARGET_SETUP_INCOMING_VARARGS
 #define TARGET_SETUP_INCOMING_VARARGS arm_setup_incoming_varargs
 
+#undef TARGET_DEFAULT_SHORT_ENUMS
+#define TARGET_DEFAULT_SHORT_ENUMS arm_default_short_enums
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Obstack for minipool constant handling.  */
@@ -14553,3 +14557,11 @@ arm_promote_prototypes (tree t ATTRIBUTE
     return !TARGET_AAPCS_BASED;
 }
 
+
+/* AAPCS based ABIs use short enums by default.  */
+
+static bool
+arm_default_short_enums (void)
+{
+  return TARGET_AAPCS_BASED;
+}


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