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]

[patch] arm: Hookize some target macros.


Hi,

Attached is a patch to hookize some target macros.

Built cc1 of arm-elf.  OK to apply?

Kazu Hirata

2004-01-24  Kazu Hirata  <kazu@cs.umass.edu>

	* config/arm/arm.c (TARGET_PROMOTE_FUNCTION_ARGS): New.
	(TARGET_PROMOTE_PROTOTYPES): Likewise.
	(TARGET_STRUCT_VALUE_RTX): Likewise.
	(arm_struct_value_rtx): Likewise.
	* config/arm/arm.h (PROMOTE_FUNCTION_ARGS): Remove.
	(STRUCT_VALUE): Remove.
	(STRUCT_VALUE_REGNUM): Likewise.
	(PROMOTE_PROTOTYPES): Likewise.

Index: arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.319
diff -u -r1.319 arm.c
--- arm.c	23 Jan 2004 16:33:43 -0000	1.319
+++ arm.c	24 Jan 2004 18:16:17 -0000
@@ -150,6 +150,7 @@
 static void aof_file_start (void);
 static void aof_file_end (void);
 #endif
+static rtx arm_struct_value_rtx (tree, int);
 
 
 /* Initialize the GCC target structure.  */
@@ -233,6 +234,14 @@
 #undef  TARGET_EXPAND_BUILTIN
 #define TARGET_EXPAND_BUILTIN arm_expand_builtin
 
+#undef TARGET_PROMOTE_FUNCTION_ARGS
+#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true
+#undef TARGET_PROMOTE_PROTOTYPES
+#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
+
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX arm_struct_value_rtx
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Obstack for minipool constant handling.  */
@@ -13321,4 +13330,23 @@
   output_asm_insn ("ldr%?\t%0, [sp], #4\t@ End of GR load expansion", & reg);
 
   return "";
+}
+
+static rtx
+arm_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
+		      int incoming ATTRIBUTE_UNUSED)
+{
+#if 0
+  /* FIXME: The ARM backend has special code to handle structure
+	 returns, and will reserve its own hidden first argument.  So
+	 if this macro is enabled a *second* hidden argument will be
+	 reserved, which will break binary compatibility with old
+	 toolchains and also thunk handling.  One day this should be
+	 fixed.  */
+  return 0;
+#else
+  /* Register in which address to store a structure value
+     is passed to a function.  */
+  return gen_rtx_REG (Pmode, ARG_REGISTER (1));
+#endif
 }
Index: arm.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.214
diff -u -r1.214 arm.h
--- arm.h	14 Jan 2004 17:51:30 -0000	1.214
+++ arm.h	24 Jan 2004 18:16:19 -0000
@@ -709,11 +709,6 @@
       (MODE) = SImode;				\
     }
 
-/* Define this macro if the promotion described by `PROMOTE_MODE'
-   should also be done for outgoing function arguments.  */
-/* This is required to ensure that push insns always push a word.  */
-#define PROMOTE_FUNCTION_ARGS
-
 /* Define this if most significant bit is lowest numbered
    in instructions that operate on numbered bit-fields.  */
 #define BITS_BIG_ENDIAN  0
@@ -1051,20 +1046,6 @@
 /* Return the register number of the N'th (integer) argument.  */
 #define ARG_REGISTER(N) 	(N - 1)
 
-#if 0 /* FIXME: The ARM backend has special code to handle structure
-	 returns, and will reserve its own hidden first argument.  So
-	 if this macro is enabled a *second* hidden argument will be
-	 reserved, which will break binary compatibility with old
-	 toolchains and also thunk handling.  One day this should be
-	 fixed.  */
-/* RTX for structure returns.  NULL means use a hidden first argument.  */
-#define STRUCT_VALUE		0
-#else
-/* Register in which address to store a structure value
-   is passed to a function.  */
-#define STRUCT_VALUE_REGNUM	ARG_REGISTER (1)
-#endif
-
 /* Specify the registers used for certain standard purposes.
    The values of these macros are register numbers.  */
 
@@ -2348,9 +2329,6 @@
 
 /* Calling from registers is a massive pain.  */
 #define NO_FUNCTION_CSE 1
-
-/* Chars and shorts should be passed as ints.  */
-#define PROMOTE_PROTOTYPES 1
 
 /* The machine modes of pointers and functions */
 #define Pmode  SImode


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