From patchwork Wed Mar 16 22:04:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Sokolov X-Patchwork-Id: 87311 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 A77A9B6FE6 for ; Thu, 17 Mar 2011 09:04:29 +1100 (EST) Received: (qmail 20038 invoked by alias); 16 Mar 2011 22:04:27 -0000 Received: (qmail 20029 invoked by uid 22791); 16 Mar 2011 22:04:26 -0000 X-SWARE-Spam-Status: No, hits=0.6 required=5.0 tests=AWL, BAYES_00, KAM_THEBAT, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from contrabass.post.ru (HELO contrabass.corbina.net) (85.21.78.5) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Mar 2011 22:04:22 +0000 Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.corbina.net (Postfix) with ESMTP id 15D5ACAF8B; Thu, 17 Mar 2011 01:04:20 +0300 (MSK) Received: from [93.80.237.51] (account aesok@post.ru HELO Vista.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPA id 309042037; Thu, 17 Mar 2011 01:04:20 +0300 Date: Thu, 17 Mar 2011 01:04:20 +0300 From: Anatoly Sokolov Message-ID: <501986597.20110317010420@post.ru> To: gcc-patches CC: nickc@redhat.com Subject: [V850] Hookize OUTPUT_ADDR_CONST_EXTRA 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 Hello. This patch removes obsolete OUTPUT_ADDR_CONST_EXTRA macro from V850 back end in the GCC and introduces equivalent TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA target hook. Regression-tested on v850-unknown-elf. OK to install? * config/v850/v850.h (OUTPUT_ADDR_CONST_EXTRA): Remove. * config/v850/v850-protos.h (v850_output_addr_const_extra): Remove. * config/v850/v850.c (v850_output_addr_const_extra): Mace static. Change return type to bool. (TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA): Define. Anatoly. Index: gcc/config/v850/v850.c =================================================================== --- gcc/config/v850/v850.c (revision 170852) +++ gcc/config/v850/v850.c (working copy) @@ -795,13 +795,13 @@ the truncate and just emit the difference of the two labels. The .hword directive will automatically handle the truncation for us. - Returns 1 if rtx was handled, 0 otherwise. */ + Returns true if rtx was handled, false otherwise. */ -int +static bool v850_output_addr_const_extra (FILE * file, rtx x) { if (GET_CODE (x) != TRUNCATE) - return 0; + return false; x = XEXP (x, 0); @@ -814,10 +814,10 @@ && GET_CODE (XEXP (x, 0)) == LABEL_REF && GET_CODE (XEXP (XEXP (x, 0), 0)) == CODE_LABEL && INSN_DELETED_P (XEXP (XEXP (x, 0), 0))) - return 1; + return true; output_addr_const (file, x); - return 1; + return true; } /* Return appropriate code to load up a 1, 2, or 4 integer/floating @@ -3138,6 +3138,9 @@ #undef TARGET_PRINT_OPERAND_PUNCT_VALID_P #define TARGET_PRINT_OPERAND_PUNCT_VALID_P v850_print_operand_punct_valid_p +#undef TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA +#define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA v850_output_addr_const_extra + #undef TARGET_ATTRIBUTE_TABLE #define TARGET_ATTRIBUTE_TABLE v850_attribute_table Index: gcc/config/v850/v850.h =================================================================== --- gcc/config/v850/v850.h (revision 170852) +++ gcc/config/v850/v850.h (working copy) @@ -748,10 +748,6 @@ #undef USER_LABEL_PREFIX #define USER_LABEL_PREFIX "_" -#define OUTPUT_ADDR_CONST_EXTRA(FILE, X, FAIL) \ - if (! v850_output_addr_const_extra (FILE, X)) \ - goto FAIL - /* This says how to output the assembler to define a global uninitialized but not common symbol. */ Index: gcc/config/v850/v850-protos.h =================================================================== --- gcc/config/v850/v850-protos.h (revision 170852) +++ gcc/config/v850/v850-protos.h (working copy) @@ -33,7 +33,6 @@ extern void v850_init_expanders (void); #ifdef RTX_CODE -extern int v850_output_addr_const_extra (FILE *, rtx); extern rtx v850_return_addr (int); extern const char *output_move_single (rtx *); extern void notice_update_cc (rtx, rtx);