This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Group static constructors and destructors in specific subsections, take 2


On Tue, Nov 23, 2010 at 12:09 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sat, Nov 20, 2010 at 5:12 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
>>
>> Hi,
>> this is updated patch. ?I addressed, I hope, all the comments except for
>> removing USE_SELECT_SECTION_FOR_FUNCTIONS. I am somewhat confused by darwin and
>> thus would like to handle it incrementally.
>>
>> I've removed the subsection hash, the string concatenations and section hash
>> should be fast enough given that we switch twice per function at most. ?I also
>> added flag to tree_decl_with_vis specifying whether section name is implied by
>> -ffunction-sections or given by user and made default_function_section to do
>> text.unlikely.function_name by default. ?I kept adding the _unlikely only for
>> darwin. ?It was developed there and I suppose the funny suffixes do have
>> meaning for darwin linker.
>>
>> Bootstrapped/regtested x86_64-linux, OK (after testing darwin and ia64)?
>>
>> Honza
>>
>> ? ? ? ?* tree.h (DECL_HAS_IMPLICIT_SECTION_NAME_P): New macro.
>> ? ? ? ?(tree_decl_with_vis): Add implicit_section_name_p.
>> ? ? ? ?* targhooks.h (default_function_section): Declare.
>> ? ? ? ?* target.def (function_section): New hook.
>> ? ? ? ?* defaults.h (HOT_TEXT_SECTION_NAME,
>> ? ? ? ?UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove.
>> ? ? ? ?* predict.c (choose_function_section): Remove.
>> ? ? ? ?(estimate_bb_frequencies): Do not use choose_function_section.
>> ? ? ? ?* coretypes.h (enum node_frequency): Move here from cgraph.h
>> ? ? ? ?* cgraph.h (enum node_frequency): Remove.
>> ? ? ? ?* varasm.c (initialize_cold_section_name, unlikely_text_section,
>> ? ? ? ?unlikely_text_section_p): Remove.
>> ? ? ? ?(named_subsection_entry): New structure.
>> ? ? ? ?(get_text_section): New function.
>> ? ? ? ?(default_function_section): New function.
>> ? ? ? ?(function_section_1): Break out from ...; handle profile info.
>> ? ? ? ?(function_section): ... here.
>> ? ? ? ?(unlikely_text_section): Remove.
>> ? ? ? ?(unlikely_text_section_p): Use function_section_1.
>> ? ? ? ?(assemble_start_function): Do not initialize cold section.
>> ? ? ? ?(default_section_type_flags): Do not special case cold subsection.
>> ? ? ? ?(switch_to_section): Likewise.
>> ? ? ? ?* output.h (get_text_section): Define.
>> ? ? ? ?* config/i386/winnt.c: Do not special case cold section.
>> ? ? ? ?* config/darwin-protos.h (darwin_function_section): Declare.
>> ? ? ? ?* config/microblaze/microblaze.h (HOT_TEXT_SECTION_NAME,
>> ? ? ? ?UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove.
>> ? ? ? ?* config/ia64/hpux.h (HOT_TEXT_SECTION_NAME,
>> ? ? ? ?UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove.
>> ? ? ? ?(TARGET_ASM_FUNCTION_SECTION): Define to ia64_hpux_function_section.
>> ? ? ? ?* config/ia64/ia64.c (ia64_hpux_function_section): New function.
>> ? ? ? ?* config/ia64/ia64-protos.h (ia64_hpux_function_section): Define.
>> ? ? ? ?* config/darwin.c (machopic_select_section): Use
>> ? ? ? ?darwin_function_section.
>> ? ? ? ?(darwin_function_section): New function.
>> ? ? ? ?* config/darwin.h (HOT_TEXT_SECTION_NAME,
>> ? ? ? ?UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove.
>> ? ? ? ?(TARGET_ASM_FUNCTION_SECTION): Define.
>
> This caused:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46628
>

This also caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46667


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]