Age | Commit message (Collapse) | Author | Files | Lines |
|
* targhooks.h (default_emutls_var_fields,
default_emutls_var_init): Declare.
* tree.h (DECL_THREAD_LOCAL): Compare against TLS_MODEL_REAL.
* target.h (struct gcc_target): Add struct emutls member.
* target-def.h (TARGET_EMUTLS_GET_ADDRESS,
TARGET_EMUTLS_REGISTER_COMMON, TARGET_EMUTLS_VAR_SECTION,
TARGET_EMUTLS_TMPL_SECTION, TARGET_EMUTLS_VAR_PREFIX,
TARGET_EMUTLS_TMPL_PREFIX, TARGET_EMUTLS_VAR_FIELDS,
TARGET_EMUTLS_VAR_INIT, TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS,
TARGET_EMUTLS_VAR_ALIGN_FIXED, TARGET_EMUTLS): New.
(TARGET_INITIALIZER): Add TARGET_EMUTLS.
* builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS,
BUILT_IN_EMUTLS_REGISTER_COMMON): Get name from targetm structure.
* dwarf2out.c (loc_descriptor_from_tree_1): Check if emutls can
emit debug information.
* coretypes.h (tls_model): Add TLS_MODEL_EMULATED, TLS_MODEL_REAL.
* varasm.c: Include targhooks.h.
(emutls_object_section, emutls_tmpl_section): New.
(EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): Remove.
(EMUTLS_SEPARATOR): New.
(prefix_name): New.
(get_emutls_object_name): New.
(default_emutls_var_fields): New, broken out of ...
(get_emutls_object_type): ... here. Adjust to use target hooks.
(get_emutls_init_templ_addr): Adjust to use target hooks.
(emutls_decl): Adjust to use target hooks.
(emutls_finish): Likewise.
(default_emutls_var_init): New, broken out of ...
(assemble_variable): ... here. Adjust to use target hooks.
* output.h (enum section_category): Add SECCAT_EMUTLS_VAR,
SECCAT_EMUTLS_TMPL.
* c-common.c (handle_section_attribute): Prevent overriding
sections for emulated tls with special sections.
* config/i386/i386.c (x86_64_elf_select_section): Add
SECCAT_EMUTLS_VAR and SECCAT_EMUTLS_TMPL.
(x86_64_elf_unique_section): Likewise.
* config/vxworks.c: Include tree.h.
(vxworks_emutls_var_fields, vxworks_emutls_var_init): New.
(vxworks_override_options): Set TLS scheme.
* gcc/doc/tm.texi (Emulated TLS): New node.
gcc/testsuite/
* gcc.dg/tls/section-2.c: New.
* gcc.dg/tls/emutls-1.c: New.
* lib/target-supports.exp (check_effective_target_tls_native):
Exclude vxworks.
From-SVN: r134729
|
|
* config/alpha/alpha.c (alpha_mangle_type, decl_has_samegp,
alpha_in_small_data_p, alpha_split_complex_arg,
alpha_stdarg_optimize_hook, TARGET_ASM_CAN_OUTPUT_MI_THUNK):
Constify.
* config/arm/arm-protos.h (arm_mangle_type): Likewise.
* config/arm/arm.c (arm_comp_type_attributes, arm_mangle_type):
Likewise.
* config/bfin/bfin.c (funkind, bfin_comp_type_attributes,
TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise.
* config/darwin-protos.h (darwin_binds_local_p): Likewise.
* config/darwin.c (darwin_binds_local_p): Likewise.
* config/frv/frv.c (frv_string_begins_with, frv_in_small_data_p):
Likewise.
* config/i386/i386-protos.h (i386_pe_binds_local_p,
i386_pe_valid_dllimport_attribute_p): Likewise.
* config/i386/i386.c (ix86_function_regparm,
ix86_comp_type_attributes, ix86_ms_bitfield_layout_p,
x86_can_output_mi_thunk, ix86_mangle_type,
TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise.
* config/i386/winnt.c (i386_pe_valid_dllimport_attribute_p,
i386_pe_binds_local_p): Likewise.
* config/ia64/ia64.c
(ia64_first_cycle_multipass_dfa_lookahead_guard_spec,
ia64_needs_block_p, ia64_in_small_data_p, ia64_mangle_type,
ia64_invalid_conversion, ia64_invalid_unary_op,
ia64_invalid_binary_op, TARGET_ASM_CAN_OUTPUT_MI_THUNK):
Likewise.
* config/m32c/m32c.c (m32c_comp_type_attributes): Likewise.
* config/m32r/m32r.c (m32r_in_small_data_p): Likewise.
* config/m68k/m68k.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise.
* config/mips/mips.c (mips_use_blocks_for_constant_p,
mips_in_small_data_p, mips_use_anchors_for_symbol_p,
mips_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK,
mips_near_type_p, mips_far_type_p, mips_global_symbol_p,
mips_symbol_binds_local_p, mips_classify_symbol): Likewise.
* config/pa/pa.c (pa_commutative_p): Likewise.
* config/rs6000/rs6000-protos.h (rs6000_elf_in_small_data_p):
Likewise.
* config/rs6000/rs6000.c (rs6000_invalid_within_doloop,
rs6000_ms_bitfield_layout_p, rs6000_mangle_type,
rs6000_use_blocks_for_constant_p,
rs6000_vector_alignment_reachable, rs6000_is_opaque_type,
invalid_arg_for_unprototyped_fn, TARGET_ASM_CAN_OUTPUT_MI_THUNK,
TARGET_SPLIT_COMPLEX_ARG, rs6000_elf_in_small_data_p): Likewise.
* config/s390/s390.c (s390_mangle_type,
TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_INVALID_WITHIN_DOLOOP):
Likewise.
* config/score/score.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK,
th_in_small_data_p): Likewise.
* config/sh/sh.c (sh_ms_bitfield_layout_p,
sh_dwarf_calling_convention, TARGET_ASM_CAN_OUTPUT_MI_THUNK):
Likewise.
* config/sparc/sparc.c (sparc_can_output_mi_thunk,
sparc_mangle_type): Likewise.
* config/spu/spu.c (spu_vector_alignment_reachable): Likewise.
* config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): Likewise.
* emit-rtl.c (const_fixed_htab_hash, const_fixed_htab_eq):
Likewise.
* hooks.c (hook_bool_mode_const_rtx_false,
hook_bool_mode_const_rtx_true,
hook_bool_const_tree_hwi_hwi_const_tree_false,
hook_bool_const_tree_hwi_hwi_const_tree_true,
hook_int_const_tree_0, hook_int_const_tree_const_tree_1,
hook_constcharptr_const_tree_null,
hook_constcharptr_const_rtx_null,
hook_constcharptr_const_tree_const_tree_null,
hook_constcharptr_int_const_tree_null,
hook_constcharptr_int_const_tree_const_tree_null): New.
(hook_bool_mode_rtx_false, hook_bool_mode_rtx_true,
hook_bool_tree_hwi_hwi_tree_false,
hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0,
hook_int_tree_tree_1, hook_constcharptr_tree_null,
hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null,
hook_constcharptr_int_tree_null,
hook_constcharptr_int_tree_tree_null): Delete.
(default_can_output_mi_thunk_no_vcall): Constify.
* hooks.h (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true,
hook_bool_tree_hwi_hwi_tree_false,
hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0,
hook_int_tree_tree_1, hook_constcharptr_tree_null,
hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null,
hook_constcharptr_int_tree_null,
hook_constcharptr_int_tree_tree_null): Delete.
(hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true,
hook_bool_const_tree_hwi_hwi_const_tree_false,
hook_bool_const_tree_hwi_hwi_const_tree_true,
hook_int_const_tree_0, hook_int_const_tree_const_tree_1,
hook_constcharptr_const_tree_null,
hook_constcharptr_const_rtx_null,
hook_constcharptr_const_tree_const_tree_null,
hook_constcharptr_int_const_tree_null,
hook_constcharptr_int_const_tree_const_tree_null): New.
(default_can_output_mi_thunk_no_vcall): Constify.
* integrate.c (function_attribute_inlinable_p): Likewise.
* integrate.h (function_attribute_inlinable_p): Likewise.
* jump.c (rtx_renumbered_equal_p): Likewise.
* output.h (decl_readonly_section, categorize_decl_for_section,
default_use_anchors_for_symbol_p, default_binds_local_p,
default_binds_local_p_1): Likewise.
* rtl.h (rtx_renumbered_equal_p, decl_default_tls_model):
Likewise.
* target-def.h (TARGET_ASM_CAN_OUTPUT_MI_THUNK,
TARGET_VALID_DLLIMPORT_ATTRIBUTE_P, TARGET_VECTOR_OPAQUE_P,
TARGET_COMMUTATIVE_P, TARGET_USE_BLOCKS_FOR_CONSTANT_P,
TARGET_COMP_TYPE_ATTRIBUTES,
TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P,
TARGET_MS_BITFIELD_LAYOUT_P, TARGET_MANGLE_TYPE,
TARGET_IN_SMALL_DATA_P, TARGET_INVALID_CONVERSION,
TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP,
TARGET_DWARF_CALLING_CONVENTION): Likewise.
* target.h (can_output_mi_thunk, needs_block_p,
first_cycle_multipass_dfa_lookahead_guard_spec,
vector_alignment_reachable, comp_type_attributes,
function_attribute_inlinable_p, ms_bitfield_layout_p, mangle_type,
commutative_p, use_blocks_for_constant_p,
use_anchors_for_symbol_p, in_small_data_p, binds_local_p,
vector_opaque_p, dwarf_calling_convention, stdarg_optimize_hook,
invalid_within_doloop, valid_dllimport_attribute_p,
split_complex_arg, invalid_arg_for_unprototyped_fn,
invalid_conversion, invalid_unary_op, invalid_binary_op):
Likewise.
* targhooks.c (default_invalid_within_doloop,
hook_invalid_arg_for_unprototyped_fn,
default_builtin_vector_alignment_reachable): Likewise.
(hook_bool_rtx_commutative_p): Delete.
(hook_bool_const_rtx_commutative_p): New.
* targhooks.h (default_invalid_within_doloop,
default_builtin_vector_alignment_reachable,
hook_invalid_arg_for_unprototyped_fn): Constify.
(hook_bool_rtx_commutative_p): Delete.
(hook_bool_const_rtx_commutative_p): New.
* varasm.c (bss_initializer_p, decl_default_tls_model,
categorize_decl_for_section, decl_readonly_section,
default_use_anchors_for_symbol_p, default_binds_local_p,
default_binds_local_p_1): Constify.
From-SVN: r127785
|
|
* attribs.c (hash_attr, eq_attr, init_attributes): Constify.
* builtins.c (validate_arg, builtin_mathfn_code,
validate_arglist): Likewise.
* calls.c (call_expr_flags): Likewise.
* combine.c (reg_nonzero_bits_for_combine,
reg_num_sign_bit_copies_for_combine, get_last_value,
reg_truncated_to_mode): Likewise.
* emit-rtl.c (subreg_lowpart_p): Likewise.
* expr.c (highest_pow2_factor_for_target,
categorize_ctor_elements_1, categorize_ctor_elements,
count_type_elements, contains_packed_reference,
highest_pow2_factor, highest_pow2_factor_for_target): Likewise.
* fold-const.c (may_negate_without_overflow_p, int_const_binop,
fold_convertible_p, operand_equal_p, tree_swap_operands_p,
native_encode_int, native_encode_real, native_encode_complex,
native_encode_vector, native_encode_expr, native_interpret_int,
native_interpret_real, native_interpret_complex,
native_interpret_vector, native_interpret_expr): Likewise.
* function.c (use_register_for_decl): Likewise.
* gimplify.c (get_name): Likewise.
* langhooks-def.h (lhd_return_null_const_tree): New.
(LANG_HOOKS_GET_CALLEE_FNDECL): Use it.
* langhooks.c (lhd_return_null_const_tree): New.
* langhooks.h (lang_get_callee_fndecl): Constify.
* output.h (constructor_static_from_elts_p): Likewise.
* rtl-factoring.c (gen_symbol_ref_rtx_for_label): Likewise.
* rtl.h (nonzero_bits, num_sign_bit_copies, truncated_to_mode,
subreg_lowpart_p, noop_move_p, struct rtl_hooks): Likewise.
* rtlanal.c (cached_nonzero_bits, nonzero_bits1,
cached_num_sign_bit_copies, num_sign_bit_copies1, noop_move_p,
nonzero_bits, num_sign_bit_copies, truncated_to_mode): Likewise.
* rtlhooks-def.h (reg_nonzero_bits_general,
reg_num_sign_bit_copies_general, reg_truncated_to_mode_general):
Likewise.
* rtlhooks.c (reg_num_sign_bit_copies_general,
reg_nonzero_bits_general, reg_truncated_to_mode_general):
Likewise.
* stmt.c (warn_if_unused_value, is_body_block): Likewise.
* stor-layout.c (mode_for_size_tree): Likewise.
* tree-ssa-loop-im.c (memref_eq): Likewise.
* tree-ssa-loop-ivopts.c (tree_int_cst_sign_bit): Likewise.
* tree.c (contains_placeholder_p, type_list_equal,
simple_cst_equal, get_callee_fndecl, operand_equal_for_phi_arg_p):
Likewise.
* tree.h (tree_int_cst_sign_bit, may_negate_without_overflow_p,
mode_for_size_tree, categorize_ctor_elements, count_type_elements,
contains_placeholder_p, contains_packed_reference,
get_callee_fndecl, operand_equal_for_phi_arg_p,
warn_if_unused_value, is_body_block, native_encode_expr,
native_interpret_expr, fold_convertible_p, operand_equal_p,
int_const_binop, tree_swap_operands_p, builtin_mathfn_code,
validate_arglist, simple_cst_equal, type_list_equal,
use_register_for_decl, call_expr_flags, get_name,
highest_pow2_factor): Likewise.
(const_call_expr_arg_iterator_d,
init_const_call_expr_arg_iterator, next_const_call_expr_arg,
first_const_call_expr_arg, more_const_call_expr_args_p,
FOR_EACH_CONST_CALL_EXPR_ARG): New.
* varasm.c (constructor_static_from_elts_p): Constify.
cp:
* parser.c (eof_token): Un-constify.
(cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
casts.
java:
* lang.c (java_get_callee_fndecl): Constify.
objc:
* objc-act.c (objc_get_callee_fndecl): Constify.
* objc-act.h (objc_get_callee_fndecl): Likewise.
From-SVN: r127036
|
|
License and to point readers at the COPYING3 file and the FSF's license web page.
From-SVN: r126948
|
|
From-SVN: r125624
|
|
PR target/26090
* target.h (targetm.asm.out.reloc_rw_mask): New.
* target-def.h (TARGET_ASM_RELOC_RW_MASK): New.
(TARGET_ASM_OUT): Use it.
* targhooks.c, targhooks.h (default_reloc_rw_mask): New.
* varasm.c (categorize_decl_for_section): Remove shlib argument;
use the new reloc_rw_mask target hook instead.
(default_section_type_flags_1): Merge into...
(default_section_type_flags): ... here.
(decl_readonly_section_1): Merge into...
(decl_readonly_section): ... here.
(default_elf_select_section_1): Merge into...
(default_elf_select_section): ... here.
(default_unique_section_1): Merge into...
(default_unique_section): ... here.
(compute_reloc_for_rtx_1, compute_reloc_for_rtx): New.
(default_select_rtx_section): Use it.
(default_elf_select_rtx_section): Likewise.
* output.h: Update to match.
* doc/tm.texi (TARGET_ASM_RELOC_RW_MASK): New.
* config/alpha/alpha.c (alpha_elf_reloc_rw_mask): New.
(TARGET_ASM_RELOC_RW_MASK): New.
* config/i386/i386.c (x86_64_elf_select_section): Adjust call
to categorize_decl_for_section.
(x86_64_elf_unique_section): Likewise.
* config/ia64/hpux.h (TARGET_ASM_SELECT_SECTION,
TARGET_ASM_UNIQUE_SECTION, TARGET_ASM_SELECT_RTX_SECTION): Remove.
(TARGET_ASM_RELOC_RW_MASK): New.
* config/ia64/ia64.c (ia64_rwreloc_select_section,
ia64_rwreloc_unique_section, ia64_rwreloc_select_rtx_section): Remove.
(ia64_hpux_reloc_rw_mask, ia64_reloc_rw_mask): New.
(TARGET_RWRELOC): Remove.
(ia64_section_type_flags): Adjust call to default_section_type_flags.
* config/ia64/sysv4.h (TARGET_ASM_RELOC_RW_MASK): New.
* config/rs6000/rs6000.c (rs6000_elf_section_type_flags): Remove.
(rs6000_elf_select_section, rs6000_elf_unique_section): Remove.
(rs6000_elf_reloc_rw_mask, rs6000_xcoff_reloc_rw_mask): New.
(rs6000_xcoff_select_section): Use decl_readonly_section.
(rs6000_xcoff_section_type_flags): Use default_section_type_flags.
* config/rs6000/sysv4.h (TARGET_ASM_RELOC_RW_MASK): New.
(TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): Remove.
(TARGET_SECTION_TYPE_FLAGS): Remove.
* config/rs6000/xcoff.h (TARGET_ASM_RELOC_RW_MASK): New.
From-SVN: r122781
|
|
initalization and optimization)
2007-03-08 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C/31072
* c-decl.c (merge_decls): Don't call make_var_volatile.
* varasm.c (make_var_volatile): Remove.
* output.h (make_var_volatile): Remove.
2007-03-08 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C/31072
* gcc.c-torture/execute/pr31072.c: New test.
From-SVN: r122736
|
|
* output.h (assemble_addr_to_section): Declare.
(get_cdtor_priority_section): Likewise.
* varasm.c (assemble_addr_to_section): New function.
(get_cdtor_priority_section): Likewise.
(default_named_section_asm_out_destructor): Use them.
(destor_dtor_section_asm_out_destructor): Likewise.
(default_named_section_asm_out_constructor): Likewise.
(default_ctor_section_asm_out_constructor): Likewise.
* config.gcc (*-*-vxworks*): Include vxworks.o.
* config/t-vxworks (vxworks.o): New target.
* config/vxworks.h (ALWAYS_NUMBER_CTORS_SECTIONS): Remove.
(TARGET_ASM_CONSTRUCTOR): Define.
(TARGET_ASM_DESTRUCTOR): Likewise.
(vxworks_asm_out_constructor): Declare.
(vxworks_asm_out_destructor): Likewise.
* c-common.c (get_priority): Check that we have not just an
INTEGER_CST, but an integer constant with integeral type.
* gcc.dg/vxworks/vxworks.exp: New file.
* gcc.dg/vxworks/initpri1.c: Likewise.
* gcc.dg/vxworks/initpri2.c: Likewise.
* gcc.dg/initpri2.c: Add more tests.
* g++.dg/special/initpri2.C: Likewise.
From-SVN: r122335
|
|
gcc/ChangeLog:
* Makefile.in (libgcc-support, libgcc.mvars): Add emutls.c.
* builtin-types.def (BT_WORD): Make unsigned.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
* builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS): New.
(BUILT_IN_EMUTLS_REGISTER_COMMON): New.
* c-decl.c (grokdeclarator): Don't error if !have_tls.
* c-parser.c (c_parser_omp_threadprivate): Likewise.
* dwarf2out.c (loc_descriptor_from_tree_1): Don't do anything for
emulated tls.
* expr.c (emutls_var_address): New.
(expand_expr_real_1): Expand emulated tls.
(expand_expr_addr_expr_1): Likewise.
* libgcc-std.ver: Add __emutls_get_address, __emutls_register_common.
* output.h (emutls_finish): Declare.
* toplev.c (compile_file): Call it.
* tree-ssa-address.c (gen_addr_rtx): Check for const-ness of the
address before wrapping in CONST.
* varasm.c (emutls_htab, emutls_object_type): New.
(EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): New.
(get_emutls_object_name, get_emutls_object_type): New.
(get_emutls_init_templ_addr, emutls_decl): New.
(emutls_common_1, emutls_finish): New.
(assemble_variable): When emulating tls, swap decls; generate
constructor for the emutls objects.
(do_assemble_alias): When emulating tls, swap decl and target name.
(default_encode_section_info): Don't add SYMBOL_FLAG_TLS_SHIFT
for emulated tls.
* varpool.c (decide_is_variable_needed): Look at force_output.
Recurse for emulated tls.
(cgraph_varpool_remove_unreferenced_decls): Remove checks redundant
with decide_is_variable_needed.
* emutls.c: New file.
* config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): Only emit
tls_object for real tls.
gcc/cp/ChangeLog:
* decl.c (grokvardecl): Don't error if !have_tls.
(grokdeclarator): Likewise.
* parser.c (cp_parser_omp_threadprivate): Likewise.
gcc/fortran/ChangeLog:
* f95-lang.c (gfc_init_builtin_functions): Add __emutls_get_address
and __emutls_register_common.
* openmp.c (gfc_match_omp_threadprivate): Don't error if !have_tls.
* trans-common.c (build_common_decl): Don't check have_tls.
* trans-decl.c (gfc_finish_var_decl): Likewise.
* types.def (BT_WORD, BT_FN_PTR_PTR): New.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
gcc/testsuite/ChangeLog:
* lib/target-supports.exp (check_effective_target_tls): Redefine
to mean non-emulated tls.
* gcc.dg/tls/alias-1.c: Remove tls requirement.
* gcc.dg/tls/asm-1.c, gcc.dg/tls/debug-1.c, gcc.dg/tls/diag-1.c,
gcc.dg/tls/diag-2.c, gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c,
gcc.dg/tls/diag-5.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
gcc.dg/tls/opt-10.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c, gcc.dg/tls/pic-1.c,
gcc.dg/tls/struct-1.c, gcc.dg/tls/trivial.c: Likewise.
From-SVN: r121800
|
|
* target.h (globalize_decl_name): New.
* target-def.h (TARGET_ASM_GLOBALIZE_DECL_NAME): New.
* output.h (default_globalize_decl_name): New.
* varasm.c (asm_output_bss): Use globalize_decl_name instead of
globalize_label.
(globalize_decl): Ditto.
(default_globalize_decl_name): New.
* config/ia64/ia64.c (ia64_globalize_decl_name): New.
(ia64_handle_version_id_attribute): New.
(TARGET_ASM_GLOBALIZE_DECL_NAME): New.
(ia64_asm_output_external): Use globalize_decl_name instead
of globalize_label.
* doc/extend.texi (version_id): New pragma.
* doc/tm.texi (ARGET_ASM_GLOBALIZE_DECL_NAME): New target hook.
From-SVN: r121128
|
|
* cgraphunit.c, config/i386/i386.c, config/ia64/ia64.c, cse.c,
output.h, toplev.c, tree-affine.h, tree-flow.h,
tree-ssa-alias.c, tree-ssa-coalesce.c, tree-ssa-live.c,
tree-ssa-live.h, tree-ssa-operands.c, tree-ssa-ter.c,
tree-vrp.c, varpool.c: Fix comment typos.
From-SVN: r120137
|
|
output time)
2006-12-11 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/17982
PR middle-end/20218
* cgraphunit.c (cgraph_optimize): Remove call to
process_pending_assemble_externals.
* config/elfos.h (ASM_OUTPUT_EXTERNAL): New.
* config/ia64/hpux.h (TARGET_ASM_FILE_END): Removed.
* config/ia64/ia64.c (ia64_asm_output_external): Rewritten.
(ia64_hpux_add_extern_decl): Removed.
(ia64_hpux_file_end): Likewise.
(extern_func_list): Likewise.
(extern_func_head): Likewise.
* output.h (assemble_external): Update comments.
(default_elf_asm_output_external): New.
(maybe_assemble_visibility): New.
* toplev.c (compile_file): Update comment.
* varasm.c (assemble_external): Always put it on
pending_assemble_externals.
(maybe_assemble_visibility): Make it extern and return int.
(default_elf_asm_output_external): New.
From-SVN: r119764
|
|
From-SVN: r117578
|
|
gcc/
* Makefile.in (libgcc.mk, LIBGCC_DEPS): Add emutls.c.
* builtin-types.def (BT_WORD): Make unsigned.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
* builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS): New.
(BUILT_IN_EMUTLS_REGISTER_COMMON): New.
* c-decl.c (grokdeclarator): Don't error if !have_tls.
* c-parser.c (c_parser_omp_threadprivate): Likewise.
* cgraph.c (decide_is_variable_needed): Look at force_output.
Recurse for emulated tls.
* cgraphunit.c (cgraph_varpool_remove_unreferenced_decls): Remove
checks redundant with decide_is_variable_needed.
(cgraph_build_static_cdtor): Do cgraph_varpool_assemble_pending_decls.
* dwarf2out.c (loc_descriptor_from_tree_1): Don't do anything for
emulated tls.
* expr.c (emutls_var_address): New.
(expand_expr_real_1): Expand emulated tls.
(expand_expr_addr_expr_1): Likewise.
* libgcc-std.ver: Add __emutls_get_address, __emutls_register_common.
* output.h (emutls_finish): Declare.
* toplev.c (compile_file): Call it.
* tree-ssa-address.c (gen_addr_rtx): Check for const-ness of the
address before wrapping in CONST.
* varasm.c (emutls_htab, emutls_object_type): New.
(EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): New.
(get_emutls_object_name, get_emutls_object_type): New.
(get_emutls_init_templ_addr, emutls_decl): New.
(emutls_common_1, emutls_finish): New.
(assemble_variable): When emulating tls, swap decls; generate
constructor for the emutls objects.
(do_assemble_alias): When emulating tls, swap decl and target name.
(default_encode_section_info): Don't add SYMBOL_FLAG_TLS_SHIFT
for emulated tls.
* emutls.c: New file.
* config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): Only emit
tls_object for real tls.
gcc/cp/
* decl.c (grokvardecl): Don't error if !have_tls.
(grokdeclarator): Likewise.
* parser.c (cp_parser_omp_threadprivate): Likewise.
gcc/fortran/
* f95-lang.c (gfc_init_builtin_functions): Add __emutls_get_address
and __emutls_register_common.
* openmp.c (gfc_match_omp_threadprivate): Don't error if !have_tls.
* trans-common.c (build_common_decl): Don't check have_tls.
* trans-decl.c (gfc_finish_var_decl): Likewise.
* types.def (BT_WORD, BT_FN_PTR_PTR): New.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
gcc/testsuite/
* lib/target-supports.exp (check_effective_target_tls): Redefine
to mean non-emulated tls.
* gcc.dg/tls/alias-1.c: Remove tls requirement.
* gcc.dg/tls/asm-1.c, gcc.dg/tls/debug-1.c, gcc.dg/tls/diag-1.c,
gcc.dg/tls/diag-2.c, gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c,
gcc.dg/tls/diag-5.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
gcc.dg/tls/opt-10.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c, gcc.dg/tls/pic-1.c,
gcc.dg/tls/struct-1.c, gcc.dg/tls/trivial.c: Likewise.
From-SVN: r117440
|
|
comment...
* tree.h (categorize_ctor_elements): Adjust prototype and add
descriptive comment, both in accordance with the interface change
described below.
* varasm.c (constructor_static_from_elts_p): New function.
Whether a constructor node is a valid static constant initializer
if all its elements are.
(initializer_constant_valid_p) <CONSTRUCTOR value>: Use it.
* output.h: Declare it.
* expr.c (categorize_ctor_elements_1): Return whether the constructor
is a valid constant initializer instead of computing the number of
non-constant elements. Use constructor_static_from_elts_p for this
purpose. Replace the head comment with an indication that this is a
helper for categorize_ctor_elements.
(categorize_ctor_elements): Same interface change as for the _1
helper. Former head comment from this helper moved here, adjusted to
account for the interface changes.
(mostly_zeros_p): Adjust call to categorize_ctor_elements.
(all_zeros_p): Likewise.
* gimplify.c (gimplify_init_constructor): Decide whether we can make
static versions of the constructor from the categorize_ctor_elements
return value instead of the formerly computed number of non-constant
elements.
* gnat.dg/outer_agg_bitfield_constructor.adb: New test.
* gnat.dg/nested_agg_bitfield_constructor.adb: New test.
From-SVN: r115553
|
|
* cgraphunit.c (cgraph_varpool_analyze_pending_decls): Call align_variable.
* output.h (align_variable): Declare.
* varasm.c (align_variable): Export.
* value-prof.c (tree_value_profile_transformations): Recompute iterator
when basic block changed.
From-SVN: r115421
|
|
* hooks.c (hook_bool_mode_rtx_true): New function.
* hooks.h (hook_bool_mode_rtx_true): Declare.
* toplev.c (compile_file): Call output_shared_constant_pool.
* varasm.c (shared_constant_pool): New variable.
(assemble_start_function, assemble_end_function): Remove arguments
from call to output_constant_pool.
(create_constant_pool): New function, split out from...
(init_varasm_status): ...here.
(force_const_mem): Choose between the shared and per-function constant
pools. Set current_function_uses_const_pool when reusing old entries
as well as when creating new ones.
(mark_constant): Ignore data argument.
(mark_constants): Remove pool argument.
(mark_constant_pool): Likewise. Use current_function_uses_const_pool
to decide whether the function uses a constant pool.
(output_constant_pool_contents): New function, split out from...
(output_constant_pool): ...here.
(output_shared_constant_pool): New function.
(init_varasm_once): Initialize shared_constant_pool.
* output.h (output_constant_pool): Delete.
(output_shared_constant_pool): Declare.
* config/s390/s390-protos.h (s390_output_constant_pool): Delete.
* config/i386/i386.c (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Override.
From-SVN: r111804
|
|
* doc/tm.texi (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Document.
(ASM_OUTPUT_BSS): Describe the two ways of handling global BSS,
and say that only one is needed.
* doc/rtl.texi (SYMBOL_REF_BLOCK): Say that the block can be null.
* target.h (have_switchable_bss_sections): New hook.
* explow.c (use_anchored_address): Check that the symbol is in a block.
* varasm.c (tls_comm_section, comm_section, lcomm_section)
(bss_noswitch_section): New variables.
(get_unnamed_section): Add SECTION_UNNAMED to the flags.
(get_noswitch_section): New function.
(get_block_for_section): Allow SECT to be null.
(unlikely_text_section_p): Use SECTION_STYLE.
(bss_initializer_p): New function.
(get_variable_section): Move earlier in file. Take a new argument,
prefer_noswitch_p. Move bss checks from assemble_variable to here.
Return one of the new *_sections in such cases.
(get_block_for_decl): New function, extracting some logic from
use_blocks_for_decl_p.
(change_symbol_section): Remove in favor of...
(change_symbol_block): ...this new function.
(use_blocks_for_decl_p): Remove checks now performed by
get_block_for_decl.
(make_decl_rtl): Use change_symbol_block and get_block_for_decl.
(ASM_EMIT_LOCAL, ASM_EMIT_BSS, ASM_EMIT_COMMON): Delete in favor of...
(emit_local, emit_bss, emit_common): ...these new functions.
Return true if the alignment was honored.
(emit_tls_common): New function.
(asm_emit_uninitialised): Delete.
(assemble_variable_noswitch): New function, split out from...
(assemble_variable): ...here. Don't make decisions about common
variables here. Globalize all public decls that go into non-common
sections. Check whether SYMBOL_REF_BLOCK is null.
(output_constant_def_contents): Check whether SYMBOL_REF_BLOCK is null.
(output_constant_pool): Likewise.
(init_varasm_once): Initialize the new section variables.
(have_global_bss_p): New function.
(categorize_decl_for_section): Use bss_initializer_p.
(switch_to_section): Use SECTION_STYLE. Abort for SECTION_NOSWITCH.
(place_block_symbol): Assert that the symbol must be in a block.
* target-def.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): New macro.
(TARGET_INITIALIZER): Include it.
* rtl.h (SYMBOL_REF_BLOCK): Document the null alternative.
* output.h (SECTION_STYLE_MASK, SECTION_COMMON): New macros.
(SECTION_MACH_DEP): Bump by two.
(SECTION_UNNAMED, SECTION_NOSWITCH): New macros.
(unnamed_section): Mention SECTION_UNNAMED in comment.
(named_section): Likewise SECTION_NAMED.
(noswitch_section_callback): New type.
(noswitch_section): New structure.
(section): Add a noswitch_section alternative.
(SECTION_STYLE): New macro.
(tls_comm_section, comm_section, lcomm_section): Declare.
(bss_noswitch_section, have_global_bss_p): Declare.
* config/elfos.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override.
* config/iq2000/iq2000.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS):
Override.
* config/v850/v850.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override.
* config/stormy16/stormy16.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS):
Override.
cp/
* decl.c (start_decl): Use have_global_bss_p when deciding
whether to make the decl common.
ada/
* utils.c (create_var_decl): Use have_global_bss_p when deciding
whether to make the decl common.
From-SVN: r111644
|
|
could be solved in less instructions)
* cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE.
* emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx.
(copy_insn_1): Likewise. Don't copy each field individually.
Reindent.
* read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead
of RTX_SIZE.
* reload1.c (eliminate_regs): Use shallow_copy_rtx.
* rtl.c (rtx_size): Rename variable to...
(rtx_code_size): ...this.
(rtx_size): New function.
(rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE.
(copy_rtx): Use shallow_copy_rtx. Don't copy each field individually.
Reindent.
(shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE.
* rtl.h (rtx_code_size): New variable.
(rtx_size): Change from a variable to a function.
(RTX_SIZE): Rename to...
(RTX_CODE_SIZE): ...this.
PR target/9703
PR tree-optimization/17106
* doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document.
(Anchored Addresses): New section.
* doc/invoke.texi (-fsection-anchors): Document.
* doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise.
(SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise.
(SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise.
* hooks.c (hook_bool_mode_rtx_false): New function.
* hooks.h (hook_bool_mode_rtx_false): Declare.
* gengtype.c (create_optional_field): New function.
(adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when
SYMBOL_REF_IN_BLOCK_P is true.
* target.h (output_anchor, use_blocks_for_constant_p): New hooks.
(min_anchor_offset, max_anchor_offset): Likewise.
(use_anchors_for_symbol_p): New hook.
* toplev.c (compile_file): Call output_object_blocks.
(target_supports_section_anchors_p): New function.
(process_options): Check that -fsection-anchors is only used on
targets that support it and when -funit-at-a-time is in effect.
* tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL
if the decl doesn't have one.
* dwarf2out.c: Remove instantiations of VEC(rtx,gc).
* expr.c (emit_move_multi_word, emit_move_insn): Pass the result
of force_const_mem through use_anchored_address.
(expand_expr_constant): New function.
(expand_expr_addr_expr_1): Call it. Use the same modifier when
calling expand_expr for INDIRECT_REF.
(expand_expr_real_1): Pass DECL_RTL through use_anchored_address
for all modifiers except EXPAND_INITIALIZER. Use expand_expr_constant.
* expr.h (use_anchored_address): Declare.
* loop-unroll.c: Don't declare rtx vectors here.
* explow.c: Include output.h.
(validize_mem): Call use_anchored_address.
(use_anchored_address): New function.
* common.opt (-fsection-anchors): New switch.
* varasm.c (object_block_htab, anchor_labelno): New variables.
(hash_section, object_block_entry_eq, object_block_entry_hash)
(use_object_blocks_p, get_block_for_section, create_block_symbol)
(use_blocks_for_decl_p, change_symbol_section): New functions.
(get_variable_section): New function, split out from assemble_variable.
(make_decl_rtl): Create a block symbol if use_object_blocks_p and
use_blocks_for_decl_p say so. Use change_symbol_section if the
symbol has already been created.
(assemble_variable_contents): New function, split out from...
(assemble_variable): ...here. Don't output any code for
block symbols; just pass them to place_block_symbol.
Use get_variable_section and assemble_variable_contents.
(get_constant_alignment, get_constant_section, get_constant_size): New
functions, split from output_constant_def_contents.
(build_constant_desc): Create a block symbol if use_object_blocks_p
says so. Or into SYMBOL_REF_FLAGS.
(assemble_constant_contents): New function, split from...
(output_constant_def_contents): ...here. Don't output any code
for block symbols; just pass them to place_section_symbol.
Use get_constant_section and get_constant_alignment.
(force_const_mem): Create a block symbol if use_object_blocks_p and
use_blocks_for_constant_p say so. Or into SYMBOL_REF_FLAGS.
(output_constant_pool_1): Add an explicit alignment argument.
Don't switch sections here.
(output_constant_pool): Adjust call to output_constant_pool_1.
Switch sections here instead. Don't output anything for block symbols;
just pass them to place_block_symbol.
(init_varasm_once): Initialize object_block_htab.
(default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK.
(default_asm_output_anchor, default_use_aenchors_for_symbol_p)
(place_block_symbol, get_section_anchor, output_object_block)
(output_object_block_htab, output_object_blocks): New functions.
* target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro.
(TARGET_ASM_OUT): Include it.
(TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro.
(TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros.
(TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro.
(TARGET_INITIALIZER): Include them.
* rtl.c (rtl_check_failed_block_symbol): New function.
* rtl.h: Include vec.h. Declare heap and gc rtx vectors.
(block_symbol, object_block): New structures.
(rtx_def): Add a block_symbol field to the union.
(BLOCK_SYMBOL_CHECK): New macro.
(rtl_check_failed_block_symbol): Declare.
(SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags.
(SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates.
(SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2.
(SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors.
* output.h (output_section_symbols): Declare.
(object_block): Name structure.
(place_section_symbol, get_section_anchor, default_asm_output_anchor)
(default_use_anchors_for_symbol_p): Declare.
* Makefile.in (RTL_BASE_H): Add vec.h.
(explow.o): Depend on output.h.
* config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default.
(TARGET_MAX_ANCHOR_OFFSET): Likewise.
(TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise.
(rs6000_use_blocks_for_constant_p): New function.
From-SVN: r111254
|
|
2006-01-06 Eric Christopher <echristo@apple.com>
* doc/tm.texi (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Document.
(TARGET_UNWIND_EMIT): Fix spelling.
* target.h (gcc_target): Add except_table_label.
* except.c (output_function_exception_table): Use.
* varasm.c (default_emit_except_table_label): New.
* target-def.h (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): New default
define.
(asm_out): Add here.
* output.h (default_emit_except_table_label): Prototype.
* config/darwin-protos.h (darwin_emit_except_table_label): Ditto.
* config/darwin.c (darwin_emit_except_table_label): Define.
* config/darwin.h (TARGET_ASM_EMIT_EXCEPT_TABLE): Ditto.
From-SVN: r109435
|
|
* final.c (compute_alignments): Make it static.
* gcse.c (gcse_main, bypass_jumps): Likewise.
* web.c (web_main): Likewise.
* output.h: Remove the prototype for compute_alignments.
* rtl.h: Remove the prototypes for web_main, gcse_main, and
bypass_jumps.
From-SVN: r109051
|
|
hot and cold sections.
* final.c (final_scan_insn): Flip in_cold_section_p when changing
between the hot and cold sections. Use current_function_section
to get the new section.
* dwarf2out.c (output_line_info): Use in_cold_section_p to
determine whether we are assembling hot or cold code.
(secname_for_decl, dwarf2out_var_location): Likewise.
(dwarf2out_init, dwarf2out_finish): Use switch_to_section.
* varasm.c (last_text_section): Delete.
(in_cold_section_p): New variable.
(hot_function_section): New function.
(current_function_section): Pass in_cold_section_p as the
reloc argument to select_section. Use it to decide between
unlikely_function_section and hot_function_section.
(assemble_start_function): Use switch_to_section. Set
in_cold_section_p instead of last_text_section.
(assemble_end_function): Use switch_to_section.
(switch_to_section): Don't set last_text_section.
* config/darwin/darwin.c (machopic_select_section): Trust the reloc
argument to make the right choice between hot and cold sections.
From-SVN: r108572
|
|
* output.h (init_section, fini_section): Delete.
* varasm.c (init_section, fini_section): Delete.
(init_varasm_once): Don't initialize them.
* doc/tm.texi (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Say that
there are no corresponding varasm.c variables.
From-SVN: r108338
|
|
EH_FRAME_SECTION_NAME into...
* dwarf2out.c (default_eh_frame_section): Delete, moving handling
of EH_FRAME_SECTION_NAME into...
(switch_to_eh_frame_section): ...here. Try to set eh_frame_section
if it is still null.
* except.c (default_exception_section): Delete, moving most
of the code to...
(switch_to_exception_section): ...this new function. Set
exception_section if it is still null, then switch to it.
(output_function_exception_table): Use switch_to_exception_section.
* varasm.c (exception_section, eh_frame_section): Update comments.
(get_section): Hoist use of SECTION_NAMED.
(init_varasm_once): Don't set exception_section and eh_frame_section.
* output.h (default_exception_section): Delete.
(default_eh_frame_section): Delete.
testsuite/
* gcc.dg/20051207-1.c,
* gcc.dg/20051207-2.c,
* gcc.dg/20051207-3.c: New tests.
From-SVN: r108336
|
|
* config/alpha/alpha.c (alpha_start_function): Use switch_to_section.
(alpha_elf_select_rtx_section): Return the selected section rather
than emitting assembly code.
(alpha_write_linkage): Emit a ".link" directive directly and then
set in_section to NULL.
(vms_asm_out_constructor): Use switch_to_section.
(vms_asm_out_destructor): Likewise.
(unicosmk_output_common): Set in_section to NULL instead of calling
the dummy common_section function.
(unicosmk_text_section): Delete in favor of...
(unicosmk_output_text_section_asm_op): ...this new function.
(unicosmk_data_section): Delete in favor of...
(unicosmk_output_data_section_asm_op): ...this new function.
(unicosmk_init_sections): New function.
(unicosmk_output_deferred_case_vectors): Use switch_to_section.
(unicosmk_output_ssib): Set in_section to NULL instead of calling
the dummy ssib_section function.
(unicosmk_section_buf): Delete.
* config/alpha/alpha-protos.h (unicosmk_text_section): Delete.
(unicosmk_data_section): Delete.
* config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section.
(EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section)
(SECTION_FUNCTION_TEMPLATE): Delete.
* config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP)
(READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS)
(common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete.
(ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section.
(TARGET_ASM_INIT_SECTIONS): Define.
* config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP)
(EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete.
(link_section, literals_section): Delete.
(ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then
set in_section to NULL.
* config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete.
(EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete.
(COMMON_SECTION): Delete.
(TARGET_ASM_INIT_SECTIONS): Define.
(ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling
the dummy common_section function.
* config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section.
* config/arm/arm.c (get_jump_table_size): Use pointer comparison
between readonly_data_section and text_section to check whether
read-only data is being put in the text section.
(arm_output_function_epilogue): Use switch_to_section.
(arm_elf_asm_constructor): Likewise.
(thumb_call_via_reg): Replace call to in_text_section with
a comparison between in_section and text_section.
(arm_file_end): Use switch_to_section.
(aof_text_section): Delete in favor of...
(aof_output_text_section_asm_op): ...this new function.
(aof_data_section): Delete in favor of...
(aof_output_data_section_asm_op): ...this new function.
(aof_asm_init_sections): New function.
(zero_init_section): Moved from config/arm/aof.h.
(aof_dump_imports, aof_file_start): Use switch_to_section.
* config/arm/arm.h (thumb_call_via_label): Update comment.
* config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete.
(common_section): Delete.
* config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section.
(ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the
global switch_to_section function instead of the old port-local one.
(EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION)
(SWITCH_TO_SECTION_FUNCTION): Delete.
(drectve_section): Redefine as a macro.
* config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS):
(ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and
switch_to_section.
* config/avr/avr.c (progmem_section): New variable.
(avr_output_progmem_section_asm_op): New function.
(avr_asm_init_sections): New function.
(avr_output_addr_vec_elt): Use switch_to_section.
* config/avr/avr.h (progmem_section): Declare.
(EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete.
(READONLY_DATA_SECTION): Delete.
(TARGET_ASM_INIT_SECTIONS): Define.
(ASM_OUTPUT_CASE_LABEL): Use switch_to_section.
* config/avr/avr-protos.h (progmem_section): Delete.
* config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section.
* config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS)
(INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete.
* config/darwin-sections.def: New file.
* config/darwin.c: Define all sections in darwin-sections.def.
(output_objc_section_asm_op, darwin_init_sections): New functions.
(machopic_output_indirection): Use switch_to_section.
(machopic_select_section): Return the selected section rather than
emitting assembly code. Replace the static function table with
inline conditional expressions. Update the tests of last_text_section
and move them into the FUNCTION_DECL block.
(machopic_select_rtx_section): Return the selected section rather than
emitting assembly code.
(machopic_asm_out_constructor, machopic_asm_out_destructor)
(darwin_file_end): Use switch_to_section.
* config/darwin.h: Use darwin-sections.def to declare sections.
(INIT_SECTION_ASM_OP): Remove empty definition.
(HAS_INIT_SECTION): Define this instead.
(SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete.
(READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete.
(TARGET_ASM_EH_FRAME_SECTION): Delete.
(TARGET_ASM_INIT_SECTIONS): Define.
* config/darwin-protos.h (darwin_init_sections): Declare.
(machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section)
(machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete.
(machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section)
(constructor_section, destructor_section, mod_init_section): Delete.
(mod_term_section): Delete.
(darwin_exception_section, darwin_eh_frame_section): Delete.
(machopic_select_section): Return a section.
(machopic_select_rtx_section): Likewise.
(text_coal_section, text_unlikely_section, text_unlikely_coal_section)
(const_section, const_coal_section, const_data_section): Delete.
(const_data_coal_section, data_coal_section, cstring_section): Delete.
(literal4_section, literal8_section, constructor_section): Delete.
(mod_init_section, mod_term_section, destructor_section): Delete.
(objc_class_section, objc_meta_class_section, objc_category_section)
(objc_class_vars_section, objc_instance_vars_section): Delete.
(objc_cls_meth_section, objc_inst_meth_section): Delete.
(objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete.
(objc_selector_refs_section, objc_selector_fixup_section): Delete.
(objc_symbols_section, objc_module_info_section): Delete.
(objc_image_info_section, objc_protocol_section): Delete.
(objc_string_object_section, objc_constant_string_object_section)
(objc_class_names_section, objc_meth_var_names_section): Delete.
(objc_meth_var_types_section, objc_cls_refs_section): Delete.
(machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section)
(machopic_symbol_stub_section, machopic_picsymbol_stub_section)
(darwin_exception_section, darwin_eh_frame_section): Delete.
* config/t-darwin (darwin.o): Depend on config/darwin-sections.def.
* config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section.
(frv_asm_out_destructor): Likewise.
* config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete.
(SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete.
(ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and
get_named_section.
(ASM_OUTPUT_CASE_LABEL): Use switch_to_section.
* config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section)
(data_section): Delete.
* config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS)
(DRECTVE_SECTION_FUNCTION): Delete.
(drectve_section): Redefine as a macro that sets in_section after
emitting the directive.
(SWITCH_TO_SECTION_FUNCTION): Delete.
* config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to
in_text_section with comparison between in_section and text_section.
* config/i386/i386.c (x86_64_elf_select_section): Return the section
rather than emitting assembly code. Use get_named_section.
(x86_output_aligned_bss, ix86_file_end): Use switch_to_section and
get_named_section.
(machopic_output_stub): Use switch_to_section.
* config/i386/nwld.c (nwld_named_section_asm_out_constructor)
(nwld_named_section_asm_out_destructor): Use get_section and
switch_to_section.
* config/ia64/ia64.c (ia64_select_rtx_section): Return the section
rather than emitting assembly code.
(ia64_rwreloc_select_section): Likewise.
(ia64_rwreloc_select_rtx_section): Likewise.
* config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete.
* config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use
switch_to_section.
(EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete.
(SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete.
* config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the
section rather than emitting assembly code.
(iq2000_select_section): Likewise.
* config/iq2000/iq2000.h (rdata_section, sdata_section): Delete.
(sbss_section): Delete.
* config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section
and get_named_section.
* config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete.
* config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete.
(SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete.
(EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete.
(MCORE_EXPORT_NAME): Emit the exports directive directly, then set
in_section to NULL.
(ASM_DECLARE_FUNCTION_NAME): Use switch_to_section.
(ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the
global switch_to_section function instead of the old port-local one.
* config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS)
(SWITCH_SECTION_FUNCTION): Delete.
* config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete.
(DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete.
(SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete.
(MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set
in_section to NULL.
(ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the
global switch_to_section function instead of the old port-local one.
(ASM_DECLARE_FUNCTION_NAME): Use switch_to_section.
* config/mips/mips.c (mips_file_start): Update comment.
(mips_output_aligned_bss): Use switch_to_section and get_named_section.
(mips_output_aligned_decl_common): Use switch_to_section.
(mips_select_rtx_section): Return the section rather than emitting
assembly code. Use get_named_section.
(mips_function_rodata_section: Likewise get_section.
(build_mips16_function_stub): Use switch_to_section.
* config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section.
(SDATA_SECTION_ASM_OP): Delete.
* config/mips/vxworks.h (EXTRA_SECTIONS): Delete.
(EXTRA_SECTION_FUNCTIONS): Delete.
* config/mmix/mmix.c (mmix_file_start, mmix_file_end)
(mmix_asm_output_aligned_local): Use switch_to_section.
* config/pa/pa.c (som_readonly_data_section, som_one_only_data_section)
(som_one_only_readonly_data_section): New variables.
(pa_output_function_epilogue): Set in_section to NULL instead of
calling forget_section.
(output_deferred_plabels): Use select_section.
(pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead
of calling forget_section.
(pa_asm_output_aligned_bss, pa_asm_output_aligned_common)
(pa_asm_output_aligned_local): Use select_section.
(som_text_section_asm_op): Delete in favor of...
(som_output_text_section_asm_op): ...this new function.
(pa_som_asm_init_sections): New function.
(pa_select_section): Return the section rather than emitting
assembly code.
* config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete.
(SOM_READONLY_DATA_SECTION_FUNCTION): Delete.
(SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete.
(SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete.
* config/pa/pa-protos.h (som_text_section_asm_op): Delete.
(som_readonly_data_section, som_one_only_readonly_data_section)
(som_one_only_data_section, forget_section): Delete.
* config/pa/som.h (TEXT_SECTION_ASM_OP): Delete.
(TARGET_ASM_INIT_SECTIONS): Define.
(READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete.
* config/rs6000/rs6000.c (read_only_data_section): New variable.
(private_data_section, read_only_private_data_section): New variables.
(sdata2_section, toc_section): New variables.
(rs6000_file_start): Use switch_to_section.
(rs6000_assemble_integer): Use comparisons against in_section
instead of calling in_toc_section and in_text_section. Use
unlikely_text_section_p.
(rs6000_elf_output_toc_section_asm_op): New function, derived
from the old rs6000/sysv4.h toc_section function.
(rs6000_elf_asm_init_sections): New function.
(rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return
the section rather than emitting assembly code.
(machopic_output_stub): Use switch_to_section.
(toc_section): Delete dummy function.
(rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use
switch_to_section and get_section.
(rs6000_xcoff_output_readonly_section_asm_op): New function.
(rs6000_xcoff_output_readwrite_section_asm_op): New function.
(rs6000_xcoff_output_toc_section_asm_op): New function, derived from
the old rs6000/xcoff.h toc_section function.
(rs6000_xcoff_asm_init_sections): New function.
(rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return
the section rather than emitting assembly code.
(rs6000_xcoff_file_start): Use switch_to_section.
(rs6000_xcoff_file_end): Likewise.
* config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete.
(sdata2_section, sbss_section, private_data_section): Delete.
(read_only_data_section, read_only_private_data_section): Delete.
* config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS)
(TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION)
(SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete.
(FINI_SECTION_FUNCTION): Delete.
(TARGET_ASM_INIT_SECTIONS): Define.
(ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section.
* config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS)
(READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION)
(READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION)
(READONLY_DATA_SECTION): Delete.
(TARGET_ASM_INIT_SECTIONS): Define.
(ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section
to NULL rather than no_section.
(TARGET_ASM_EXCEPTION_SECTION): Delete.
* config/sh/sh.c (sh_file_start): Use switch_to_section.
* config/sparc/sparc.c (emit_pic_helper): Use switch_to_section.
(sparc_output_deferred_case_vectors): Likewise. Remove argument
from call to current_function_section.
* config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h.
(bss100_section): New variable.
(xstormy16_asm_output_aligned_common): Use switch_to_section.
(xstormy16_asm_init_sections): New function.
(xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use
switch_to_section and get_section.
(xstormy16_output_addr_vec): Use switch_to_section. Remove argument
from calls to current_function_section.
* config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete.
(XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete.
(TARGET_ASM_INIT_SECTIONS): Define.
* config/stormy16/stormy16-protos.h (bss100_section): Delete.
* config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section.
(EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION)
(FINI_SECTION_FUNCTION): Delete.
* config/v850/v850.c: Include gt-v850.h.
(rosdata_section, rozdata_section, tdata_section, zdata_section)
(zbss_section): New variables.
(v850_output_aligned_bss): Use switch_to_section.
(v850_asm_init_sections): New function.
(v850_select_section): Return the section rather than emitting
assembly code.
* config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS)
(ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP)
(ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete.
(TARGET_ASM_INIT_SECTIONS): Define.
* config/v850/v850-protos.h (sdata_section, rosdata_section): Delete.
(sbss_section, tdata_section, zdata_section, rozdata_section): Delete.
(zbss_section): Delete.
* config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section.
* config/vx-common.h (vxworks_exception_section): Delete.
(TARGET_ASM_EXCEPTION_SECTION): Delete.
* config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the
section rather than emitting assembly code.
* config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use
switch_to_section.
* Makefile.in (GTFILES): Add $(srcdir)/output.h.
* coretypes.h (section): New union and typedef.
* dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument
from call to current_function_section.
(dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish)
(dbxout_symbol_location): Use switch_to_section.
* dwarf2out.c (named_section_eh_frame_section): Delete, moving
most of the code into...
(default_eh_frame_section): ...here. Return a section.
(collect2_eh_frame_section): Delete, moving most of the code into..
(switch_to_eh_frame_section): ...this new function.
(debug_info_section, debug_abbrev_section, debug_aranges_section)
(debug_macinfo_section, debug_line_section, debug_loc_section)
(debug_pubnames_section, debug_str_section, debug_ranges_section): New
variables.
(output_call_frame_info): Call switch_to_eh_frame_section instead of
eh_frame_section. Use switch_to_section and get_section.
(dwarf2out_begin_prologue): Use switch_to_section.
(AT_string_form): Check the flags in debug_str_section instead of
DEBUG_STR_SECTION_FLAGS.
(output_comp_unit): Use switch_to_section, get_section, and
debug_info_section.
(output_line_info, secname_for_decl): Use unlikely_text_section_p.
(dwarf2out_begin_block): Use switch_to_section. Remove argument
from call to current_function_section.
(dwarf2out_var_location): Use unlikely_text_section_p.
(dwarf2out_source_line): Use switch_to_section. Remove argument
from call to current_function_section.
(dwarf2out_start_source_file, dwarf2out_end_source_file)
(dwarf2out_define, dwarf2out_undef: Use switch_to_section and
debug_macinfo_section.
(dwarf2out_init): Initialize the new section variables. Use them
instead of calls to named_section_flags. Use switch_to_section.
(output_indirect_string): Use switch_to_section and debug_str_section.
(dwarf2out_finish): Use switch_to_section and the new section
variables.
* except.c (default_exception_section): Return the section instead
of emitting assembly code.
(output_function_exception_table): Use the global exception_section
variable instead of the target hook. Use switch_to_section. Remove
argument from call to current_function_section.
* final.c (HAVE_READONLY_DATA_SECTION): Delete.
(shorten_branches): Use pointer comparisons to detect whether the
text section is the same as readonly_data_section.
(profile_function): Use switch_to_section. Remove argument from
call to current_function_section.
(final_scan_insn): Likewise. Update use of last_text_section.
* gengtype.c (open_base_files): Add an include of output.h.
* output.h (text_section, data_section, readonly_data_section)
(ctors_section, dtors_section, bss_section, init_section)
(fini_section, sdata_section): Turn into section pointers.
(in_text_section, in_unlikely_text_section, exports_section)
(drectve_section, named_section, mergeable_string_section)
(last_text_section_name): Delete.
(default_exception_section, default_eh_frame_section): Return sections.
(SECTION_DECLARED, SECTION_NAMED): New macros.
(SECTION_MACH_DEP): Bump value.
(section_common, named_section, unnamed_section): New structures.
(unnamed_section_callback): New typedef.
(section): New union.
(sbss_section, exception_section, eh_frame_section): New variables.
(in_section, last_text_section): Turn into section pointers.
(get_unnamed_section, get_section, get_named_section): New functions.
(mergeable_constant_section, function_section): Return a section.
(unlikely_text_section): Likewise.
(current_function_section): Likewise. Remove the decl argument.
(unlikely_text_section_p, switch_to_section): New functions.
(output_section_asm_op): New function.
(set_named_section_flags, named_section_flags, named_section_real)
(named_section_first_declaration): Delete.
(default_select_section, default_elf_select_section): Return a section.
(default_elf_select_section_1, default_function_rodata_section)
(default_no_function_rodata_section, default_select_rtx_section)
(default_elf_select_rtx_section): Likewise.
* rtl.h (in_data_section): Delete.
* sdbout.c (sdbout_one_type): Use switch_to_section.
* system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison.
(READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison.
(TARGET_ASM_EH_FRAME_SECTION): Poison.
* target-def.h (TARGET_ASM_INIT_SECTIONS): New macro.
(TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete.
(TARGET_ASM_OUT): Update after above changes.
* target.h (init_sections): New hook.
(exception_section, eh_frame_section): Delete.
(select_section, select_rtx_section, function_rodata_section): Return
a section rather than emitting assembly code.
* varasm.c (text_section, data_section, readonly_data_section)
(ctors_section, dtors_section, bss_section, init_section)
(fini_section): Turn into section pointers.
(sdata_section, sbss_section, exception_section): New variables.
(eh_frame_section): New variable.
(in_section): Make global and turn into a section pointer.
(last_text_section): Turn into a section pointer.
(unnamed_sections): New variable.
(in_named_name, last_text_section_name): Delete.
(EXTRA_SECTION_FUNCTIONS): Delete.
(in_named_entry): Delete.
(section_htab): New variable, replacing...
(in_named_htab): ...this deleted variable.
(section_entry_eq, section_entry_hash): New functions, based on...
(in_named_entry_eq, in_named_entry_hash): ...these deleted functions.
(get_unnamed_section, get_section): New functions.
(unlikely_text_section): Return a section instead of emitting
assembly code.
(in_text_section, in_unlikely_text_section, in_data_section): Delete.
(get_named_section_flags, named_section_first_declaration): Delete.
(unlikely_text_section_p): New function.
(named_section_real, named_section): Delete.
(get_named_section): New function.
(asm_output_bss, asm_output_aligned_bss): Use switch_to_section.
(function_section): Return a section rather than emitting
assembly code.
(current_function_section): Likewise. Remove argument. Use
last_text_section if nonnull, otherwise use function_section.
(default_function_rodata_section): Return a section rather than
emitting assembly code. Use get_section.
(default_no_function_rodata_section): Return a section rather than
emitting assembly code.
(variable_section): Use switch_to_section and get_named_section.
(mergeable_string_section): Return a section rather than emitting
assembly code. Use get_section. Make static. Don't take special
countermeasures for empty strings.
(mergeable_constant_section): Return a section rather than emitting
assembly code. Use get_section.
(default_named_section_asm_out_destructor): Use switch_to_section
and get_section.
(default_dtor_section_asm_out_destructor): Use switch_to_section.
(default_named_section_asm_out_constructor): Use switch_to_section
and get_section.
(default_ctor_section_asm_out_constructor): Use switch_to_section.
(assemble_start_function): Likewise. Set last_text_section to
NULL rather than no_section. Change the type of save_section.
(assemble_zeros, assemble_variable): Use the section flags to detect
whether or not a section is text.
(assemble_static_space): Use switch_to_section.
(assemble_trampoline_template): Likewise.
(output_constant_def_contents): Use switch_to_section and
get_named_section.
(output_constant_pool_1): Use switch_to_section. Use the section
flags to see whether sections contain mergeable data.
(init_varasm_once): Initialize section_htab instead of in_named_htab.
Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS.
(default_elf_asm_named_section): Use SECTION_DECLARED to detect
whether a section has already been declared.
(default_select_section, default_elf_select_section): Return a
section rather than emitting assembly code.
(default_elf_select_section_1): Likewise. Use bss_section for
SECCAT_BSS if nonnull. Use get_named_section.
(default_select_rtx_section): Return a section rather than
emitting assembly code.
(default_elf_select_rtx_section): Likewise. Use get_named_section.
(file_end_indicate_exec_stack): Use switch_to_section and get_section.
(output_section_asm_op, switch_to_section): New functions.
* vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and
get_named_section.
* doc/tm.texi: Expand the introduction to the sections documentation.
(TRAMPOLINE_SECTION): Document new interface.
(SDATA_SECTION_ASM_OP): Document new macro.
(READONLY_DATA_SECTION): Delete.
(SDATA_SECTION_ASM_OP): Document new macro.
(EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete.
(TARGET_ASM_INIT_SECTIONS): Document new hook.
(TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION)
(TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface.
(TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete.
gcc/java/
* class.c (build_utf8_ref, emit_register_classes): Use
switch_to_section and get_section.
From-SVN: r108152
|
|
PR rtl-optimization/24460
* dwarf2out.c (have_switched_text_sections): New boolean variable.
(dwarf2out_switch_text_section): Set it to true instead of
incrementing separate_line_info_table_in_use.
(output_loc_list): Additionally test have_switched_text_sections.
(output_ranges): Likewise.
(dwarf2out_finish): Likewise.
* varasm.c (assemble_start_function): Do not call
insert_section_boundary_note.
(assemble_end_function): If flag_reorder_blocks_and_partition,
switch to the function's section before emitting the .size directive.
* bb-reorder.c (insert_section_boundary_note): Staticify.
(rest_of_handle_reorder_blocks): Call insert_section_boundary_note.
* output.h (insert_section_boundary_note): Delete.
Co-Authored-By: Caroline Tice <ctice@apple.com>
From-SVN: r105916
|
|
code size; get_uncond_jump_length pessimistic)
PR rtl-optimization/23898
* output.h (get_attr_min_length): Declare.
* final.c (get_attr_length_1): New function, broken out of:
(get_attr_length).
(get_attr_min_length): New function.
* bb-reorder.c (copy_bb_p, get_uncond_jump_length): Use it.
(duplicate_computed_gotos): Likewise.
* genattr.c (insn_min_length): Generate declaration.
* genattrtab.c (min_fn, min_attr_value): New functions.
(make_length_attrs): Generate insn_min_length.
From-SVN: r104468
|
|
* output.h (enum section_category): Export from varasm.c
(categorize_decl_for_section): Likewise.
* varasm.c (enum section_category): Kill.
(categorize_decl_for_section): Make global.
* i386-protos.h (x86_output_aligned_bss, x86_elf_aligned_common):
Declare.
* i386.c (ix86_section_threshold): New static variable.
(ix86_in_large_data_p, ix86_encode_section_info,
x86_64_elf_unique_section,
x86_64_elf_select_section): New functions.
(TARGET_ENCODE_SECTION_INFO): Define
(override_options): Enable medium model for PIC.
(ix86_expand_prologue): Expand gen_set_got_rex64.
(legitimate_constant_p): Handle new UNSPECs.
(legitimate_pic_address_disp_p): Likewise.
(legitimize_pic_address): Lower MEDIUM model addressing.
* i386.h (PIC_OFFSET_TABLE_REGNUM): Set for medium model PIC.
(enum cmodel): Add MEDIUM_PIC.
(SYMBOL_REF_FAR_ADDR_P): New macro.
(SYMBOL_FLAG_FAR_ADDR): New flag.
* i386.md (movdi): Support medium model.
(set_got_rex64): New pattern.
* i386.opt (mlarge-data-threshold): New flag.
* predicates.md (zext_operand/sext_operand): Deal with medium model.
* x86-64.h (ASM_OUTPUT_ALIGNED_BSS): Use x86_output_aligned_bss.
(ASM_OUTPUT_ALIGNED_COMMON, TARGET_ASM_SELECT_SECTION,
TARGET_ASM_UNIQUE_SECTION): New.
* invoke.texi (-mlarge_data_threshold): Document
From-SVN: r102606
|
|
From-SVN: r101317
|
|
2005-04-27 Caroline Tice <ctice@apple.com>
* bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges):
Remove targetm.have_named_sections test.
(fix_edges_for_rarely_executed_code): Likewise.
(insert_section_boundary_note): Likewise.
(reorder_basic_blocks): Check partitioning flag before calling
verify_hot_cold_block_grouping.
* dbxout.c (dbxout_function_end): Get hot/cold section labels from
the function struct rather than global variables.
* dwarf2out.c (COLD_TEXT_SECTION_LABEL): New macro.
(COLD_END_LABEL): Likewise
(cold_text_section_label): New static global variable.
(cold_end_label): Likewise.
(dwarf2out_switch_text_section): Get hot/cold section labels from
the function struct rather than global variables; test to make sure
cfun is defined.
(output_aranges): Use cold_text_section_label and cold_end_label;
check partitioning flag before putting out delta.
(output_ranges): Remove incorrect code attempting to use
hot/cold labels.
(output_line_info): Get cold section label from function struct; test
to make sure cfun is defined.
(add_location_or_const_value_attribute): Likewise.
(dwarf2out_var_location): Likewise.
(dwarf2out_init): Generate cold_text_section_label and cold_end_label;
write out cold_text_section_label if partition flag is set.
(dwarf2out_finish): Write out cold_end_label if partition flag is set;
* function.h (struct function): Add new fields to point to hot/cold
section labels: hot_section_label, cold_section_label,
hot_section_end_label and cold_section_end_label; also add new field
for cold text section name, unlikely_text_section_name.
* opts.c (decode_options): Turn off partitioning flag if
!targetm.have_named_sections.
* output.h (hot_section_label): Remove.
(hot_section_end_label): Remove.
(cold_section_end_label): Remove.
(unlikely_section_label): Remove.
(unlikely_text_section_name): Remove.
* passes.c (rest_of_handle_final): Remove extra blank line.
* varasm.c (unlikely_section_label): Remove.
(hot_section_label): Remove.
(hot_section_end_label): Remove.
(cold_section_end_label): Remove.
(unlikely_text_section_name): Remove.
(initialize_cold_section_name): Modify to call
targetm.strip_name_encoding; to store cold section name in current
function struct, if it exists; and to only use the decl_section_name
if flag_named_sections is true.
(unlikely_text_section): Modify to get section name out of current
function struct, if there is one; otherwise build it from
UNLIKELY_EXECUTED_TEXT_SECTION_NAME.
(in_unlikely_text_section): Likewise.
(named_section): Modify to get/put cold section name in current function
struct, if there is one.
(function_section): Change 'bool unlikely' to 'int reloc'; check
targetm.have_named_sections before calling named_section.
(current_function_section): Likewise.
(assemble_start_function): Modify to get/put unlikely_text_section_name
in current function struct; modify to get hot/cold section labels
from function struct; initialize labels using
ASM_GENERATE_INTERNAL_LABEL;
test partitioning flag before writing out hot section label.
(assemble_end_function): Test partitioning flag before writing out
hot/cold section labels.
(default_section_type_flags_1): Get cold text section name from
function struct if there is one; Set flags correctly for
cold text section if there is not a current function struct.
From-SVN: r98885
|
|
* lambda.h (lambda_vector_min_nz): Likewise.
* langhooks.h (struct lang_hooks_for_types,
struct lang_hooks): Likewise.
* output.h (assemble_integer, this_is_asm_operands): Likewise.
* tree.h: Likewise.
* vec.h: Likewise.
* tree-flow-inline.h (relink_imm_use): Use gcc_assert.
* optabs.c (prepare_cmp_insn, emit_cmp_and_jump_insns): Reword
comments to avoid 'abort'. Use gcc_assert as necessary.
* opts.c (common_handle_option): Likewise.
* pretty-print.c (pp_base_format_text): Likewise.
* print-rtl.c (print_rtx): Likewise.
* read-rtl.c (read_rtx_filename, read_rtx_1): Likewise.
* regmove.c (try_auto_increment): Likewise.
* reload.c (find_valid_class, find_reloads_toplev,
find_equiv_reg): Likewise.
* reload1.c (reload, forget_old_reloads_1, function_invariant_p,
merge_assigned_reloads): Likewise.
* tree-inline.c (inline_forbidden_p_1,
estimate_num_insns_1): Likewise.
* tree-optimize.c (execute_todo): Likewise.
* tree-outof-ssa.c (eliminate_phi): Likewise.
* tree-ssa-alias.c (add_pointed_to_expr): Likewise.
* tree-ssa-ccp.c (maybe_fold_stmt_indirect): Likewise.
* tree-ssa-operands.c (parse_ssa_operands,
get_indirect_ref_operands, create_ssa_artficial_load_stmt): Likewise.
* tree-ssa-pre.c (find_or_generate_expression): Likewise.
* tree-ssanames.c (release_ssa_name): Likewise.
* tree.c (int_bit_position, int_byte_position, tree_low_cst,
walk_tree): Likewise.
* tree-ssa-operands.c (verify_abort): Fold into ..
(verify_imm_links): ... here.
From-SVN: r98519
|
|
From-SVN: r98039
|
|
From-SVN: r97928
|
|
From-SVN: r97322
|
|
* final.c (final): Remove prescan parameter. Change all callers.
(final_scan_insn): Remove prescan parameter. Change all callers.
From-SVN: r97267
|
|
* basic-block.h, c-common.c, c-cppbuiltin.c, c-lang.c,
c-tree.h, cfgbuild.c, cgraph.c, cgraph.h, collect2.c,
combine.c, config.gcc, coverage.h, cse.c, cselib.c,
defaults.h, df.c, dwarf2asm.c, dwarf2out.c, explow.c, expr.c,
flow.c, fold-const.c, gcse.c, ggc-page.c, gimple-low.c,
gimplify.c, ifcvt.c, langhooks-def.h, lcm.c, optabs.h,
output.h, postreload-gcse.c, postreload.c, recog.c,
resource.c, rtl.def, rtlanal.c, sched-deps.c, sched-rgn.c,
targhooks.h, toplev.c, tree-data-ref.c, tree-eh.c,
tree-flow.h, tree-loop-linear.c, tree-mudflap.h, tree-nrv.c,
tree-optimize.c, tree-outof-ssa.c, tree-pass.h,
tree-scalar-evolution.c, tree-ssa-copy.c, tree-ssa-dce.c,
tree-ssa-dse.c, tree-ssa-loop-ivopts.c, tree-ssa-operands.c,
tree-ssa-pre.c, tree-ssa.c, tree-vectorizer.c, tree.def,
unwind-dw2-fde-darwin.c, var-tracking.c: Update copyright.
From-SVN: r93827
|
|
* c-tree.h, coverage.h, langhooks-def.h, optabs.h, output.h,
rtl.h, targhooks.h, tree-flow.h, tree-mudflap.h, tree.h:
Remove unused prototypes.
From-SVN: r93651
|
|
* defaults.h (ASM_OUTPUT_INTERNAL_LABEL): New macro.
* output.h (assemble_name_raw): Declare it.
* system.h (ASM_OUTPUT_INTERNAL_LABEL): Do not poison it.
* varasm.c (assemble_name_raw): New function.
(assemble_name): Use it.
(default_internal_label): Likewise.
* config/darwin.c (darwin_asm_output_dwarf_delta): Likewise.
* doc/tm.texi (ASM_OUTPUT_INTERNAL_LABEL): Document.
From-SVN: r92401
|
|
* basic-block.h, c-common.h, df.h, expr.h, output.h, rtl.h,
tree-chrec.h, tree-flow.h, tree-scalar-evolution.h,
tree-ssa-live.h, tree.h: Remove unused prototypes.
From-SVN: r90821
|
|
* varasm.c (get_named_section_flags, decl_tls_model): Make
them static.
* output.h: Remove the prototype for get_named_section_flags.
* tree.h: Remove the prototype for decl_tls_model.
From-SVN: r90506
|
|
* dbxout.c: Include obstack.h.
(ASM_STABS_OP): Take XCOFF_DEBUGGING_INFO into account in
default definition.
(ASM_STABD_OP, NO_DBX_MAIN_SOURCE_DIRECTORY, DBX_CONTIN_CHAR):
Default-define here.
(DBX_CONTIN_LENGTH): Move definition with others.
(DBX_FINISH_STABS): New target macro.
(current_sym_code, current_sym_value, current_sym_addr)
(current_sym_nchars, CHARS, dbxout_continue)
(print_int_cst_octal, print_octal, print_wide_int)
(dbxout_prepare_symbol, dbxout_finish_symbol): Delete.
(stabstr_ob, stabstr_last_contin_point): New variables.
(NUMBER_FMT_LOOP): New improper macro.
(dbxout_int, dbxout_stab_value_zero, dbxout_stab_value_label)
(dbxout_stab_value_label_diff, dbxout_stab_value_internal_label)
(dbxout_stab_value_internal_label_diff, dbxout_stabd)
(dbxout_begin_stabn, dbxout_begin_stabn_sline)
(dbxout_begin_simple_stabs, dbxout_begin_simple_stabs_desc)
(dbxout_begin_complex_stabs, dbxout_finish_complex_stabs)
(stabstr_C, stabstr_S, stabstr_I, stabstr_D, stabstr_U, stabstr_O)
(stabstr_continue, DECL_ACCESSIBILITY_CHAR)
New functions and/or proper function-like macros.
(CONTIN): Use stabstr_continue, unconditionally.
(get_lang_number): Define unconditionally, with ATTRIBUTE_UNUSED.
(dbxout_init): Initialize stabstr_ob. Check
NO_DBX_MAIN_SOURCE_DIRECTORY. Only write out the Ltext label
if it was used. Use the new interfaces.
(dbxout_source_file): Remove file argument; always write to
asm_out_file. Use the new interfaces.
(dbxout_type_method_1): Remove second argument which is always
DECL_ASSEMBLER_NAME of the first argument. Use the new interfaces.
(dbxout_type_methods): Remove write-only variables. Use the
new interfaces.
(dbxout_parms): Refactor to remove code duplicated in each of
several successive if-else-if blocks. Use the new interfaces.
(dbxout_function_end, emit_bincl_stab, dbxout_end_source_file)
(dbxout_source_line, dbxout_finish, dbxout_type_index)
(dbxout_type_fields, dbxout_range_type, dbxout_type, dbxout_type_name)
(dbxout_class_name_qualifiers, dbxout_symbol, dbxout_symbol_location)
(dbxout_symbol_name, dbxout_reg_parms, dbxout_args)
(dbx_output_lbrac, dbx_output_rbrac, dbxout_block):
Use the new interfaces.
* Makefile.in (dbxout.o): Update dependencies.
* defaults.h: Don't define ASM_STABD_OP.
* output.h: Prototype new dbxout_* interfaces.
* system.h: Poison DBX_OUTPUT_GCC_MARKER and DBX_FINISH_SYMBOL.
* varasm.c: Don't define ASM_STABS_OP.
(default_stabs_asm_out_constructor, default_stabs_asm_out_destructor):
Use the new dbxout.c interfaces. Call sorry if neither
DBX_DEBUGGING_INFO nor XCOFF_DEBUGGING_INFO is defined.
* xcoffout.h: Don't define ASM_STABS_OP.
(DBX_FINISH_SYMBOL): Rewrite and rename DBX_FINISH_STABS.
(DBX_OUTPUT_MAIN_SOURCE_DIRECTORY, DBX_OUTPUT_GCC_MARKER): Delete.
(NO_DBX_MAIN_SOURCE_DIRECTORY, NO_DBX_GCC_MARKER): Define.
(DBX_OUTPUT_MAIN_SOURCE_FILE_END): Change bare block to
do { ... } while (0) idiom.
* config/alpha/alpha.c (num_source_filenames): Export.
* config/alpha/alpha.h (num_source_filenames): Declare.
(DBX_OUTPUT_SOURCE_LINE): Use new interfaces.
(SDB_OUTPUT_SOURCE_LINE): Add missing newline.
* config/m32r/m32r.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces.
Always use .debugsym. Update commentary.
* config/mips/mips.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces.
(SDB_OUTPUT_SOURCE_LINE): Add missing newline.
* config/rs6000/linux64.h (DBX_OUTPUT_SOURCE_LINE, DBX_OUTPUT_BRAC):
Use new interfaces.
* config/rs6000/rs6000.c: If TARGET_MACHO, include gstab.h.
(macho_branch_islands): Use new interfaces.
* doc/tm.texi: Update.
From-SVN: r89623
|
|
* configure.ac: Check for COMDAT support. Robustify check for
SHF_MERGE support.
* configure: Regenerated.
* config.in: Likewise.
* langhooks-def.h (lhd_comdat_group): New function.
(LANG_HOOKS_COMDAT_GROUP): New macro.
(LANG_HOOKS_DECLS): Use it.
* langhooks.c (lhd_comdat_group): Define.
* langhooks.h (lang_hooks_for_decls): Add comdat_group.
* output.h (named_section_flags): Make it a macro.
(named_section_real): New function.
(default_no_named_section): Add decl parameter.
(default_elf_asm_named_section): Likewise.
(default_coff_asm_named_section): Likewise.
(default_pe_asm_named_section): Likewise.
* target.h (gcc_target): Adjust type of named_section.
* varasm.c (named_section_flags): Rename to named_section_real.
Add decl parameter.
(default_no_named_section): Add decl parameter.
(default_elf_asm_named_section): Use COMDAT, if available. Deal
with the case that ASM_COMMENT_START is "@".
(default_coff_asm_named_section): Add decl parameter.
(default_pe_asm_named_section): Likewise.
* config/alpha/alpha.c (vms_asm_named_section): Add decl
parameter.
(unicosmk_asm_named_section): Likewise.
* config/arm/arm.c (arm_elf_asm_named_section): Remove.
* config/arm/elf.h (TARGET_ASM_NAMED_SECTION): Likewise.
* config/c4x/c4x.c (c4x_asm_named_section): Add decl parameter.
* config/cris/cris-protos.h (cris_target_asm_named_section):
Likewise.
* config/cris/cris.c (cris_target_asm_named_section):
Likewise.
* config/h8300/h8300.c (h8300_asm_named_section): Likewise.
* config/i386/i386-protos.h (i386_pe_asm_named_section):
Likewise.
* config/i386/winnt.c (i386_pe_asm_named_section): Likewise.
* config/m68k/m68k.c (m68k_coff_asm_named_section): Likewise.
* config/mcore/mcore.c (mcore_asm_named_section): Likewise.
* config/rs6000/rs6000.c (rs6000_xcoff_asm_named_section):
Likewise.
* config/sparc/sparc.c (sparce_elf_asm_named_section): Likewise.
* cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define.
* cp-tree.h (cxx_comdat_group): Declare.
* decl.c (cxx_comdat_group): New function.
From-SVN: r87557
|
|
* output.h (unlikely_section_label): Delete declaration.
(unlikely_text_section_name): Likewise.
* varasm.c (unlikely_section_label_printed): Make static.
(unlikely_section_label): Likewise.
(unlikely_text_section_name): Likewise.
From-SVN: r87313
|
|
Hot/cold partitioning update patch. The problems that this patch
attemptd to address/fix are:
- Fix places where adding in_unlikely_executed_text to the enum data
type "in_section" threw off switch case statements.
- Make it work correctly (by turning it off) for functions where user
specifies "__attribute__ section"
- Make it work correctly (by turning it off) for linkonce sections
- Make it work correctly with -ffunction-sections flag
- Make it output correct cold section labels
- Undo some changes to original assembly code generation
- Turn off hot/cold partitioning in the presence of DWARF debugging (for
the moment)
- Turn off hot/cold partitioning for architectures that do not support
named sections
- Use variables rather than constants for cold section labels and names (to
work correctly with -ffunction-sections, among other things)
2004-08-18 Caroline Tice <ctice@apple.com>
* Makefile.in (STAGEFEEDBACK_FLAGS_TO_PASS) Add
"-freorder-blocks-and-partition" to the flags used in second
stage of profiledbootstrap.
* bb-reorder.c (push_to_next_round_p): Add new variable,
next_round_is_last; set and use variable to make sure, when
partitioning, that the last trace construction round consists
of all (and only) cold basic blocks.
(rotate_loop): Don't copy blocks that end in a section
crossing jump.
(copy_bb): Correctly initialize "partition" of duplicated bb.
(add_unlikely_executed_notes): Add a comment.
(find_rarely_executed_basic_blocks_and_crossing_edges): Modify
to make sure, if function contains hot blocks, that the
successors of ENTRY_BLOCK_PTR are hot; also, only look for
crossing edges if the architecture supports named sections.
(mark_bb_for_unlikely_executed_section): Modify to always
insert the NOTE_INSN_UNLIKELY_EXECUTED_CODE immediately after
the basic block note insn.
(fix_crossing_unconditional_branches): Remove extra space.
(fix_edges_for_rarely_executed_code): Modify to only do
partitioning work if the architecture supports named sections.
(reorder_basic_blocks): Modify to only add
NOTE_INSN_UNLIKELY_EXECUTED_CODE notes if the architecture
supports named sections.
* c-common.c (handle_section_attribute): Initialize new global
variable, user_defined_section_attribute, to true if user has
specified one.
* cfgcleanup.c (try_forward_edges): Modify to not attempt to
forward edges that cross section boundaries.
* cfglayout.c (fixup_reorder_chain): Modify to only fix up
partitioning information if the architecture supports named
sections.
* cfgrtl.c (target.h): Add statement to include this.
(rtl_split_block): Make sure newly created bb gets correct
partition.
(try_redirect_by_replacing_jump): Make sure redirection isn't
attempting to cross section boundaries.
(force_nonfallthru_and_redirect): Only do partition fix up if
architecture supports named sections.
(rtl_split_edge): Make sure newly created bb ends up in
correct partition.
(commit_one_edge_insertion): Remove code that incorrectly
updated basic block partition; Make sure partition fix up only
happens if architecture supports named sections and it's not
already done.
(rtl_verify_flow_info_1): Fix if-condition on test/error
condition that fallthru edges are not allowed to cross section
boundaries.
* defaults.h (NORMAL_TEXT_SECTION_NAME): Remove this.
* final.c (final_scan_insn): Remove redundant test from if-statement;
change calls to text_section into calls to function_section; add code
to only to partitioning fix up if architecture supports named
sections.
* ifcvt.c (find_if_case_1): Make sure newly created bb has correct
partition.
(if_convert): Add targetm.have_named_sections to test.
* output.h (unlikely_section_label): Extern declaration for new global
variable.
(unlikely_text_section_name): Likewise.
* opts.c (decode_options): If both partitioning and DWARF debugging
are turned on, issue a warning that this doesn't work, and change
partitiong to basic block reordering (without hot/cold partitions).
* passes.c (rest_of_handle_final): Re-set new global variable,
user_defined_section_attribute, to false.
(rest_of_compilation): Change options for calling partitioning
function: Don't call if the user defined the section attribute, and
don't call if DECL_ONE_ONLY is true for the current function.
* predict.c (choose_function_section): Return immediately if we
are doing hot/cold partitioning (i.e. let the basic block partitioning
determine where the function belongs).
* reg-stack.c (emit_swap_insn): Add condition to step over
NOTE_INSN_UNLIKELY_EXECUTED_CODE notes.
* toplev.c (user_defined_section_attribute): New global variable.
* toplev.h (user_defined_section_attribute): Extern declaration for new
global variable.
* varasm.c (unlikely_section_label): New global variable.
(unlikely_text_section_name): New global variable.
(unlikely_text_section): Add code to initialize unlikely_text_section_name
if necessary; modify to use unlikely_text_section_name and
unlikely_section_label; also to use named_section properly.
(in_unlikely_text_section): Modify to work correctly with named_section
and to use unlikely_text_section_name.
(named_section): Add code to work properly with cold section.
(function_section): Clean up if-statement.
* config/darwin.c (darwin_asm_named_section): Return to original code,
removing use of SECTION_FORMAT_STRING.
* config/arm/pe.h (switch_to_section): Add case for
in_unlikely_executed_text to switch statement.
* config/i386/cygming.h (switch_to_section): Likewise.
* config/i386/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove.
(SECTION_FORMAT_STRING): Likewise.
* config/mcore/mcore.h (switch_to_section): Likewise.
* config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove.
From-SVN: r86189
|
|
PR c++/16276
* output.h (default_function_rodata_section,
default_no_function_rodata_section): New prototypes.
* target.h (struct gcc_target): Add asm_out.function_rodata_section.
* target-def.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Define.
(TARGET_ASM_OUT): Add it.
* varasm.c (default_function_rodata_section,
default_no_function_rodata_section): New functions.
* final.c (final_scan_insn): Call
targetm.asm_out.function_rodata_section instead of
readonly_data_section.
* config/darwin.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Define.
* config/mcore/mcore.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
* config/ip2k/ip2k.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
* config/rs6000/xcoff.h (TARGET_ASM_FUNCTION_RODATA_SECTION):
Likewise.
* config/alpha/alpha.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
* config/i386/cygming.h (TARGET_ASM_FUNCTION_RODATA_SECTION):
Likewise.
* config/i386/i386-interix.h (TARGET_ASM_FUNCTION_RODATA_SECTION):
Likewise.
* config/arm/pe.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
* config/avr/avr.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
* doc/tm.texi (TARGET_ASM_FUNCTION_RODATA_SECTION): Document.
* g++.old-deja/g++.other/comdat4.C: New test.
* g++.old-deja/g++.other/comdat4-aux.cc: New.
From-SVN: r85873
|
|
2004-07-08 Paolo Bonzini <bonzini@gnu.org>
* explow.c (optimize_save_area_alloca): Do not accept parameters.
* passes.c (rest_of_handle_final): Handle symout.
(rest_of_handle_new_regalloc, rest_of_handle_old_regalloc):
Push timevar here.
(rest_of_handle_sched): Break out SMS. Remove ifs for
flag_schedule_insns and flag_modulo_sched.
(rest_of_handle_addressof, rest_of_handle_cse2): Garbage
collect at the end.
(rest_of_handle_gcse2): Put under timevar TV_RELOAD_CSE_REGS.
(rest_of_handle_partition_blocks, rest_of_handle_sms,
rest_of_handle_if_after_reload, rest_of_handle_peephole2,
rest_of_handle_mode_switching, rest_of_handle_jump,
rest_of_handle_guess_branch_prob, rest_of_handle_eh,
rest_of_handle_jump2, rest_of_handle_postreload,
rest_of_handle_flow2, rest_of_clean_state,
rest_of_handle_shorten_branches,
rest_of_handle_prologue_epilogue,
rest_of_handle_branch_target_load_optimize): New.
(rest_of_compilation): Call the above. Remove ggc_collect
calls moved to rest_of_handle_*.
* rtl.h (optimize_save_area_alloca): Do not accept parameters.
* dwarf2out.c (dwarf2out_begin_prologue): Use TREE_NOTHROW.
* except.c (set_nothrow_function_flags): Set TREE_NOTHROW.
* except.h (set_nothrow_function_flags): Update comment.
* function.c (current_function_nothrow): Remove.
* output.h (current_function_nothrow): Remove.
* passes.c (rest_of_compilation): Do not set TREE_NOTHROW.
* config/arm/arm.c (arm_compute_func_type): Use TREE_NOTHROW.
From-SVN: r84274
|
|
label is for eh.
* doc/tm.texi (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument to indicate
if this label is for eh.
* config/darwin-protos.h (darwin_emit_unwind_label): Likewise.
* config/darwin.c (darwin_emit_unwind_label): Likewise.
* dwarf2out.c (output_call_frame_info): Likewise.
* output.h (default_emit_unwind_label): Likewise.
* target.h (unwind_label): Likewise.
* varasm.c (default_emit_unwind_label): Likewise.
* config/darwin.h (DWARF2_DEBUGGING_INFO, PREFERRED_DEBUGGING_TYPE,
DEBUG_FRAME_SECTION, DEBUG_INFO_SECTION, DEBUG_ABBREV_SECTION,
DEBUG_ARANGES_SECTION, DEBUG_MACINFO_SECTION, DEBUG_LINE_SECTION,
DEBUG_LOC_SECTION, DEBUG_PUBNAMES_SECTION, DEBUG_STR_SECTION,
DEBUG_RANGES_SECTION): Define.
Radar 3657068.
Co-Authored-By: Devang Patel <dpatel@apple.com>
From-SVN: r82016
|
|
From-SVN: r81764
|
|
2004-04-09 Caroline Tice <ctice@apple.com>
* basic-block.h (struct edge_def): Add new field, crossing_edge.
(struct basic_block_def): Add new field, partition.
(UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro
definitions.
(partition_hot_cold_basic_blocks): Add extern function
declaration.
* bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new
include statements.
(N_ROUNDS): Increase the maximum number of rounds by 1.
(branch_threshold): Add array value for new round.
(exec_threshold): Add array value for new round.
(push_to_next_round_p): New function.
(add_unlikely_executed_notes): New function.
(find_rarely_executed_basic_blocks_and_crossing_edges): New function.
(mark_bb_for_unlikely_executed_section): New function.
(add_labels_and_missing_jumps): New function.
(add_reg_crossing_jump_notes): New function.
(fix_up_fall_thru_edges): New function.
(find_jump_block): New function.
(fix_crossing_conditional_branches): New function.
(fix_crossing_unconditional_branches): New function.
(fix_edges_for_rarely_executed_code): New function.
(partition_hot_cold_basic_blocks): New function.
(find_traces): Add an extra round for partitioning hot/cold
basic blocks.
(find_traces_1_round): Add a parameter. Modify to push all cold blocks,
and only cold blocks, into the last (extra) round of collecting traces.
(better_edge_p): Add a parameter. Modify to favor non-crossing edges
over crossing edges.
(bb_to_key): Add code to correctly identify cold blocks when
doing partitioning.
(connect_traces): Modify to connect all the non-cold traces first, then
go back and connect up all the cold traces.
(reorder_basic_blocks): Add call to add_unlikely_executed_notes.
* cfg.c (entry_exit_blocks): Add initialization for partition field in
entry and exit blocks.
* cfgbuild.c (make_edges): Update current_function_has_computed_jump
if we are doing hot/cold partitioning.
* cfgcleanup.c (cfglayout.h): Add new include statement.
(try_simplify_condjump): Modify to not attempt on blocks with jumps
that cross section boundaries.
(try_forward_edges): Likewise.
(merge_blocks_move_predecessor_nojumps): Likewise.
(merge_blocks_move_successor_nojumps): Likewise.
(merge_blocks_move): Likewise.
(try_crossjump_to_edge): Modify to not attempt after we have done
the block partitioning.
(try_crossjump_bb): Modify to not attempt on blocks with jumps that
cross section boundaries.
(try_optimize_cfg): Likewise.
* cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect
jumps that cross section boundaries.
* cfglayout.c (flags.h): Add new include statement.
(update_unlikely_executed_notes): New function.
(fixup_reorder_chain): Add code so when a new jumping basic block is
added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are
updated appropriately.
(duplicate_insn_chain): Add code to duplicate the new NOTE insn
introduced by this optimization.
* cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new
extern function declaration.
* cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to
list of notes that can be deleted.
(create_basic_block_structure): Add initialization for partition field.
(rtl_can_merge_blocks): Modify to test blocks for jumps that cross
section boundaries.
(try_redirect_by_replacing_jump): Modify to not attempt on jumps that
cross section boundaries.
(commit_one_edge_insertion): Add code so newly created basic block
ends up in correct (hot or cold) section. Modify to disallow
insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes.
(rtl_verify_flow_info_1): Add code to verify that no fall_thru edge
crosses section boundaries.
(cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that
cross section boundaries.
(force_nonfallthru_and_redirect): Modify to make sure new basic block
ends up in correct section, with correct notes attached.
* common.opt (freorder-blocks-and-partition): Add new flag for this
optimization.
* dbxout.c (dbx_function_end): Add code to make sure scope labels at
the end of functions are written into the correct (hot or cold)
section.
(dbx_source_file): Add code so writing debug file information
doesn't incorrectly change sections.
* defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use
in partitioning hot/cold basic blocks into separate sections.
(SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold
section partitioning.
(HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not
conditional branches can span all of memory.
(HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not
unconditional branches can span all of memory.
* final.c (scan_ahead_for_unlikely_executed_note): New function.
(final_scan_insn): Add code to check for NOTE instruction indicating
whether basic block belongs in hot or cold section, and to make sure
the current basic block is being written to the appropriate section.
Also added code to ensure that jump table basic blocks end up in the
correct section.
* flags.h (flag_reorder_blocks_and_partition): New flag.
* ifcvt.c (find_if_case_1): Modify to not attempt if conversion if
one of the branches has a jump that crosses between sections.
(find_if_case_2): Likewise.
(ifcvt): Modify to not attempt to mark loop exit edges after
hot/cold partitioning has occurred.
* opts.c (decode_options): Code to handle new flag,
flag_reorder_blocks_and_partition; also to turn it off if
flag_exceptions is on.
(common_handle_option): Code to handle new flag,
flag_reorder_blocks_and_partition.
* output.h (unlikely_text_section): New extern function declaration.
(in_unlikely_text_section): New extern function declaration.
* passes.c (rest_of_handle_stack_regs): Add
flag_reorder_blocks_and_partition as an 'or' condition for calling
reorder_basic_blocks.
(rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition
as an 'or' condition for calling reorder_basic_blocks.
(rest_of_compilation): Add call to partition_hot_cold_basic_blocks.
* print-rtl.c (print_rtx): Add code for handling new note,
NOTE_INSN_UNLIKELY_EXECUTED_CODE
* rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below).
(REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that
cross between section boundaries.
* rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction,
indicating the basic block containing it belongs in the cold section.
(REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross
between hot and cold sections.
* toplev.c (flag_reorder_blocks_and_partition): Add code to
initialize this flag, and to tie it to the command-line option
freorder-blocks-and-partition.
* varasm.c (cfglayout.h): Add new include statement.
(unlikely_section_label_printed): New global variable, used for
determining when to output section name labels for cold sections.
(in_section): Add in_unlikely_executed_text to enum data structure.
(text_section): Modify code to use SECTION_FORMAT_STRING and
NORMAL_TEXT_SECTION_NAME macros.
(unlikely_text_section): New function.
(in_unlikely_text_section): New function.
(function_section): Add code to make sure beginning of function is
written into correct section (hot or cold).
(assemble_start_function): Add code to make sure stuff is written to
the correct section.
(assemble_zeros): Add in_unlikely_text_section as an 'or' condition
to an if statement that was checking 'in_text_section'.
(assemble_variable): Add 'in_unlikely_text_section' as an 'or'
condition to an if statement that was checking 'in_text_section'.
(default_section_type_flags_1): Add check: if in cold section
flags = SECTION_CODE.
* config/darwin.c (darwin_asm_named_section): Modify to use
SECTION_FORMAT_STRING if we are partitioning hot/cold blocks.
* config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro
specifically for the i386.
(HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386.
* config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change
text string to something more informative.
(NORMAL_TEXT_SECTION_NAME): Add new definition.
(SECTION_FORMAT_STRING): Add new definition.
* config/rs6000/rs6000.c (rs6000_assemble_integer): Add
'!in_unlikely_text_section' as an 'and' condition to an if statement
that was already checking '!in_text_section'.
* config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME,
UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make
sure these are properly defined for linux on ppc.
* doc/invoke.texi (freorder-blocks-and-partition): Add documentation
for this new flag.
* doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new
reg_note.
* doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING,
HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for
these new macros.
From-SVN: r80564
|
|
* target.h (struct gcc_target): New target hook, unwind_label.
* target-def.h (TARGET_ASM_EMIT_UNWIND_LABEL): New hook.
* output.h (default_emit_unwind_label): New function.
* default.h (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): New macro.
(TARGET_USES_WEAK_UNWIND_INFO): New target macro.
(TARGET_SUPPORTS_HIDDEN): New target macro.
* dwarf2out.c (struct dw_fde_struct): Add field for function decl
that corresponds to this FDE.
(FRAME_BEGIN_LABEL): Allow target to override default label.
(output_call_frame_info): If FDEs are linknonce, then use extra
indirection for FDE encoding, output a label for each FDE, and
output an empty label for each function without an FDE.
(dwarf2out_begin_prologue): Set up decl field when creating an FDE.
* varasm.c (globalize_decl): Call ASM_MAKE_LABEL_LINKONCE for
decls with DECL_ONE_ONLY set, if that macro is defined.
(make_decl_one_only): Don't use DECL_COMMON if we're compiling
for a SUPPORTS_ONE_ONLY target.
* config/darwin-protos.h (darwin_unique_section): Declare.
(darwin_asm_named_section): Likewise.
(darwin_section_type_flags): Likewise.
(darwin_non_lazy_pcrel): Likewise.
(darwin_emit_unwind_label): Likewise.
(darwin_make_decl_one_only): Likewise.
* config/darwin.c (machopic_finish): Get rid of tweak that
eliminate stubs for symbols that are defined.
(darwin_encode_section_info): Don't treat weak functions as defined.
(darwin_make_decl_one_only): Define.
(darwin_asm_named_section): Likewise.
(darwin_section_type_flags): Likewise.
(darwin_unique_section): Likewise.
(darwin_emit_unwind_label): Likewise.
(darwin_non_lazy_pcrel): Likewise.
(darwin_asm_output_dwarf_delta): Difference between two labels is
local only if both labels are local.
* config/darwin.h (MAKE_DECL_ONE_ONLY): Define.
(ASM_MAKE_LABEL_LINKONCE): Likewise.
(TARGET_SUPPORTS_HIDDEN): Likewise.
(TARGET_USES_WEAK_UNWIND_INFO): Likewise.
(TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): Likewise.
(FRAME_BEGIN_LABEL): Likewise.
(ASM_DECLARE_OBJECT_NAME): Make references to weak symbols indirect.
(ASM_DECLARE_FUNCTION_NAME): Likewise.
(darwin_eh_frame_section): Give __eh_frame section the coalesced flag.
(TARGET_ASM_UNIQUE_SECTION): Define.
(EH_FRAME_SECTION_NAME): Define.
(EH_FRAME_SECTION_ATTR): Likewise.
(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise.
(TARGET_ASM_NAMED_SECTION): Likewise.
(TARGET_SECTION_TYPE_FLAGS): Likewise.
* doc/tm.texi: Document TARGET_USES_WEAK_UNWIND_INFO,
TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY, TARGET_SUPPORTS_HIDDEN,
TARGET_ASM_EMIT_UNWIND_LABEL.
* cp/decl2.c (maybe_make_one_only): Look at
TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether
to make an explicit instantiation weak.
* cp/method.c (use_thunk): Make sure we call comdat_linkage
when appropriate.
* cp/pt.c (do_type_instantiation): On systems where weak symbols
don't go in a static archive's TOC, explicit instantiation of a
class must imply *explicit* instantiation of its memeber.
From-SVN: r79394
|