OSDN Git Service

* config/m32r/m32r.c (m32r_function_value, m32r_libcall_value,
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 4 Sep 2010 19:22:24 +0000 (19:22 +0000)
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 4 Sep 2010 19:22:24 +0000 (19:22 +0000)
m32r_function_value_regno_p): New functions.
(TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE,
TARGET_FUNCTION_VALUE_REGNO_P): Declare.
* config/m32r/m32r.h: (FUNCTION_VALUE, LIBCALL_VALUE,
FUNCTION_VALUE_REGNO_P): Remove.

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

gcc/ChangeLog
gcc/config/m32r/m32r.c
gcc/config/m32r/m32r.h

index e5fe0a2..e3d4233 100644 (file)
@@ -1,3 +1,12 @@
+2010-09-04  Anatoly Sokolov  <aesok@post.ru>
+
+       * config/m32r/m32r.c (m32r_function_value, m32r_libcall_value,
+       m32r_function_value_regno_p): New functions.
+       (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE,
+       TARGET_FUNCTION_VALUE_REGNO_P): Declare.
+       * config/m32r/m32r.h: (FUNCTION_VALUE, LIBCALL_VALUE,
+       FUNCTION_VALUE_REGNO_P): Remove.
+
 2010-09-04  Jan Hubicka  <jh@suse.cz>
 
        * gimple-fold.c (maybe_fold_reference): Use fold_const_aggregate_ref.
index 3890da3..33e3bfb 100644 (file)
@@ -82,6 +82,9 @@ static int    m32r_issue_rate (void);
 static void m32r_encode_section_info (tree, rtx, int);
 static bool m32r_in_small_data_p (const_tree);
 static bool m32r_return_in_memory (const_tree, const_tree);
+static rtx m32r_function_value (const_tree, const_tree, bool);
+static rtx m32r_libcall_value (enum machine_mode, const_rtx);
+static bool m32r_function_value_regno_p (const unsigned int);
 static void m32r_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
                                         tree, int *, int);
 static void init_idents (void);
@@ -158,6 +161,14 @@ static const struct attribute_spec m32r_attribute_table[] =
 #define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true
 #undef  TARGET_RETURN_IN_MEMORY
 #define TARGET_RETURN_IN_MEMORY m32r_return_in_memory
+
+#undef TARGET_FUNCTION_VALUE
+#define TARGET_FUNCTION_VALUE m32r_function_value
+#undef TARGET_LIBCALL_VALUE
+#define TARGET_LIBCALL_VALUE m32r_libcall_value
+#undef TARGET_FUNCTION_VALUE_REGNO_P
+#define TARGET_FUNCTION_VALUE_REGNO_P m32r_function_value_regno_p
+
 #undef  TARGET_SETUP_INCOMING_VARARGS
 #define TARGET_SETUP_INCOMING_VARARGS m32r_setup_incoming_varargs
 #undef  TARGET_MUST_PASS_IN_STACK
@@ -1246,6 +1257,35 @@ m32r_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
   return m32r_pass_by_reference (NULL, TYPE_MODE (type), type, false);
 }
 
+/* Worker function for TARGET_FUNCTION_VALUE.  */
+
+static rtx
+m32r_function_value (const_tree valtype,
+               const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
+               bool outgoing ATTRIBUTE_UNUSED)
+{
+  return gen_rtx_REG (TYPE_MODE (valtype), 0);
+}
+
+/* Worker function for TARGET_LIBCALL_VALUE.  */
+
+static rtx
+m32r_libcall_value (enum machine_mode mode,
+               const_rtx fun ATTRIBUTE_UNUSED)
+{
+  return gen_rtx_REG (mode, 0);
+}
+
+/* Worker function for TARGET_FUNCTION_VALUE_REGNO_P.
+
+  ??? What about r1 in DI/DF values.  */
+
+static bool
+m32r_function_value_regno_p (const unsigned int regno)
+{
+  return (regno == 0);
+}
+
 /* Do any needed setup for a variadic function.  For the M32R, we must
    create a register parameter block, and then copy any anonymous arguments
    in registers to memory.
index 81fc19b..2ea0d31 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler, Renesas M32R cpu.
    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
@@ -855,21 +855,6 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
 \f
 /* Function results.  */
 
-/* Define how to find the value returned by a function.
-   VALTYPE is the data type of the value (as a tree).
-   If the precise function being called is known, FUNC is its FUNCTION_DECL;
-   otherwise, FUNC is 0.  */
-#define FUNCTION_VALUE(VALTYPE, FUNC) gen_rtx_REG (TYPE_MODE (VALTYPE), 0)
-
-/* Define how to find the value returned by a library function
-   assuming the value has mode MODE.  */
-#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
-
-/* 1 if N is a possible register number for a function value
-   as seen by the caller.  */
-/* ??? What about r1 in DI/DF values.  */
-#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
-
 /* Tell GCC to use TARGET_RETURN_IN_MEMORY.  */
 #define DEFAULT_PCC_STRUCT_RETURN 0
 \f