This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Move the default definitions of OUTGOING_REGNO andINCOMING_REGNO to defaults.h.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 20 Feb 2004 19:39:08 -0500 (EST)
- Subject: [patch] Move the default definitions of OUTGOING_REGNO andINCOMING_REGNO to defaults.h.
Hi,
Attached is a patch to move the default definitions of OUTGOING_REGNO
and INCOMING_REGNO to defaults.h.
Bootstrapped on i686-pc-linux-gnu. Committed as obvious.
Kazu Hirata
2004-02-20 Kazu Hirata <kazu@cs.umass.edu>
* alias.c (OUTGOING_REGNO): Don't define the default.
* builtins.c (OUTGOING_REGNO): Likewise.
(INCOMING_REGNO): Likewise.
(apply_args_register_offset): Always use OUTGOING_REGNO.
* combine.c (OUTGOING_REGNO): Likewise.
* sibcall.c (OUTGOING_REGNO): Likewise.
* defaults.h (INCOMING_REGNO): Provide the default.
(OUTGOING_REGNO): Likewise.
Index: alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/alias.c,v
retrieving revision 1.214
diff -u -r1.214 alias.c
--- alias.c 3 Feb 2004 23:53:48 -0000 1.214
+++ alias.c 20 Feb 2004 17:01:11 -0000
@@ -2661,9 +2661,6 @@
{
int i;
-#ifndef OUTGOING_REGNO
-#define OUTGOING_REGNO(N) N
-#endif
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
/* Check whether this register can hold an incoming pointer
argument. FUNCTION_ARG_REGNO_P tests outgoing register
Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.284
diff -u -r1.284 builtins.c
--- builtins.c 11 Feb 2004 23:39:35 -0000 1.284
+++ builtins.c 20 Feb 2004 17:01:14 -0000
@@ -48,14 +48,6 @@
#define CALLED_AS_BUILT_IN(NODE) \
(!strncmp (IDENTIFIER_POINTER (DECL_NAME (NODE)), "__builtin_", 10))
-/* Register mappings for target machines without register windows. */
-#ifndef INCOMING_REGNO
-#define INCOMING_REGNO(OUT) (OUT)
-#endif
-#ifndef OUTGOING_REGNO
-#define OUTGOING_REGNO(IN) (IN)
-#endif
-
#ifndef PAD_VARARGS_DOWN
#define PAD_VARARGS_DOWN BYTES_BIG_ENDIAN
#endif
@@ -902,10 +894,7 @@
/* Arguments are always put in outgoing registers (in the argument
block) if such make sense. */
-#ifdef OUTGOING_REGNO
- regno = OUTGOING_REGNO (regno);
-#endif
- return apply_args_reg_offset[regno];
+ return apply_args_reg_offset[OUTGOING_REGNO (regno)];
}
/* Return the size required for the block returned by __builtin_apply_args,
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.410
diff -u -r1.410 combine.c
--- combine.c 17 Feb 2004 22:21:00 -0000 1.410
+++ combine.c 20 Feb 2004 17:01:20 -0000
@@ -813,9 +813,6 @@
if (targetm.calls.promote_function_args (TREE_TYPE (cfun->decl)))
{
-#ifndef OUTGOING_REGNO
-#define OUTGOING_REGNO(N) N
-#endif
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
/* Check whether this register can hold an incoming pointer
argument. FUNCTION_ARG_REGNO_P tests outgoing register
Index: defaults.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/defaults.h,v
retrieving revision 1.127
diff -u -r1.127 defaults.h
--- defaults.h 8 Feb 2004 02:13:28 -0000 1.127
+++ defaults.h 20 Feb 2004 17:01:21 -0000
@@ -690,4 +690,13 @@
#define CASE_VECTOR_PC_RELATIVE 0
#endif
+/* Register mappings for target machines without register windows. */
+#ifndef INCOMING_REGNO
+#define INCOMING_REGNO(N) (N)
+#endif
+
+#ifndef OUTGOING_REGNO
+#define OUTGOING_REGNO(N) (N)
+#endif
+
#endif /* ! GCC_DEFAULTS_H */
Index: sibcall.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sibcall.c,v
retrieving revision 1.45
diff -u -r1.45 sibcall.c
--- sibcall.c 11 Dec 2003 00:20:48 -0000 1.45
+++ sibcall.c 20 Feb 2004 17:01:21 -0000
@@ -174,10 +174,6 @@
called function's return value was copied. Otherwise we're returning
some other value. */
-#ifndef OUTGOING_REGNO
-#define OUTGOING_REGNO(N) (N)
-#endif
-
if (SET_DEST (set) == current_function_return_rtx
&& REG_P (SET_DEST (set))
&& OUTGOING_REGNO (REGNO (SET_DEST (set))) == REGNO (hardret)