From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3361 invoked by alias); 10 Jul 2009 00:45:36 -0000 Received: (qmail 3351 invoked by uid 22791); 10 Jul 2009 00:45:35 -0000 X-SWARE-Spam-Status: No, hits=-51.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Jul 2009 00:45:26 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6A0jOcu011810; Thu, 9 Jul 2009 20:45:24 -0400 Received: from greed.delorie.com (vpn-9-98.rdu.redhat.com [10.11.9.98]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6A0jNsc022790; Thu, 9 Jul 2009 20:45:23 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1] (may be forged)) by greed.delorie.com (8.14.3/8.14.3) with ESMTP id n6A0jNfM027910; Thu, 9 Jul 2009 20:45:23 -0400 Received: (from dj@localhost) by greed.delorie.com (8.14.3/8.14.3/Submit) id n6A0jN0G027907; Thu, 9 Jul 2009 20:45:23 -0400 Date: Fri, 10 Jul 2009 00:45:00 -0000 Message-Id: <200907100045.n6A0jN0G027907@greed.delorie.com> From: DJ Delorie To: Ian Lance Taylor CC: gcc@gcc.gnu.org In-reply-to: (message from Ian Lance Taylor on Wed, 08 Jul 2009 21:29:30 -0700) Subject: Re: TARGET_OPTION_CAN_INLINE_P vs TARGET_CAN_INLINE_P References: <200907090219.n692JYkr030927@greed.delorie.com> X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-07/txt/msg00181.txt.bz2 > The OPTION is there because this was introduced for the option > attribute. But the entry in the target structure is named > can_inline_p, and the macro should be TARGET_CAN_INLINE_P. So the > doc is the desired state, and the code is not. How's this? * targhooks.c (default_target_can_inline_p): Rename from default_target_option_can_inline_p. * targhooks.h (default_target_can_inline_p): Likewise. * target-def.h (TARGET_CAN_INLINE_P): Rename from TARGET_OPTION_CAN_INLINE_P. * config/i386/i386.c (TARGET_CAN_INLINE_P): Likewise. * config/mep/mep.c (TARGET_CAN_INLINE_P): Likewise. (mep_target_can_inline_p): Rename from mep_target_option_can_inline_p. Index: targhooks.c =================================================================== --- targhooks.c (revision 149452) +++ targhooks.c (working copy) @@ -768,13 +768,13 @@ default_target_option_pragma_parse (tree "#pragma GCC target is not supported for this machine"); return false; } bool -default_target_option_can_inline_p (tree caller, tree callee) +default_target_can_inline_p (tree caller, tree callee) { bool ret = false; tree callee_opts = DECL_FUNCTION_SPECIFIC_TARGET (callee); tree caller_opts = DECL_FUNCTION_SPECIFIC_TARGET (caller); /* If callee has no option attributes, then it is ok to inline */ Index: targhooks.h =================================================================== --- targhooks.h (revision 149452) +++ targhooks.h (working copy) @@ -104,8 +104,8 @@ extern int default_reloc_rw_mask (void); extern tree default_mangle_decl_assembler_name (tree, tree); extern tree default_emutls_var_fields (tree, tree *); extern tree default_emutls_var_init (tree, tree, tree); extern bool default_hard_regno_scratch_ok (unsigned int); extern bool default_target_option_valid_attribute_p (tree, tree, tree, int); extern bool default_target_option_pragma_parse (tree, tree); -extern bool default_target_option_can_inline_p (tree, tree); +extern bool default_target_can_inline_p (tree, tree); extern unsigned int default_case_values_threshold (void); Index: target-def.h =================================================================== --- target-def.h (revision 149452) +++ target-def.h (working copy) @@ -824,24 +824,24 @@ #endif #ifndef TARGET_OPTION_PRAGMA_PARSE #define TARGET_OPTION_PRAGMA_PARSE default_target_option_pragma_parse #endif -#ifndef TARGET_OPTION_CAN_INLINE_P -#define TARGET_OPTION_CAN_INLINE_P default_target_option_can_inline_p +#ifndef TARGET_CAN_INLINE_P +#define TARGET_CAN_INLINE_P default_target_can_inline_p #endif #define TARGET_OPTION_HOOKS \ { \ TARGET_OPTION_VALID_ATTRIBUTE_P, \ TARGET_OPTION_SAVE, \ TARGET_OPTION_RESTORE, \ TARGET_OPTION_PRINT, \ TARGET_OPTION_PRAGMA_PARSE, \ - TARGET_OPTION_CAN_INLINE_P, \ + TARGET_CAN_INLINE_P, \ } /* The whole shebang. */ #define TARGET_INITIALIZER \ { \ TARGET_ASM_OUT, \ Index: config/mep/mep.c =================================================================== --- config/mep/mep.c (revision 149453) +++ config/mep/mep.c (working copy) @@ -167,13 +167,13 @@ static tree mep_validate_based_tiny (tre static tree mep_validate_near_far (tree *, tree, tree, int, bool *); static tree mep_validate_disinterrupt (tree *, tree, tree, int, bool *); static tree mep_validate_interrupt (tree *, tree, tree, int, bool *); static tree mep_validate_io_cb (tree *, tree, tree, int, bool *); static tree mep_validate_vliw (tree *, tree, tree, int, bool *); static bool mep_function_attribute_inlinable_p (const_tree); -static bool mep_option_can_inline_p (tree, tree); +static bool mep_can_inline_p (tree, tree); static bool mep_lookup_pragma_disinterrupt (const char *); static int mep_multiple_address_regions (tree, bool); static int mep_attrlist_to_encoding (tree, tree); static void mep_insert_attributes (tree, tree *); static void mep_encode_section_info (tree, rtx, int); static section * mep_select_section (tree, int, unsigned HOST_WIDE_INT); @@ -233,14 +233,14 @@ static tree mep_gimplify_va_arg_expr (tr #undef TARGET_COMP_TYPE_ATTRIBUTES #define TARGET_COMP_TYPE_ATTRIBUTES mep_comp_type_attributes #undef TARGET_INSERT_ATTRIBUTES #define TARGET_INSERT_ATTRIBUTES mep_insert_attributes #undef TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P #define TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P mep_function_attribute_inlinable_p -#undef TARGET_OPTION_CAN_INLINE_P -#define TARGET_OPTION_CAN_INLINE_P mep_option_can_inline_p +#undef TARGET_CAN_INLINE_P +#define TARGET_CAN_INLINE_P mep_can_inline_p #undef TARGET_SECTION_TYPE_FLAGS #define TARGET_SECTION_TYPE_FLAGS mep_section_type_flags #undef TARGET_ASM_NAMED_SECTION #define TARGET_ASM_NAMED_SECTION mep_asm_named_section #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS mep_init_builtins @@ -4107,13 +4107,13 @@ mep_function_attribute_inlinable_p (cons if (!attrs) attrs = DECL_ATTRIBUTES (callee); return (lookup_attribute ("disinterrupt", attrs) == 0 && lookup_attribute ("interrupt", attrs) == 0); } static bool -mep_option_can_inline_p (tree caller, tree callee) +mep_can_inline_p (tree caller, tree callee) { if (TREE_CODE (callee) == ADDR_EXPR) callee = TREE_OPERAND (callee, 0); if (TREE_CODE (callee) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (callee) Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 149452) +++ config/i386/i386.c (working copy) @@ -30586,14 +30586,14 @@ ix86_enum_va_list (int idx, const char * #undef TARGET_OPTION_RESTORE #define TARGET_OPTION_RESTORE ix86_function_specific_restore #undef TARGET_OPTION_PRINT #define TARGET_OPTION_PRINT ix86_function_specific_print -#undef TARGET_OPTION_CAN_INLINE_P -#define TARGET_OPTION_CAN_INLINE_P ix86_can_inline_p +#undef TARGET_CAN_INLINE_P +#define TARGET_CAN_INLINE_P ix86_can_inline_p #undef TARGET_EXPAND_TO_RTL_HOOK #define TARGET_EXPAND_TO_RTL_HOOK ix86_maybe_switch_abi #undef TARGET_LEGITIMATE_ADDRESS_P #define TARGET_LEGITIMATE_ADDRESS_P ix86_legitimate_address_p