OSDN Git Service

* config/arc/arc.c (TARGET_PROMOTE_FUNCTION_ARGS): New.
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Jan 2004 23:22:55 +0000 (23:22 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Jan 2004 23:22:55 +0000 (23:22 +0000)
(TARGET_PROMOTE_FUNCTION_RETURN): Likewise.
(TARGET_PROMOTE_PROTOTYPES): Likewise.
(TARGET_STRUCT_VALUE_RTX): Likewise.
(TARGET_RETURN_IN_MEMORY): Likewise.
(arc_return_in_memory): Likewise.
* config/arc/arc.h (PROMOTE_FUNCTION_ARGS): Remove.
(PROMOTE_FUNCTION_RETURN): Likewise.
(RETURN_IN_MEMORY): Likewise.
(STRUCT_VALUE): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76677 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arc/arc.c
gcc/config/arc/arc.h

index c05b347..4674b7c 100644 (file)
@@ -1,3 +1,16 @@
+2004-01-26  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * config/arc/arc.c (TARGET_PROMOTE_FUNCTION_ARGS): New.
+       (TARGET_PROMOTE_FUNCTION_RETURN): Likewise.
+       (TARGET_PROMOTE_PROTOTYPES): Likewise.
+       (TARGET_STRUCT_VALUE_RTX): Likewise.
+       (TARGET_RETURN_IN_MEMORY): Likewise.
+       (arc_return_in_memory): Likewise.
+       * config/arc/arc.h (PROMOTE_FUNCTION_ARGS): Remove.
+       (PROMOTE_FUNCTION_RETURN): Likewise.
+       (RETURN_IN_MEMORY): Likewise.
+       (STRUCT_VALUE): Likewise.
+
 2004-01-26  Richard Henderson  <rth@redhat.com>
 
        * c-parse.in (extension): Use itype.
index ad26913..e8e4019 100644 (file)
@@ -98,6 +98,7 @@ static void arc_file_start (void);
 static void arc_internal_label (FILE *, const char *, unsigned long);
 static bool arc_rtx_costs (rtx, int, int, int *);
 static int arc_address_cost (rtx);
+static bool arc_return_in_memory (tree, tree);
 \f
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_ALIGNED_HI_OP
@@ -123,6 +124,18 @@ static int arc_address_cost (rtx);
 #undef TARGET_ADDRESS_COST
 #define TARGET_ADDRESS_COST arc_address_cost
 
+#undef TARGET_PROMOTE_FUNCTION_ARGS
+#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true
+#undef TARGET_PROMOTE_FUNCTION_RETURN
+#define TARGET_PROMOTE_FUNCTION_RETURN 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 hook_rtx_tree_int_null
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY arc_return_in_memory
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Called by OVERRIDE_OPTIONS to initialize various things.  */
@@ -2351,3 +2364,11 @@ arc_internal_label (FILE *stream, const char *prefix, unsigned long labelno)
   arc_ccfsm_at_label (prefix, labelno);
   default_internal_label (stream, prefix, labelno);
 }
+
+static bool
+arc_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
+{
+  return (AGGREGATE_TYPE_P (type)
+         || int_size_in_bytes (type) > 8
+         || TREE_ADDRESSABLE (type));
+}
index 5a5f168..5171849 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions of target machine for GNU compiler, Argonaut ARC cpu.
-   Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002
+   Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2004
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -206,13 +206,6 @@ if (GET_MODE_CLASS (MODE) == MODE_INT              \
   (MODE) = SImode;                             \
 }
 
-/* Define this macro if the promotion described by `PROMOTE_MODE'
-   should also be done for outgoing function arguments.  */
-#define PROMOTE_FUNCTION_ARGS
-
-/* Likewise, if the function return value is promoted.  */
-#define PROMOTE_FUNCTION_RETURN
-
 /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
 #define PARM_BOUNDARY 32
 
@@ -605,9 +598,6 @@ extern enum reg_class arc_regno_reg_class[FIRST_PSEUDO_REGISTER];
 \f
 /* Function argument passing.  */
 
-/* When a prototype says `char' or `short', really pass an `int'.  */
-#define PROMOTE_PROTOTYPES 1
-
 /* If defined, the maximum amount of space required for outgoing
    arguments will be computed and placed into the variable
    `current_function_outgoing_args_size'.  No space will be pushed
@@ -789,22 +779,8 @@ arc_setup_incoming_varargs(&ARGS_SO_FAR, MODE, TYPE, &PRETEND_SIZE, NO_RTL)
 /* ??? What about r1 in DI/DF values.  */
 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
 
-/* A C expression which can inhibit the returning of certain function
-   values in registers, based on the type of value.  A nonzero value says
-   to return the function value in memory, just as large structures are
-   always returned.  Here TYPE will be a C expression of type `tree',
-   representing the data type of the value.  */
-#define RETURN_IN_MEMORY(TYPE) \
-(AGGREGATE_TYPE_P (TYPE) \
- || int_size_in_bytes (TYPE) > 8 \
- || TREE_ADDRESSABLE (TYPE))
-
 /* Tell GCC to use RETURN_IN_MEMORY.  */
 #define DEFAULT_PCC_STRUCT_RETURN 0
-
-/* Register in which address to store a structure value
-   is passed to a function, or 0 to use `invisible' first argument.  */
-#define STRUCT_VALUE 0
 \f
 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
    the stack pointer does not matter.  The value is tested only in