From patchwork Thu Nov 11 10:44:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joern Rennecke X-Patchwork-Id: 70793 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 D2D98B7115 for ; Thu, 11 Nov 2010 21:44:23 +1100 (EST) Received: (qmail 24128 invoked by alias); 11 Nov 2010 10:44:21 -0000 Received: (qmail 24120 invoked by uid 22791); 11 Nov 2010 10:44:20 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, MIME_QP_LONG_LINE, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from c60.cesmail.net (HELO c60.cesmail.net) (216.154.195.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Nov 2010 10:44:14 +0000 Received: from unknown (HELO webmail2) ([192.168.1.183]) by c60.cesmail.net with ESMTP; 11 Nov 2010 05:43:58 -0500 Received: from 89.241.153.155 ([89.241.153.155]) by webmail.spamcop.net (Horde MIME library) with HTTP; Thu, 11 Nov 2010 05:44:53 -0500 Message-ID: <20101111054453.cw855i0c0o44cgck-nzlynne@webmail.spamcop.net> Date: Thu, 11 Nov 2010 05:44:53 -0500 From: Joern Rennecke To: gcc-patches@gcc.gnu.org, DJ Delorie Subject: Ping (mep): RFA: Fix remainder of PR target/44749 References: <20101104113812.ru0px57qgooo8kc4-nzlynne@webmail.spamcop.net> In-Reply-To: <20101104113812.ru0px57qgooo8kc4-nzlynne@webmail.spamcop.net> MIME-Version: 1.0 User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) 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 Ping? The remaining --enable-werror-always build failures for mep-elf are mostly due to having unexpected return types from REGNO_REG_CLASS and SECONDARY_{,INPUT_,OUTPUT_}RELOAD_CLASS. I first considered changing the machine-independent code, but that'd be a lot of changes. Apart from the m32c, the mep is the only port that defines REGNO_REG_CLASS to yield something that is not an enum reg_class. SECONDARY_{,INPUT_,OUTPUT_}RELOAD_CLASS are only legacy macros; only mep, m32c and mn10300 yeild something that is not an enum reg_class. I have considered changing the return type of mep_regno_reg_class to enum reg_class, but then it'd require a cast inside the function, and this would have to be changed With the appened patch added to revision 166313, I've successfully configured an i686-pc-linux-gnu X mep-elf compiler using --enable-werror-always and used 'make all-gcc' to build it, using gcc (GCC) 4.6.0 20101103 (experimental) as the build compiler. 2010-11-04 Joern Rennecke PR target/44749 * config/mep/mep-protos.h (mep_legitimize_reload_address): Always declare. Change type of argument four to type int. (mep_secondary_input_reload_class): Returns enum reg_class. (mep_secondary_output_reload_class): Likewise. (mep_function_value): Change types of arguments to cont_tree. * config/mep/mep.c (mep_legitimize_reload_address): Change type of argument four to type int. (mep_secondary_input_reload_class): Returns enum reg_class. (mep_secondary_output_reload_class): Likewise. (mep_function_value): Change types of arguments to cont_tree. * config/mep/mep.h (REGNO_REG_CLASS): Cast return value of mep_regno_reg_class to enum reg_class. Index: config/mep/mep-protos.h =================================================================== --- config/mep/mep-protos.h (revision 166313) +++ config/mep/mep-protos.h (working copy) @@ -35,9 +35,7 @@ extern bool mep_vliw_jmp_match (rtx); extern bool mep_multi_slot (rtx); extern bool mep_legitimate_address (enum machine_mode, rtx, int); extern int mep_legitimize_address (rtx *, rtx, enum machine_mode); -#ifdef MAX_RELOADS -extern int mep_legitimize_reload_address (rtx *, enum machine_mode, int, enum reload_type, int); -#endif +extern int mep_legitimize_reload_address (rtx *, enum machine_mode, int, /*enum reload_type*/ int, int); extern int mep_core_address_length (rtx, int); extern int mep_cop_address_length (rtx, int); extern bool mep_expand_mov (rtx *, enum machine_mode); @@ -51,8 +49,8 @@ extern bool mep_legitimate_constant_p (r extern const char *mep_emit_cbranch (rtx *, int); extern void mep_expand_call (rtx *, int); extern rtx mep_find_base_term (rtx); -extern int mep_secondary_input_reload_class (enum reg_class, enum machine_mode, rtx); -extern int mep_secondary_output_reload_class (enum reg_class, enum machine_mode, rtx); +extern enum reg_class mep_secondary_input_reload_class (enum reg_class, enum machine_mode, rtx); +extern enum reg_class mep_secondary_output_reload_class (enum reg_class, enum machine_mode, rtx); extern bool mep_secondary_memory_needed (enum reg_class, enum reg_class, enum machine_mode); extern void mep_expand_reload (rtx *, enum machine_mode); @@ -76,7 +74,7 @@ extern void mep_print_operand (FILE *, r extern void mep_final_prescan_insn (rtx, rtx *, int); extern void mep_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree); extern bool mep_return_in_memory (const_tree, const_tree); -extern rtx mep_function_value (tree, tree); +extern rtx mep_function_value (const_tree, const_tree); extern rtx mep_libcall_value (enum machine_mode); extern void mep_asm_output_opcode (FILE *, const char *); extern void mep_note_pragma_disinterrupt (const char *); Index: config/mep/mep.c =================================================================== --- config/mep/mep.c (revision 166313) +++ config/mep/mep.c (working copy) @@ -1270,9 +1270,11 @@ mep_legitimate_address (enum machine_mod int mep_legitimize_reload_address (rtx *x, enum machine_mode mode, int opnum, - enum reload_type type, + int type_i, int ind_levels ATTRIBUTE_UNUSED) { + enum reload_type type = (enum reload_type) type_i; + if (GET_CODE (*x) == PLUS && GET_CODE (XEXP (*x, 0)) == MEM && GET_CODE (XEXP (*x, 1)) == REG) @@ -2097,7 +2099,7 @@ mep_secondary_copro_reload_class (enum r /* Copying X to register in RCLASS. */ -int +enum reg_class mep_secondary_input_reload_class (enum reg_class rclass, enum machine_mode mode ATTRIBUTE_UNUSED, rtx x) @@ -2118,12 +2120,12 @@ mep_secondary_input_reload_class (enum r #if DEBUG_RELOAD fprintf (stderr, " - requires %s\n", reg_class_names[rv]); #endif - return rv; + return (enum reg_class) rv; } /* Copying register in RCLASS to X. */ -int +enum reg_class mep_secondary_output_reload_class (enum reg_class rclass, enum machine_mode mode ATTRIBUTE_UNUSED, rtx x) @@ -2145,7 +2147,7 @@ mep_secondary_output_reload_class (enum fprintf (stderr, " - requires %s\n", reg_class_names[rv]); #endif - return rv; + return (enum reg_class) rv; } /* Implement SECONDARY_MEMORY_NEEDED. */ @@ -3804,7 +3806,7 @@ mep_narrow_volatile_bitfield (void) /* Implement FUNCTION_VALUE. All values are returned in $0. */ rtx -mep_function_value (tree type, tree func ATTRIBUTE_UNUSED) +mep_function_value (const_tree type, const_tree func ATTRIBUTE_UNUSED) { if (TARGET_IVC2 && VECTOR_TYPE_P (type)) return gen_rtx_REG (TYPE_MODE (type), 48); Index: config/mep/mep.h =================================================================== --- config/mep/mep.h (revision 166313) +++ config/mep/mep.h (working copy) @@ -401,7 +401,7 @@ enum reg_class { 0xffffffff, 0xffffffff, 0xffffffff, 0x0001ffff }, /* ALL_REGS */ \ } -#define REGNO_REG_CLASS(REGNO) mep_regno_reg_class (REGNO) +#define REGNO_REG_CLASS(REGNO) (enum reg_class) mep_regno_reg_class (REGNO) #define IRA_COVER_CLASSES { GENERAL_REGS, CONTROL_REGS, CR_REGS, CCR_REGS, LIM_REG_CLASSES }