From patchwork Sun Aug 22 11:32:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Sokolov X-Patchwork-Id: 62372 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id A706CB70D3 for ; Sun, 22 Aug 2010 21:32:22 +1000 (EST) Received: (qmail 28787 invoked by alias); 22 Aug 2010 11:32:20 -0000 Received: (qmail 28776 invoked by uid 22791); 22 Aug 2010 11:32:17 -0000 X-SWARE-Spam-Status: No, hits=2.5 required=5.0 tests=AWL, BAYES_50, KAM_THEBAT, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from contrabass.post.ru (HELO contrabass.post.ru) (85.21.78.5) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Aug 2010 11:32:12 +0000 Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 2D4269678; Sun, 22 Aug 2010 15:32:08 +0400 (MSD) Received: from [95.26.2.68] (account aesok@post.ru HELO Vista.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPA id 247772466; Sun, 22 Aug 2010 15:32:08 +0400 Date: Sun, 22 Aug 2010 15:32:26 +0400 From: Anatoly Sokolov Message-ID: <163126824.20100822153226@post.ru> To: gcc-patches@gcc.gnu.org CC: dj@redhat.com Subject: [M32C] Hookize OVERRIDE_OPTIONS and FUNCTION_VALUE_REGNO_P MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi. This patch removes obsolete OVERRIDE_OPTIONS and FUNCTION_VALUE_REGNO_P macros from the M32C back end in the GCC and introduces equivalent TARGET_OPTION_OVERRIDE and TARGET_FUNCTION_VALUE_REGNO_P target hooks. Regression tested on m32c-unknown-elf. * config/m32c/m32c.c (m32c_function_value_regno_p): Make static. (m32c_override_options): Rename to... (m32c_option_override): ...this. Make static. (TARGET_FUNCTION_VALUE_REGNO_P, TARGET_OPTION_OVERRIDE): Define. * config/m32c/m32c.h (OVERRIDE_OPTIONS, FUNCTION_VALUE_REGNO_P): Remove. * config/m32c/m32c-protos.h (m32c_override_options, m32c_function_value_regno_p): Remove. Anatily. Index: gcc/config/m32c/m32c.c =================================================================== --- gcc/config/m32c/m32c.c (revision 163440) +++ gcc/config/m32c/m32c.c (working copy) @@ -416,11 +416,15 @@ return TRUE; } -/* Implements OVERRIDE_OPTIONS. We limit memregs to 0..16, and - provide a default. */ -void -m32c_override_options (void) +/* Implements TARGET_OPTION_OVERRIDE. */ + +#undef TARGET_OPTION_OVERRIDE +#define TARGET_OPTION_OVERRIDE m32c_option_override + +static void +m32c_option_override (void) { + /* We limit memregs to 0..16, and provide a default. */ if (target_memregs_set) { if (target_memregs < 0 || target_memregs > 16) @@ -1675,9 +1679,12 @@ return m32c_libcall_value (mode, NULL_RTX); } -/* Implements FUNCTION_VALUE_REGNO_P. */ +/* Implements TARGET_FUNCTION_VALUE_REGNO_P. */ -bool +#undef TARGET_FUNCTION_VALUE_REGNO_P +#define TARGET_FUNCTION_VALUE_REGNO_P m32c_function_value_regno_p + +static bool m32c_function_value_regno_p (const unsigned int regno) { return (regno == R0_REGNO || regno == MEM0_REGNO); Index: gcc/config/m32c/m32c.h =================================================================== --- gcc/config/m32c/m32c.h (revision 163440) +++ gcc/config/m32c/m32c.h (working copy) @@ -96,8 +96,6 @@ #define TARGET_VERSION fprintf (stderr, " (m32c)"); -#define OVERRIDE_OPTIONS m32c_override_options () - /* Defining data structures for per-function information */ typedef struct GTY (()) machine_function @@ -530,10 +528,6 @@ #define FUNCTION_ARG_BOUNDARY(MODE,TYPE) (TARGET_A16 ? 8 : 16) #define FUNCTION_ARG_REGNO_P(r) m32c_function_arg_regno_p (r) -/* How Scalar Function Values Are Returned */ - -#define FUNCTION_VALUE_REGNO_P(r) m32c_function_value_regno_p (r) - /* How Large Values Are Returned */ #define DEFAULT_PCC_STRUCT_RETURN 1 Index: gcc/config/m32c/m32c-protos.h =================================================================== --- gcc/config/m32c/m32c-protos.h (revision 163440) +++ gcc/config/m32c/m32c-protos.h (working copy) @@ -37,7 +37,6 @@ int m32c_initial_elimination_offset (int, int); void m32c_output_reg_pop (FILE *, int); void m32c_output_reg_push (FILE *, int); -void m32c_override_options (void); int m32c_print_operand_punct_valid_p (int); int m32c_push_rounding (int); int m32c_reg_class_from_constraint (char, const char *); @@ -75,7 +74,6 @@ rtx m32c_incoming_return_addr_rtx (void); int m32c_legitimate_constant_p (rtx); int m32c_legitimize_reload_address (rtx *, MM, int, int, int); -bool m32c_function_value_regno_p (const unsigned int); int m32c_limit_reload_class (MM, int); int m32c_memory_move_cost (MM, int, int); int m32c_modes_tieable_p (MM, MM);