frv-protos.h: Remove the prototype for frv_expand_builtin_saveregs.
authorKazu Hirata <kazu@cs.umass.edu>
Thu, 29 Jan 2004 01:31:15 +0000 (01:31 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Thu, 29 Jan 2004 01:31:15 +0000 (01:31 +0000)
* config/frv/frv-protos.h: Remove the prototype for
frv_expand_builtin_saveregs.
* config/frv/frv.c (TARGET_STRUCT_VALUE_RTX): Likewise.
(TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise.
(frv_stack_info): Use FRV_STRUCT_VALUE_REGNUM instead of
STRUCT_VALUE_REGNUM.
(frv_expand_builtin_saveregs): Make it static.
(frv_struct_value_rtx): New.
* config/frv/frv.h (EXPAND_BUILTIN_SAVEREGS): Remove.

From-SVN: r76826

gcc/ChangeLog
gcc/config/frv/frv-protos.h
gcc/config/frv/frv.c
gcc/config/frv/frv.h

index aa89542097549f7506e34332b8be426cf2a8e203..aad6684c79df0660b9e84a8ab065ade7517b1f1e 100644 (file)
@@ -1,3 +1,15 @@
+2004-01-28  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * config/frv/frv-protos.h: Remove the prototype for
+       frv_expand_builtin_saveregs.
+       * config/frv/frv.c (TARGET_STRUCT_VALUE_RTX): Likewise.
+       (TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise.
+       (frv_stack_info): Use FRV_STRUCT_VALUE_REGNUM instead of
+       STRUCT_VALUE_REGNUM.
+       (frv_expand_builtin_saveregs): Make it static.
+       (frv_struct_value_rtx): New.
+       * config/frv/frv.h (EXPAND_BUILTIN_SAVEREGS): Remove.
+
 2004-01-29  Jan Hubicka  <jh@suse.cz>
 
        PR c++/12850
index d664bb070f651f47c25c70a2818683ba96fa0a0b..5cea43b74d0ac83de71be339ae8443a735b5d11c 100644 (file)
@@ -1,5 +1,5 @@
 /* Frv prototypes.
-   Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
    Contributed by Red Hat, Inc.
 
 This file is part of GCC.
@@ -96,7 +96,6 @@ extern int frv_function_arg_keep_as_reference (CUMULATIVE_ARGS *,
                                                 enum machine_mode,
                                                 tree, int);
 
-extern rtx frv_expand_builtin_saveregs         (void);
 extern void frv_setup_incoming_varargs         (CUMULATIVE_ARGS *,
                                                 enum machine_mode,
                                                 tree, int *, int);
index ae0c6bd80c69e3243ce5b335bbd6d15096802cf9..71180945754030c3cb98fc42927f2db81e503e66 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004
+   Free Software Foundation, Inc.
    Contributed by Red Hat, Inc.
 
 This file is part of GCC.
@@ -262,9 +263,11 @@ static void frv_init_libfuncs                      (void);
 static bool frv_in_small_data_p                        (tree);
 static void frv_asm_output_mi_thunk
   (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree);
+static rtx frv_expand_builtin_saveregs         (void);
 static bool frv_rtx_costs                      (rtx, int, int, int*);
 static void frv_asm_out_constructor            (rtx, int);
 static void frv_asm_out_destructor             (rtx, int);
+static rtx frv_struct_value_rtx                        (tree, int);
 \f
 /* Initialize the GCC target structure.  */
 #undef  TARGET_ASM_FUNCTION_PROLOGUE
@@ -298,6 +301,12 @@ static void frv_asm_out_destructor         (rtx, int);
 #undef  TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
 #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE frv_use_dfa_pipeline_interface
 
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX frv_struct_value_rtx
+
+#undef TARGET_EXPAND_BUILTIN_SAVEREGS
+#define TARGET_EXPAND_BUILTIN_SAVEREGS frv_expand_builtin_saveregs
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Given a CONST, return true if the symbol_ref points to small data.  */
@@ -902,8 +911,8 @@ frv_stack_info (void)
   info_ptr->regs[STACK_REGS_STDARG].special_p = 1;
 
   info_ptr->regs[STACK_REGS_STRUCT].name      = "struct";
-  info_ptr->regs[STACK_REGS_STRUCT].first     = STRUCT_VALUE_REGNUM;
-  info_ptr->regs[STACK_REGS_STRUCT].last      = STRUCT_VALUE_REGNUM;
+  info_ptr->regs[STACK_REGS_STRUCT].first     = FRV_STRUCT_VALUE_REGNUM;
+  info_ptr->regs[STACK_REGS_STRUCT].last      = FRV_STRUCT_VALUE_REGNUM;
   info_ptr->regs[STACK_REGS_STRUCT].special_p = 1;
 
   info_ptr->regs[STACK_REGS_FP].name          = "fp";
@@ -998,7 +1007,7 @@ frv_stack_info (void)
        case STACK_REGS_STRUCT:
          if (cfun->returns_struct)
            {
-             info_ptr->save_p[STRUCT_VALUE_REGNUM] = REG_SAVE_1WORD;
+             info_ptr->save_p[FRV_STRUCT_VALUE_REGNUM] = REG_SAVE_1WORD;
              size_1word += UNITS_PER_WORD;
            }
          break;
@@ -1136,8 +1145,8 @@ frv_stack_info (void)
 
       if (cfun->returns_struct)
        {
-         info_ptr->save_p[STRUCT_VALUE_REGNUM] = REG_SAVE_1WORD;
-         info_ptr->reg_offset[STRUCT_VALUE_REGNUM] = offset + UNITS_PER_WORD;
+         info_ptr->save_p[FRV_STRUCT_VALUE_REGNUM] = REG_SAVE_1WORD;
+         info_ptr->reg_offset[FRV_STRUCT_VALUE_REGNUM] = offset + UNITS_PER_WORD;
          info_ptr->regs[STACK_REGS_STRUCT].size_1word = UNITS_PER_WORD;
        }
 
@@ -1975,7 +1984,7 @@ frv_setup_incoming_varargs (CUMULATIVE_ARGS *cum,
    If this macro is not defined, the compiler will output an ordinary call to
    the library function `__builtin_saveregs'.  */
 
-rtx
+static rtx
 frv_expand_builtin_saveregs (void)
 {
   int offset = UNITS_PER_WORD * FRV_NUM_ARG_REGS;
@@ -9563,3 +9572,12 @@ frv_asm_out_destructor (rtx symbol, int priority ATTRIBUTE_UNUSED)
   assemble_align (POINTER_SIZE);
   assemble_integer_with_op ("\t.picptr\t", symbol);
 }
+
+/* Worker function for TARGET_STRUCT_VALUE_RTX.  */
+
+static rtx
+frv_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
+                     int incoming ATTRIBUTE_UNUSED)
+{
+  return gen_rtx_REG (Pmode, FRV_STRUCT_VALUE_REGNUM);
+}
index 9f85d57637d82330440719d9481276a0209e05e1..198d7132a570b0fc5d1f024c1b0816aea1f9ddcb 100644 (file)
@@ -1,5 +1,6 @@
 /* Target macros for the FRV port of GCC.
-   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
    Contributed by Red Hat Inc.
 
    This file is part of GCC.
@@ -1999,8 +2000,9 @@ struct machine_function GTY(())
    (Actually, on most machines, scalar values are returned in the same place
    regardless of mode).
 
-   If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same promotion
-   rules specified in `PROMOTE_MODE' if VALTYPE is a scalar type.
+   If `TARGET_PROMOTE_FUNCTION_RETURN' is defined to return true, you
+   must apply the same promotion rules specified in `PROMOTE_MODE' if
+   VALTYPE is a scalar type.
 
    If the precise function being called is known, FUNC is a tree node
    (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer.  This makes it
@@ -2008,8 +2010,8 @@ struct machine_function GTY(())
    functions when all their calls are known.
 
    `FUNCTION_VALUE' is not used for return vales with aggregate data types,
-   because these are returned in another way.  See `STRUCT_VALUE_REGNUM' and
-   related macros, below.  */
+   because these are returned in another way.  See
+   `TARGET_STRUCT_VALUE_RTX' and related macros, below.  */
 #define FUNCTION_VALUE(VALTYPE, FUNC) \
   gen_rtx (REG, TYPE_MODE (VALTYPE), RETURN_VALUE_REGNUM)
 
@@ -2041,9 +2043,9 @@ struct machine_function GTY(())
 \f
 /* How Large Values are Returned.  */
 
-/* If the structure value address is passed in a register, then
-   `STRUCT_VALUE_REGNUM' should be the number of that register.  */
-#define STRUCT_VALUE_REGNUM (GPR_FIRST + 3)
+/* The number of the register that is used to to pass the structure
+   value address.  */
+#define FRV_STRUCT_VALUE_REGNUM (GPR_FIRST + 3)
 
 \f
 /* Function Entry and Exit.  */
@@ -2081,23 +2083,13 @@ struct machine_function GTY(())
 \f
 /* Implementing the Varargs Macros.  */
 
-/* If defined, is a C expression that produces the machine-specific code for a
-   call to `__builtin_saveregs'.  This code will be moved to the very beginning
-   of the function, before any parameter access are made.  The return value of
-   this function should be an RTX that contains the value to use as the return
-   of `__builtin_saveregs'.
-
-   If this macro is not defined, the compiler will output an ordinary call to
-   the library function `__builtin_saveregs'.  */
-
-#define EXPAND_BUILTIN_SAVEREGS() frv_expand_builtin_saveregs ()
-
 /* This macro offers an alternative to using `__builtin_saveregs' and defining
-   the macro `EXPAND_BUILTIN_SAVEREGS'.  Use it to store the anonymous register
-   arguments into the stack so that all the arguments appear to have been
-   passed consecutively on the stack.  Once this is done, you can use the
-   standard implementation of varargs that works for machines that pass all
-   their arguments on the stack.
+   the target hook `TARGET_EXPAND_BUILTIN_SAVEREGS'.  Use it to store
+   the anonymous register arguments into the stack so that all the
+   arguments appear to have been passed consecutively on the stack.
+   Once this is done, you can use the standard implementation of
+   varargs that works for machines that pass all their arguments on
+   the stack.
 
    The argument ARGS_SO_FAR is the `CUMULATIVE_ARGS' data structure, containing
    the values that obtain after processing of the named arguments.  The