Commit Graph

29 Commits

Author SHA1 Message Date
Richard Sandiford 0c3317563e lra-int.h (lra_static_insn_data): Make operand_alternative a const pointer.
gcc/
	* lra-int.h (lra_static_insn_data): Make operand_alternative a
	const pointer.
	(target_lra_int, default_target_lra_int, this_target_lra_int)
	(op_alt_data): Delete.
	* lra.h (lra_init): Delete.
	* lra.c (default_target_lra_int, this_target_lra_int): Delete.
	(init_insn_code_data_once): Remove op_alt_data handling.
	(finish_insn_code_data_once): Likewise.
	(init_op_alt_data): Delete.
	(get_static_insn_data): Initialize operand_alternative to null.
	(free_insn_recog_data): Cast operand_alternative before freeing it.
	(setup_operand_alternative): Take the operand_alternative as
	parameter and assume it isn't already cached in the static
	insn data.
	(lra_set_insn_recog_data): Update accordingly.
	(lra_init): Delete.
	* ira.c (ira_init): Don't call lra_init.
	* target-globals.h (this_target_lra_int): Declare.
	(target_globals): Remove lra_int.
	(restore_target_globals): Update accordingly.
	* target-globals.c: Don't include lra-int.h.
	(default_target_globals, save_target_globals): Remove lra_int.

From-SVN: r211241
2014-06-04 17:34:49 +00:00
Richard Sandiford 4cc8d9d2df system.h (TEST_BIT): New macro.
gcc/
	* system.h (TEST_BIT): New macro.
	* recog.h (alternative_mask): New type.
	(ALL_ALTERNATIVES, ALTERNATIVE_BIT): New macros.
	(recog_data_d): Replace alternative_enabled_p array with
	enabled_alternatives.
	(target_recog): New structure.
	(default_target_recog, this_target_recog): Declare.
	(get_enabled_alternatives, recog_init): Likewise.
	* recog.c (default_target_recog, this_target_recog): New variables.
	(get_enabled_alternatives): New function.
	(extract_insn): Use it.
	(recog_init): New function.
	(preprocess_constraints, constrain_operands): Adjust for change to
	recog_data.
	* postreload.c (reload_cse_simplify_operands): Likewise.
	* reload.c (find_reloads): Likewise.
	* ira-costs.c (record_reg_classes): Likewise.
	* ira-lives.c (single_reg_class): Likewise.  Fix bug in which
	all alternatives after a disabled one would be skipped.
	(ira_implicitly_set_insn_hard_regs): Likewise.
	* ira.c (ira_setup_alts): Adjust for change to recog_data.
	* lra-int.h (lra_insn_recog_data): Replace alternative_enabled_p
	with enabled_alternatives.
	* lra.c (free_insn_recog_data): Update accordingly.
	(lra_update_insn_recog_data): Likewise.
	(lra_set_insn_recog_data): Likewise.  Use get_enabled_alternatives.
	* lra-constraints.c (process_alt_operands): Likewise.  Handle
	only_alternative as part of the enabled mask.
	* target-globals.h (this_target_recog): Declare.
	(target_globals): Add a recog field.
	(restore_target_globals): Restore this_target_recog.
	* target-globals.c: Include recog.h.
	(default_target_globals): Initialize recog field.
	(save_target_globals): Likewise.
	* reginfo.c (reinit_regs): Call recog_init.
	* toplev.c (backend_init_target): Likewise.

From-SVN: r210964
2014-05-27 10:06:22 +00:00
Trevor Saunders 766090c20f use templates instead of gengtype for typed allocation functions
gcc/ChangeLog:

	* alias.c (record_alias_subset): Adjust.
	* bitmap.c (bitmap_element_allocate): Likewise.
	(bitmap_gc_alloc_stat): Likewise.
	* cfg.c (init_flow): Likewise.
	(alloc_block): Likewise.
	(unchecked_make_edge): Likewise.
	* cfgloop.c (alloc_loop): Likewise.
	(flow_loops_find): Likewise.
	(rescan_loop_exit): Likewise.
	* cfgrtl.c (init_rtl_bb_info): Likewise.
	* cgraph.c (insert_new_cgraph_node_version): Likewise.
	(cgraph_allocate_node): Likewise.
	(cgraph_create_edge_1): Likewise.
	(cgraph_allocate_init_indirect_info): Likewise.
	* cgraphclones.c (cgraph_clone_edge): Likewise.
	* cgraphunit.c (add_asm_node): Likewise.
	(init_lowered_empty_function): Likewise.
	* config/aarch64/aarch64.c (aarch64_init_machine_status):
	Likewise.
	* config/alpha/alpha.c (alpha_init_machine_status): Likewise.
	(alpha_use_linkage): Likewise.
	* config/arc/arc.c (arc_init_machine_status): Likewise.
	* config/arm/arm.c (arm_init_machine_status): Likewise.
	* config/avr/avr.c (avr_init_machine_status): Likewise.
	* config/bfin/bfin.c (bfin_init_machine_status): Likewise.
	* config/c6x/c6x.c (c6x_init_machine_status): Likewise.
	* config/cris/cris.c (cris_init_machine_status): Likewise.
	* config/darwin.c (machopic_indirection_name): Likewise.
	(darwin_build_constant_cfstring): Likewise.
	(darwin_enter_string_into_cfstring_table): Likewise.
	* config/epiphany/epiphany.c (epiphany_init_machine_status):
	* Likewise.
	* config/frv/frv.c (frv_init_machine_status): Likewise.
	* config/i386/i386.c (get_dllimport_decl): Likewise.
	(ix86_init_machine_status): Likewise.
	(assign_386_stack_local): Likewise.
	* config/i386/winnt.c (i386_pe_record_external_function):
	Likewise.
	(i386_pe_maybe_record_exported_symbol): Likewise.
	(i386_pe_record_stub): Likewise.
	* config/ia64/ia64.c (ia64_init_machine_status): Likewise.
	* config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise.
	* config/m32c/m32c.c (m32c_init_machine_status): Likewise.
	(m32c_note_pragma_address): Likewise.
	* config/mep/mep.c (mep_init_machine_status): Likewise.
	(mep_note_pragma_flag): Likewise.
	* config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise.
	(mips16_local_alias): Likewise.
	(mips_init_machine_status): Likewise.
	* config/mmix/mmix.c (mmix_init_machine_status): Likewise.
	* config/moxie/moxie.c (moxie_init_machine_status): Likewise.
	* config/msp430/msp430.c (msp430_init_machine_status): Likewise.
	* config/nds32/nds32.c (nds32_init_machine_status): Likewise.
	* config/nios2/nios2.c (nios2_init_machine_status): Likewise.
	* config/pa/pa.c (pa_init_machine_status): Likewise.
	(pa_get_deferred_plabel): Likewise.
	* config/rl78/rl78.c (rl78_init_machine_status): Likewise.
	* config/rs6000/rs6000.c (builtin_function_type): Likewise.
	(rs6000_init_machine_status): Likewise.
	(output_toc): Likewise.
	* config/s390/s390.c (s390_init_machine_status): Likewise.
	* config/score/score.c (score_output_external): Likewise.
	* config/sparc/sparc.c (sparc_init_machine_status): Likewise.
	* config/spu/spu.c (spu_init_machine_status): Likewise.
	* config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise.
	* config/tilepro/tilepro.c (tilepro_init_machine_status):
	* Likewise.
	* config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise.
	* coverage.c (coverage_end_function): Likewise.
	* dbxout.c (dbxout_init): Likewise.
	* doc/gty.texi: Don't mention variable_size attribute.
	* dwarf2cfi.c (new_cfi): Adjust.
	(new_cfi_row): Likewise.
	(copy_cfi_row): Likewise.
	(create_cie_data): Likewise.
	* dwarf2out.c (dwarf2out_alloc_current_fde): Likewise.
	(new_loc_descr): Likewise.
	(find_AT_string_in_table): Likewise.
	(add_addr_table_entry): Likewise.
	(new_die): Likewise.
	(add_var_loc_to_decl): Likewise.
	(clone_die): Likewise.
	(clone_as_declaration): Likewise.
	(break_out_comdat_types): Likewise.
	(new_loc_list): Likewise.
	(add_loc_descr_to_each): Likewise.
	(add_location_or_const_value_attribute): Likewise.
	(add_linkage_name): Likewise.
	(lookup_filename): Likewise.
	(dwarf2out_var_location): Likewise.
	(new_line_info_table): Likewise.
	(dwarf2out_init): Likewise.
	(mem_loc_descriptor): Likewise.
	(loc_descriptor): Likewise.
	(add_const_value_attribute): Likewise.
	(tree_add_const_value_attribute): Likewise.
	(comp_dir_string): Likewise.
	(dwarf2out_vms_debug_main_pointer): Likewise.
	(string_cst_pool_decl): Likewise.
	* emit-rtl.c (set_mem_attrs): Likewise.
	(get_reg_attrs): Likewise.
	(start_sequence): Likewise.
	(init_emit): Likewise.
	(init_emit_regs): Likewise.
	* except.c (init_eh_for_function): Likewise.
	(gen_eh_region): Likewise.
	(gen_eh_region_catch): Likewise.
	(gen_eh_landing_pad): Likewise.
	(add_call_site): Likewise.
	* function.c (add_frame_space): Likewise.
	(insert_temp_slot_address): Likewise.
	(assign_stack_temp_for_type): Likewise.
	(get_hard_reg_initial_val): Likewise.
	(allocate_struct_function): Likewise.
	(prepare_function_start): Likewise.
	(types_used_by_var_decl_insert): Likewise.
	* gengtype.c (variable_size_p): Remove function.
	(enum alloc_quantity): Remove enum.
	(write_typed_alloc_def): Remove function.
	(write_typed_struct_alloc_def): Likewise.
	(write_typed_typedef_alloc_def): Likewise.
	(write_typed_alloc_defns): Likewise.
	(main): Adjust.
	* ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust.
	(ggc_cleared_alloc_ptr_array_two_args): Likewise.
	* ggc.h (ggc_alloc): new function.
	(ggc_cleared_alloc): Likewise.
	(ggc_vec_alloc): Template on type of vector element, and remove
	element size argument.
	(ggc_cleared_vec_alloc): Likewise.
	* gimple.c (gimple_build_omp_for): Adjust.
	(gimple_copy): Likewise.
	* ipa-cp.c (get_replacement_map): Likewise.
	(find_aggregate_values_for_callers_subset): Likewise.
	(known_aggs_to_agg_replacement_list): Likewise.
	* ipa-devirt.c (get_odr_type): Likewise.
	* ipa-prop.c (ipa_node_duplication_hook): Likewise.
	(read_agg_replacement_chain): Likewise.
	* loop-iv.c (get_simple_loop_desc): Likewise.
	* lto-cgraph.c (input_node_opt_summary): Likewise.
	* lto-section-in.c (lto_new_in_decl_state): Likewise.
	* lto-streamer-in.c (lto_input_eh_catch_list): Likewise.
	(input_eh_region): Likewise.
	(input_eh_lp): Likewise.
	(input_cfg): Likewise.
	* optabs.c (set_optab_libfunc): Likewise.
	(init_tree_optimization_optabs): Likewise.
	(set_conv_libfunc): Likewise.
	* passes.c (do_per_function_toporder): Likewise.
	* rtl.h: Don't use variable_size gty attribute.
	* sese.c (if_region_set_false_region): Adjust.
	* stringpool.c (gt_pch_save_stringpool): Likewise.
	* target-globals.c (save_target_globals): Likewise.
	* toplev.c (general_init): Likewise.
	* trans-mem.c (record_tm_replacement): Likewise.
	(split_bb_make_tm_edge): Likewise.
	* tree-cfg.c (move_sese_region_to_fn): Likewise.
	* tree-data-ref.h (lambda_vector_new): Likewise.
	* tree-eh.c (add_stmt_to_eh_lp_fn): Likewise.
	* tree-iterator.c (tsi_link_before): Likewise.
	(tsi_link_after): Likewise.
	* tree-scalar-evolution.c (new_scev_info_str): Likewise.
	* tree-ssa-loop-niter.c (record_estimate): Likewise.
	* tree-ssa-operands.c (ssa_operand_alloc): Likewise.
	* tree-ssa-operands.h: Don't use variable_size gty attribute.
	* tree-ssa.c (init_tree_ssa): Adjust.
	* tree-ssanames.c (set_range_info): Likewise.
	(get_ptr_info): Likewise.
	(duplicate_ssa_name_ptr_info): Likewise.
	(duplicate_ssa_name_range_info): Likewise.
	* tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise.
	(unpack_ts_fixed_cst_value_fields): Likewise.
	* tree.c (build_fixed): Likewise.
	(build_real): Likewise.
	(build_string): Likewise.
	(decl_priority_info): Likewise.
	(decl_debug_expr_insert): Likewise.
	(decl_value_expr_insert): Likewise.
	(decl_debug_args_insert): Likewise.
	(type_hash_add): Likewise.
	(build_omp_clause): Likewise.
	* ubsan.c (decl_for_type_insert): Likewise.
	* varasm.c (get_unnamed_section): Likewise.
	(get_noswitch_section): Likewise.
	(get_section): Likewise.
	(get_block_for_section): Likewise.
	(create_block_symbol): Likewise.
	(build_constant_desc): Likewise.
	(create_constant_pool): Likewise.
	(force_const_mem): Likewise.
	(record_tm_clone_pair): Likewise.
	* varpool.c (varpool_create_empty_node): Likewise.

gcc/c/ChangeLog:

	* c-decl.c (finish_struct): Adjust.
	(finish_enum): Likewise.
	(bind): Adjust.
	(record_inline_static): Likewise.
	(push_scope): Likewise.
	(make_label): Likewise.
	(lookup_label_for_goto): Likewise.
	(finish_struct): Likewise.
	(finish_enum): Likewise.
	(store_parm_decls): Likewise.
	(c_push_function_context): Likewise.
	* c-lang.h: Remove usage of variable_size gty attribute.
	* c-parser.c (c_parse_init): Adjust.
	(c_parse_file): Likewise.

gcc/java/ChangeLog:

	* class.c (add_method_1): Adjust.
	(java_treetreehash_new): Likewise.
	* constants.c (set_constant_entry): Likewise.
	(cpool_for_class): Likewise.
	* decl.c (make_binding_level): Likewise.
	(java_dup_lang_specific_decl): Likewise.
	* expr.c (add_type_assertion): Likewise.
	* java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise.
	(lang_decl): don't use variable_size gty attribute.
	(MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust.
	(lang_type): Don't use variable_size gty attribute.
	* jcf-parse.c (java_parse_file): Adjust.
	(process_zip_dir): Likewise.
	* jcf.h: Remove usage of variable_size gty attribute.
	* jcf-reader.c (jcf_parse_constant_pool): Adjust.
	(jcf_parse_bootstrap_methods): Likewise.

gcc/objc/ChangeLog:

	* objc-act.c (objc_build_string_object): Adjust.
	(continue_class): Likewise.
	* objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise.
	* objc-map.c (objc_map_alloc_ggc): Likewise.
	(objc_map_private_resize): Likewise.
	* objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init):
	Likewise.
	(hash_name_enter): Likewise.

gcc/cp/ChangeLog:

	* class.c (sorted_fields_type_new): Adjust.
	* cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise.
	* cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
	* cp-tree.h: Remove usage of variable_size gty attribute.
	* decl.c (make_label_decl): Adjust.
	(check_goto): Likewise.
	(start_preparsed_function): Likewise.
	(save_function_data): Likewise.
	* lex.c (init_reswords): Likewise.
	(retrofit_lang_decl): Likewise.
	(cxx_dup_lang_specific_decl): Likewise.
	(copy_lang_type): Likewise.
	(cxx_make_type): Likewise.
	* name-lookup.c (binding_entry_make): Likewise.
	(binding_table_construct): Likewise.
	(binding_table_new): Likewise.
	(cxx_binding_make): Likewise.
	(pushdecl_maybe_friend_1): Likewise.
	(begin_scope): Likewise.
	(push_to_top_level): Likewise.
	* parser.c (cp_lexer_alloc): Likewise.
	(cp_lexer_new_from_tokens): Likewise.
	(cp_token_cache_new): Likewise.
	(cp_parser_context_new): Likewise.
	(cp_parser_new): Likewise.
	(cp_parser_nested_name_specifier_opt): Likewise.
	(cp_parser_template_id): Likewise.
	* pt.c (maybe_process_partial_specialization): Likewise.
	(register_specialization): Likewise.
	(add_pending_template): Likewise.
	(lookup_template_class_1): Likewise.
	(push_tinst_level): Likewise.
	* semantics.c (register_constexpr_fundef): Likewise.
	(cxx_eval_call_expression): Likewise.
	* typeck2.c (abstract_virtuals_error_sfinae): Likewise.

gcc/fortran/ChangeLog:

	* f95-lang.c (pushlevel): Adjust.
	* trans-decl.c (gfc_allocate_lang_decl): Adjust.
	(gfc_find_module): Likewise.
	* trans-types.c (gfc_get_nodesc_array_type): Likewise.
	(gfc_get_array_type_bounds): Likewise.
	(gfc_nonrestricted_type): Likewise.
	* trans.h: Don't use variable_size gty attribute.

gcc/ada/ChangeLog:

	* gcc-interface/ada-tree.h: Remove usage of variable_size gty
	annotation.
	* gcc-interface/decl.c (annotate_value): Adjust.
	* gcc-interface/trans.c (Attribute_to_gnu): Likewise.
	(push_range_check_info): Likewise.
	(Loop_Statement_to_gnu): Likewise.
	(Subprogram_Body_to_gnu): Likewise.
	(Compilation_Unit_to_gnu): Likewise.
	(start_stmt_group): Likewise.
	* gcc-interface/utils.c (init_gnat_utils): Likewise.
	(gnat_pushlevel): Likewise.
	(maybe_pad_type): Likewise.

gcc/go/ChangeLog:

	* go-lang.c (struct GTY): Don't use variable_size gty attribute.

gcc/c-family/ChangeLog:

	* c-common.h (sorted_fields_type): Remove variable_size GTY attribute.
	* c-pragma.c (push_alignment): Adjust.
	(handle_pragma_push_options): Likewise.

gcc/lto/ChangeLog:

	* lto-tree.h: Don't use variable_size gty attribute.
	* lto.c (lto_read_in_decl_state): Adjust.
	(create_subid_section_table): Likewise.
	(lto_flatten_files): Likewise.
	(read_cgraph_and_symbols): Likewise.

gcc/objcp/ChangeLog:

	* objcp-decl.h: Adjust.

From-SVN: r210566
2014-05-17 23:07:23 +00:00
Jan Hubicka b3bb0eb9c0 parser.c (synthesize_implicit_template_parm): Use grow_tree_vec.
* parser.c (synthesize_implicit_template_parm): Use grow_tree_vec.
	* ggc.h (ggc_internal_cleared_alloc): New macro.
	* vec.h (vec_safe_copy): Handle memory stats.
	* omp-low.c (simd_clone_struct_alloc): Use ggc_internal_cleared_alloc.
	* target-globals.c (save_target_globals): Likewise.

From-SVN: r207588
2014-02-07 02:14:58 +00:00
Jakub Jelinek 5da969605f target-globals.c (save_target_globals): Allocate < 4KB structs using GC in payload of target_globals struct instead of...
* target-globals.c (save_target_globals): Allocate < 4KB structs using
	GC in payload of target_globals struct instead of allocating them on
	the heap and the larger structs separately using GC.
	* target-globals.h (struct target_globals): Make regs, hard_regs,
	reload, expmed, ira, ira_int and lra_fields GTY((atomic)) instead
	of GTY((skip)) and change type to void *.
	(reset_target_globals): Cast loads from those fields to corresponding
	types.

From-SVN: r206539
2014-01-10 21:25:05 +01:00
Richard Sandiford 48d534390f re PR target/58115 (testcase gcc.target/i386/intrinsics_4.c failure)
gcc/
	PR target/58115
	* target-globals.c (save_target_globals): Remove this_fn_optab
	handling.
	* toplev.c: Include optabs.h.
	(target_reinit): Temporarily restore the global options if another
	set of options are in force.

gcc/testsuite/
	* gcc.target/i386/intrinsics_4.c (bar): New function.

From-SVN: r206394
2014-01-07 15:26:41 +00:00
Richard Sandiford 23a5b65a92 Update copyright years in gcc/
From-SVN: r206289
2014-01-02 22:23:26 +00:00
Diego Novillo 4d64880731 Re-factor inclusion of tree.h.
This moves tree.h out of every header. This exposes dependencies of
tree.h in files that should probably not need it after tree and gimple
are separated.

After this change, no header should include tree.h directly. It should
only be included by a .c file. Unfortunately, I did not find an
automatic way of forcing this.

Tested on x86_64 with all languages enabled and using
contrib/config-list.mk.

2013-10-21  Diego Novillo  <dnovillo@google.com>

	* asan.c: Include tree.h
	* bb-reorder.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* data-streamer-in.c: Likewise.
	* data-streamer-out.c: Likewise.
	* data-streamer.c: Likewise.
	* dwarf2cfi.c: Likewise.
	* graphite-blocking.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-optimize-isl.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa.c: Likewise.
	* ira.c: Likewise.
	* loop-init.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lto/lto-object.c: Likewise.
	* recog.c: Likewise.
	* reginfo.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-streamer.c: Likewise.
	* value-prof.c: Likewise.
	* target-globals.c: Likewise.
	* expr.h: Include tree-core.h instead of tree.h.
	* gimple.h: Likewise.
	* ipa-prop.h: Likewise.
	* ipa-utils.h: Likewise.
	* lto-streamer.h: Likewise.
	* streamer-hooks.h: Likewise.
	* ipa-reference.h: Include cgraph.h instead of tree.h.
	* cgraph.h: Include basic-block.h instead of tree.h.
	* tree-streamer.h: Do not include tree.h.
	* genattrtab.c (write_header): Generate inclusion of
	tree.h.
	* genautomata.c (main): Likewise.
	* genemit.c: Likewise.
	* genopinit.c: Likewise.
	* genoutput.c (output_prologue): Likewise.
	* genpeep.c: Likewise.

testsuite/ChangeLog

	* g++.dg/plugin/selfassign.c: Include tree.h.
	* gcc.dg/plugin/finish_unit_plugin.c: Likewise.
	* gcc.dg/plugin/ggcplug.c: Likewise.
	* gcc.dg/plugin/one_time_plugin.c: Likewise.
	* gcc.dg/plugin/selfassign.c: Likewise.
	* gcc.dg/plugin/start_unit_plugin.c: Likewise.

From-SVN: r203908
2013-10-21 15:36:37 -04:00
Jakub Jelinek cdebbc6d8d re PR target/52555 (ICE unrecognizable insn with -ffast-math and __attribute__((optimize(xx))))
PR target/52555
	* target-globals.c (save_target_globals): For init_reg_sets and
	target_reinit remporarily set this_fn_optabs to this_target_optabs.

From-SVN: r196245
2013-02-24 19:54:37 +01:00
Aldy Hernandez 135204ddd3 re PR target/52555 (ICE unrecognizable insn with -ffast-math and __attribute__((optimize(xx))))
PR target/52555
	* genopinit.c (raw_optab_handler): Use this_fn_optabs.
	(swap_optab_enable): Same.
	(init_all_optabs): Use argument instead of global.
	* tree.h (struct tree_optimization_option): New field
	target_optabs.
	* expr.h (init_all_optabs): Add argument to prototype.
	(TREE_OPTIMIZATION_OPTABS): New.
	(save_optabs_if_changed): Protoize.
	* optabs.h: Declare this_fn_optabs.
	* optabs.c (save_optabs_if_changed): New.
	Declare this_fn_optabs.
	(init_optabs): Add argument to init_all_optabs() call.
	* function.c (invoke_set_current_function_hook): Handle per
	function optabs.
	* function.h (struct function): New field optabs.
	* config/mips/mips.c (mips_set_mips16_mode): Handle when
	optimization_current_node has changed.
	* target-globals.h (save_target_globals_default_opts): Protoize.
	* target-globals.c (save_target_globals_default_opts): New.
c-family/
	* c-common.c (handle_optimize_attribute): Call
	save_optabs_if_changed.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r196129
2013-02-19 00:04:49 +00:00
Richard Sandiford d1e082c2c2 Update copyright years in gcc/
From-SVN: r195098
2013-01-10 20:38:27 +00:00
Jakub Jelinek 90d04a445c Update Copyright years for files modified in 2011 and/or 2012.
From-SVN: r194903
2013-01-04 13:49:55 +01:00
Steve Ellcey 74c4a9380e target-globals.c (save_target_globals): Save lra_int struct.
2012-11-01  Steve Ellcey  <sellcey@mips.com>

	* target-globals.c (save_target_globals): Save lra_int struct.

From-SVN: r193075
2012-11-01 23:11:50 +00:00
Vladimir Makarov 55a2c3226a dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg.
2012-10-23  Vladimir Makarov  <vmakarov@redhat.com>

	* dbxout.c (dbxout_symbol_location): Pass new argument to
	alter_subreg.
	* dwarf2out.c: Include ira.h and lra.h.
	(based_loc_descr, compute_frame_pointer_to_fb_displacement): Use
	lra_eliminate_regs for LRA instead of eliminate_regs.
	* expr.c (emit_move_insn_1): Pass an additional argument to
	emit_move_via_integer.  Use emit_move_via_integer for LRA only if
	the insn is recognized.
	* emit-rtl.c (gen_rtx_REG): Add lra_in_progress.
	(validate_subreg): Don't check offset for LRA and floating point
	modes.
	* final.c (final_scan_insn, cleanup_subreg_operands): Pass new
	argument to alter_subreg.
	(walk_alter_subreg, output_operand): Ditto.
	(alter_subreg): Add new argument.
	* gcse.c (calculate_bb_reg_pressure): Add parameter to
	ira_setup_eliminable_regset call.
	* ira.c: Include lra.h.
	(ira_init_once, ira_init, ira_finish_once): Call lra_start_once,
	lra_init, lra_finish_once in anyway.
	(ira_setup_eliminable_regset): Add parameter.  Remove need_fp.
	Call lra_init_elimination and mark HARD_FRAME_POINTER_REGNUM as
	living forever if frame_pointer_needed.
	(setup_reg_class_relations): Set up ira_reg_class_subset.
	(ira_reg_equiv_invariant_p, ira_reg_equiv_const): Remove.
	(find_reg_equiv_invariant_const): Ditto.
	(setup_reg_renumber): Use ira_equiv_no_lvalue_p instead of
	ira_reg_equiv_invariant_p.  Skip caps for LRA.
	(setup_reg_equiv_init, ira_update_equiv_info_by_shuffle_insn): New
	functions.
	(ira_reg_equiv_len, ira_reg_equiv): New externals.
	(ira_reg_equiv): New.
	(ira_expand_reg_equiv, init_reg_equiv, finish_reg_equiv): New
	functions.
	(no_equiv, update_equiv_regs): Use ira_reg_equiv instead of
	reg_equiv_init.
	(setup_reg_equiv): New function.
	(ira_use_lra_p): New global.
	(ira): Set up lra_simple_p and ira_conflicts_p.  Set up and
	restore flag_caller_saves and flag_ira_region.  Move
	initialization of ira_obstack and ira_bitmap_obstack upper.  Call
	init_reg_equiv, setup_reg_equiv, and setup_reg_equiv_init instead
	of initialization of ira_reg_equiv_len, ira_reg_equiv_invariant_p,
	and ira_reg_equiv_const.  Call ira_setup_eliminable_regset with a
	new argument.  Don't flatten IRA IRA for LRA.  Don't reassign
	conflict allocnos for LRA. Call finish_reg_equiv.
        (do_reload): Prepare code for LRA call.  Call LRA.
	* ira.h (ira_use_lra_p): New external.
	(struct target_ira): Add members x_ira_class_subset_p
	x_ira_reg_class_subset, and x_ira_reg_classes_intersect_p.
	(ira_class_subset_p, ira_reg_class_subset): New macros.
	(ira_reg_classes_intersect_p): New macro.
	(struct ira_reg_equiv): New.
	(ira_setup_eliminable_regset): Add an argument.
	(ira_expand_reg_equiv, ira_update_equiv_info_by_shuffle_insn): New
	prototypes.
	* ira-color.c (color_pass, move_spill_restore, coalesce_allocnos):
	Use ira_equiv_no_lvalue_p.
	(coalesce_spill_slots, ira_sort_regnos_for_alter_reg): Ditto.
	* ira-emit.c (ira_create_new_reg): Call ira_expand_reg_equiv.
	(generate_edge_moves, change_loop) Use ira_equiv_no_lvalue_p.
	(emit_move_list): Simplify code.  Call
	ira_update_equiv_info_by_shuffle_insn.  Use ira_reg_equiv instead
	of ira_reg_equiv_invariant_p and ira_reg_equiv_const.  Change
	assert.
	* ira-int.h (struct target_ira_int): Remove x_ira_class_subset_p
	and x_ira_reg_classes_intersect_p.
	(ira_class_subset_p, ira_reg_classes_intersect_p): Remove.
	(ira_reg_equiv_len, ira_reg_equiv_invariant_p): Ditto.
	(ira_reg_equiv_const): Ditto.
	(ira_equiv_no_lvalue_p): New function.
	* jump.c (true_regnum): Always use hard_regno for subreg_get_info
	when lra is in progress.
	* haifa-sched.c (sched_init): Pass new argument to
	ira_setup_eliminable_regset.
	* loop-invariant.c (calculate_loop_reg_pressure): Pass new
	argument to ira_setup_eliminable_regset.
	* lra.h: New.
	* lra-int.h: Ditto.
	* lra.c: Ditto.
	* lra-assigns.c: Ditto.
	* lra-constraints.c: Ditto.
	* lra-coalesce.c: Ditto.
	* lra-eliminations.c: Ditto.
	* lra-lives.c: Ditto.
	* lra-spills.c: Ditto.
	* Makefile.in (LRA_INT_H): New.
	(OBJS): Add lra.o, lra-assigns.o, lra-coalesce.o,
	lra-constraints.o, lra-eliminations.o, lra-lives.o, and
	lra-spills.o.
	(dwarf2out.o): Add dependence on ira.h and lra.h.
	(ira.o): Add dependence on lra.h.
	(lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o): New
	entries.
	(lra-eliminations.o, lra-lives.o, lra-spills.o): Ditto.
	* output.h (alter_subreg): Add new argument.
	* rtlanal.c (simplify_subreg_regno): Permit mode changes for LRA.
	Permit ARG_POINTER_REGNUM and STACK_POINTER_REGNUM for LRA.
	* recog.c (general_operand, register_operand): Accept paradoxical
	FLOAT_MODE subregs for LRA.
	(scratch_operand): Accept pseudos for LRA.
	* rtl.h (lra_in_progress): New external.
	(debug_bb_n_slim, debug_bb_slim, print_value_slim): New
	prototypes.
	(debug_rtl_slim, debug_insn_slim): Ditto.
	* sdbout.c (sdbout_symbol): Pass new argument to alter_subreg.
	* sched-vis.c (print_value_slim): New.
	* target.def (lra_p): New hook.
	(register_priority): Ditto.
	(different_addr_displacement_p): Ditto.
	(spill_class): Ditto.
	* target-globals.h (this_target_lra_int): New external.
	(target_globals): New member lra_int.
	(restore_target_globals): Restore this_target_lra_int.
	* target-globals.c: Include lra-int.h.
	(default_target_globals): Add &default_target_lra_int.
	* targhooks.c (default_lra_p): New function.
	(default_register_priority): Ditto.
	(default_different_addr_displacement_p): Ditto.
	* targhooks.h (default_lra_p): Declare.
	(default_register_priority): Ditto.
	(default_different_addr_displacement_p): Ditto.
	* timevar.def (TV_LRA, TV_LRA_ELIMINATE, TV_LRA_INHERITANCE): New.
	(TV_LRA_CREATE_LIVE_RANGES, TV_LRA_ASSIGN, TV_LRA_COALESCE): New.
	* config/arm/arm.c (load_multiple_sequence): Pass new argument toOB
	alter_subreg.
	(store_multiple_sequence): Ditto.
	* config/i386/i386.h (enum ix86_tune_indices): Add
	X86_TUNE_GENERAL_REGS_SSE_SPILL.
	(TARGET_GENERAL_REGS_SSE_SPILL): New macro.
	* config/i386/i386.c (initial_ix86_tune_features): Set up
	X86_TUNE_GENERAL_REGS_SSE_SPILL for m_COREI7 and m_CORE2I7.
	(ix86_lra_p, ix86_register_priority): New functions.
	(ix86_secondary_reload): Add NON_Q_REGS, SIREG, DIREG.
	(inline_secondary_memory_needed): Change assert.
	(ix86_spill_class): New function.
	(TARGET_LRA_P, TARGET_REGISTER_BANK, TARGET_SPILL_CLASS): New
	macros.
	* config/m68k/m68k.c (emit_move_sequence): Pass new argument to
	alter_subreg.
	* config/m32r/m32r.c (gen_split_move_double): Ditto.
	* config/pa/pa.c (pa_emit_move_sequence): Ditto.
	* config/sh/sh.md: Ditto.
	* config/v850/v850.c (v850_reorg): Ditto.
	* config/xtensa/xtensa.c (fixup_subreg_mem): Ditto.
	* doc/md.texi: Add new interpretation of hint * for LRA.
	* doc/passes.texi: Describe LRA pass.
	* doc/tm.texi.in: Add TARGET_LRA_P, TARGET_REGISTER_PRIORITY,
	TARGET_DIFFERENT_ADDR_DISPLACEMENT_P, and TARGET_SPILL_CLASS.
	* doc/tm.texi: Update.

From-SVN: r192719
2012-10-23 15:51:41 +00:00
Kenneth Zadeck af4ba42308 Makefile.in (lower-subreg.o, [...]): Depend on lower-subreg.h.
gcc/
2012-03-31  Kenneth Zadeck  <zadeck@naturalbridge.com>
	    Richard Sandiford  <r.sandiford@uk.ibm.com>

	* Makefile.in (lower-subreg.o, target-globals.o): Depend on
	lower-subreg.h.
	* lower-subreg.h: New file.
	* target-globals.h (this_target_lower_subreg): Declare.
	(target_globals): Add lower_subreg;
	(restore_target_globals): Restore this_target_lower_subreg.
	* target-globals.c: Include it.
	(default_target_globals): Add default_target_lower_subreg.
	(save_target_globals): Initialize target_lower_subreg.
	* rtl.h (init_lower_subreg): Added declaration.
	* toplev.c (backend_init_target): Call initializer for lower-subreg
	pass.
	* lower-subreg.c (LOG_COSTS, FORCE_LOWERING): New macros.
	(default_target_lower_subreg): New variable.
	(this_target_lower_subreg): Likewise.
	(twice_word_mode, choices): New macros.
	(shift_cost, compute_splitting_shift, compute_costs)
	(init_lower_subreg): New functions.
	(resolve_simple_move): Add speed_p argument.  Check choices.
	(find_pseudo_copy): Don't check the mode size here.
	(resolve_simple_move): Assert the mode size.
	(find_decomposable_shift_zext): Add speed_p argument and return
	a bool.  Check choices.
	(resolve_shift_zext): Add comment.
	(dump_shift_choices, dump_choices): New functions.
	(decompose_multiword_subregs): Dump list of profitable
	transformations.  Add code to skip non profitable transformations.
	Update calls to simple_move and find_decomposable_shift_zext.

Co-Authored-By: Richard Sandiford <r.sandiford@uk.ibm.com>

From-SVN: r187015
2012-05-01 14:45:24 +00:00
Richard Sandiford 77f558794e reginfo.c (init_reg_sets): Don't zero globals here.
gcc/
	* reginfo.c (init_reg_sets): Don't zero globals here.  Update comment
	to say that the function can be called more than once.
	* target-globals.c (save_target_globals): Call init_reg_sets.

From-SVN: r162110
2010-07-12 19:04:21 +00:00
Richard Sandiford 76ee381a9c Makefile.in (bb-reorder.o, [...]): Depend on bb-reorder.h
gcc/
	* Makefile.in (bb-reorder.o, target-globals.o): Depend on bb-reorder.h
	* bb-reorder.h: New file.
	* bb-reorder.c (default_target_bb_reorder): New variable.
	(this_target_bb_reorder): New conditional variable.
	(uncond_jump_length): Redefine as a macro.
	* target-globals.h (this_target_bb_reorder): Declare.
	(target_globals): Add a bb_reorder field.
	(restore_target_globals): Copy the bb_reorder field to
	this_target_bb-reorder.
	* target-globals.c: Include bb-reorder.h.
	(default_target_globals): Initialize the bb_reorder field.
	(save_target_globals): Likewise.

From-SVN: r162109
2010-07-12 19:04:11 +00:00
Richard Sandiford 7c6811fe1e Makefile.in (gcse.o, [...]): Depend on gcse.h..
gcc/
	* Makefile.in (gcse.o, target-globals.o): Depend on gcse.h..
	* gcse.h: New file.
	* gcse.c: Include gcse.h.
	(default_target_gcse): New variable.
	(this_target_gcse): New conditional variable.
	(can_copy): Redefine as a macro.
	(can_copy_init_p): New macro.
	(can_copy_p): Remove can_copy_init_p.
	* target-globals.h (this_target_gcse): Declare.
	(target_globals): Add a gcse field.
	(restore_target_globals): Copy the gcse field to
	this_target_gcse.
	* target-globals.c: Include gcse.h.
	(default_target_globals): Initialize the gcse field.
	(save_target_globals): Likewise.

From-SVN: r162108
2010-07-12 19:04:03 +00:00
Richard Sandiford fa19795ec4 Makefile.in (target-globals.o): Depend on builtins.h.
gcc/
	* Makefile.in (target-globals.o): Depend on builtins.h.
	* builtins.h: New file.
	* builtins.c: Include builtins.h.
	(default_target_builtins): New variable.
	(this_target_builtins): New conditional variable.
	(apply_args_mode, apply_result_mode): Redefine as macros.
	* target-globals.h (this_target_builtins): Declare.
	(target_globals): Add a builtins field.
	(restore_target_globals): Copy the builtins field to
	this_target_builtins.
	* target-globals.c: Include builtins.h.
	(default_target_globals): Initialize the builtins field.
	(save_target_globals): Likewise.

From-SVN: r162105
2010-07-12 19:03:35 +00:00
Richard Sandiford afcc66c49a Makefile.in (target-globals.o): Depend on $(IRA_INT_H).
gcc/
	* Makefile.in (target-globals.o): Depend on $(IRA_INT_H).
	* ira-int.h (ira_max_nregs, ira_important_class_nums): Delete.
	(target_ira_int): New structure.
	(default_target_ira_int): Declare.
	(this_target_ira_int): Declare as a variable or define as a macro.
	(ira_reg_mode_hard_regset, ira_register_move_cost)
	(ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p)
	(ira_non_ordered_class_hard_regs, ira_class_hard_reg_index)
	(prohibited_class_mode_regs, ira_important_classes_num)
	(ira_important_classes, ira_reg_class_intersect)
	(ira_reg_classes_intersect_p, ira_reg_class_super_classes)
	(ira_reg_class_union): Redefine as macros.
	* ira.h (target_ira): New structure.
	(default_target_ira): Declare.
	(this_target_ira): Declare as a variable or define as a macro.
	(ira_available_class_regs, ira_hard_regno_cover_class)
	(ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate)
	(ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs)
	(ira_class_hard_regs_num): Redefine as macros.
	* ira.c (default_target_ira, default_target_ira_int): New variables.
	(this_target_ira, this_target_ira_int): New conditional variables.
	(ira_reg_mode_hard_regset, ira_memory_move_cost)
	(ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost)
	(ira_class_subset_p): Delete.
	(no_unit_alloc_regs): Redefine as a macro.
	(ira_class_hard_regs, ira_non_ordered_class_hard_regs)
	(ira_class_hard_regs_num, ira_class_hard_reg_index)
	(ira_available_class_regs): Delete.
	(alloc_reg_class_subclasses): Redefine as a macro.
	(ira_reg_class_cover_size, ira_reg_class_cover)
	(ira_important_classes_num, ira_important_classes)
	(ira_important_class_nums, ira_class_translate): Delete.
	(cover_class_order): Document the variable's lifetime.
	(reorder_important_classes): Don't set ira_important_class_nums.
	(ira_reg_class_intersect, ira_reg_classes_intersect_p)
	(ira_reg_class_super_classes, ira_reg_class_union)
	(ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs):
	Delete.
	(setup_reg_class_nregs): Don't set ira_max_regs.
	(prohibited_class_mode_regs): Delete.
	* target-globals.h (this_target_ira, this_target_ira_int): Declare.
	(target_globals): Add ira and ira_int fields.
	(restore_target_globals): Copy the ira field to this_target_ira
	and the ira_int field to this_target_ira_int.
	* target-globals.c: Include ira-int.h.
	(default_target_globals): Initialize the ira and ira_int fields.
	(save_target_globals): Likewise.

From-SVN: r162102
2010-07-12 19:03:06 +00:00
Richard Sandiford 4391924a33 Makefile.in (target-globals.o): Depend on $(CFGLOOP_H).
gcc/
	* Makefile.in (target-globals.o): Depend on $(CFGLOOP_H).
	* cfgloop.h (target_cfgloop): New structure.
	(default_target_cfgloop): Declare.
	(this_target_cfgloop): Declare as a variable or define as a macro.
	(target_avail_regs, target_clobbered_regs, target_res_regs)
	(target_reg_cost, target_spill_cost): Redefine as macros.
	* cfgloopanal.c (default_target_cfgloop): New variable.
	(this_target_cfgloop): New conditional variable.
	(target_avail_regs, target_clobbered_regs, target_res_regs)
	(target_reg_cost, target_spill_cost): Delete.
	* target-globals.h (this_target_cfgloop): Declare.
	(target_globals): Add a cfgloop field.
	(restore_target_globals): Copy the cfgloop field to
	this_target_cfgloop.
	* target-globals.c: Include cfgloop.h.
	(default_target_globals): Initialize the cfgloop field.
	(save_target_globals): Likewise.

From-SVN: r162101
2010-07-12 19:02:55 +00:00
Richard Sandiford 3e9c326a88 Makefile.in (LIBFUNCS_H): Add $(HASHTAB_H).
gcc/
	* Makefile.in (LIBFUNCS_H): Add $(HASHTAB_H).
	(target-globals.o): Depend on $(LIBFUNCS_H).
	* libfuncs.h: Include hashtab.h.
	(libfunc_entry): Moved from optabs.c.
	(target_libfuncs): New structure.
	(default_target_libfuncs): Declare.
	(this_target_libfuncs): Declare as a variable or define as a macro.
	(libfunc_table): Redefine as a macro.
	* optabs.c (default_target_libfuncs): New variable.
	(this_target_libfuncs): New conditional variable.
	(libfunc_table): Delete.
	(libfunc_entry): Moved to optabs.h.
	(libfunc_hash): Redefine as a macro.
	(hash_libfunc, eq_libfunc): Fix comments.
	(init_optabs): Use libfunc_hash to detect cases where the function
	has already been called.  Clear the hash table instead of
	recreating it.
	* target-globals.h (this_target_libfuncs): Declare.
	(target_globals): Add a libfuncs field.
	(restore_target_globals): Copy the libfuncs field to
	this_target_libfuncs.
	* target-globals.c: Include libfuncs.h.
	(default_target_globals): Initialize the libfuncs field.
	(save_target_globals): Likewise.

From-SVN: r162099
2010-07-12 18:55:48 +00:00
Richard Sandiford 4bcbfa0393 Makefile.in (target-globals.o): Depend on $(EXPR_H) and $(OPTABS_H).
gcc/
	* Makefile.in (target-globals.o): Depend on $(EXPR_H) and $(OPTABS_H).
	* optabs.h (target_optabs): New structure.
	(default_target_optabs): Declare.
	(this_target_optabs): Declare as a variable or define as a macro.
	(optab_table, convert_optab_table, direct_optab_table): Redefine
	as macros.
	* optabs.c (default_target_optabs): New variable.
	(this_target_optabs): New conditional variable.
	(optab_table, convert_optab_table, direct_optab_table): Delete.
	* target-globals.h (this_target_optabs): Declare.
	(target_globals): Add a optabs field.
	(restore_target_globals): Copy the optabs field to
	this_target_optabs.
	* target-globals.c: Include expr.h and optabs.h.
	(default_target_globals): Initialize the optabs field.
	(save_target_globals): Likewise.

From-SVN: r162097
2010-07-12 18:54:35 +00:00
Richard Sandiford 462f85cedc Makefile.in (expmed.o, [...]): Depend on expmed.h.
gcc/
	* Makefile.in (expmed.o, target-globals.o): Depend on expmed.h.
	* expmed.h: New file.
	* expmed.c (default_target_costs): New variable.
	(this_target_costs): New conditional variable.
	(sdiv_pow2_cheap, smod_pow2_cheap, zero_cost, add_cost, neg_cost)
	(shift_cost, shiftadd_cost, shiftsub0_cost, shiftsub1_cost, mul_cost)
	(sdiv_cost, udiv_cost, mul_widen_cost, mul_highpart_cost): Delete.
	* target-globals.h (this_target_expmed): Declare.
	(target_globals): Add a expmed field.
	(restore_target_globals): Copy the expmed field to
	this_target_expmed.
	* target-globals.c: Include expmed.h.
	(default_target_globals): Initialize the expmed field.
	(save_target_globals): Likewise.

From-SVN: r162094
2010-07-12 18:54:08 +00:00
Richard Sandiford d474db8448 Makefile.in (target-globals.o): Depend on reload.h.
gcc/
	* Makefile.in (target-globals.o): Depend on reload.h.
	* reload.h (target_reload): New structure.
	(default_target_reload): Declare.
	(this_target_reload): Declare as a variable or define as a macro.
	(indirect_symref_ok, double_reg_address_ok): Redefine as macros.
	* reload1.c (default_target_reload): New variable
	(this_target_reload): New conditional variable.
	(indirect_symref_ok, double_reg_address_ok): Delete.
	(spill_indirect_levels): Redefine as a macro.
	* target-globals.h (this_target_reload): Declare.
	(target_globals): Add a reload field.
	(restore_target_globals): Copy the reload field to
	this_target_reload.
	* target-globals.c: Include hard-reg-set.h.
	(default_target_globals): Initialize the reload field.
	(save_target_globals): Likewise.

From-SVN: r162093
2010-07-12 18:53:59 +00:00
Richard Sandiford 6642445b2c hard-reg-set.h (target_hard_regs): New structure.
gcc/
	* hard-reg-set.h (target_hard_regs): New structure.
	(default_target_hard_regs): Declare.
	(this_target_hard_regs): Declare as a variable or define as a macro.
	(fixed_regs, fixed_reg_set, call_used_regs, call_really_used_regs)
	(call_used_reg_set, call_fixed_reg_set, regs_invalidated_by_call)
	(reg_alloc_order, inv_reg_alloc_order, reg_class_contents)
	(reg_class_size, reg_class_subclasses, reg_class_subunion)
	(reg_class_superunion, reg_names): Redefine as macros.
	* reginfo.c (fixed_regs, fixed_reg_set, call_used_regs)
	(call_used_reg_set, call_really_used_regs, call_fixed_reg_set)
	(regs_invalidated_by_call, reg_alloc_order, inv_reg_alloc_order)
	(reg_class_contents, reg_class_size, reg_class_subclasses)
	(reg_class_subunion, reg_class_superunion, reg_names): Delete.
	(default_target_hard_regs): New variable
	(this_target_hard_regs, initial_call_really_used_regs)
	(initial_reg_alloc_order): New conditional variables.
	(initial_reg_names): New variable.
	(init_reg_sets): Assert that initial_call_really_used_regs,
	initial_reg_alloc_order and initial_reg_names
	are all the same size as their variable counterparts.  Use them to
	initialize those counterparts.
	* target-globals.h (this_target_hard_regs): Declare.
	(target_globals): Add a hard_regs field.
	(restore_target_globals): Copy the hard_regs field to
	this_target_hard_regs.
	* target-globals.c: Include hard-reg-set.h.
	(default_target_globals): Initialize the hard_regs field.
	(save_target_globals): Likewise.

From-SVN: r162089
2010-07-12 18:53:25 +00:00
Richard Sandiford 5fb0e246f4 Makefile.in (target-globals.o): Depend on $(RTL_H).
gcc/
	* Makefile.in (target-globals.o): Depend on $(RTL_H).
	* rtl.h: (target_rtl): New structure.
	(default_target_rtl): Declare.
	(this_target_rtl): Declare as a variable or define as a macro.
	(global_rtl, pic_offset_table_rtx, return_address_pointer_rtx):
	Redefine as macros.
	* emit-rtl.c (default_target_rtl): New variable.
	(this_target_rtl): New conditional variable.
	(global_rtl, static_regno_reg_rtx, pic_offset_table_rtx)
	(return_address_pointer_rtx): Delete.
	(initial_regno_reg_rtx): New macro.
	(init_emit): Use initial_regno_reg_rtx instead of static_regno_reg_rtx.
	(init_emit_regs): Likewise.
	* target-globals.h (this_target_rtl): Declare.
	(target_globals): Add a rtl field.
	(restore_target_globals): Copy the rtl field to this_target_rtl.
	* target-globals.c: Include rtl.h.
	(default_target_globals): Initialize the rtl field.
	(save_target_globals): Likewise.

From-SVN: r162088
2010-07-12 18:53:17 +00:00
Richard Sandiford 939dcd0d38 Makefile.in (target-globals.o): Depend on $(REGS_H).
gcc/
	* Makefile.in (target-globals.o): Depend on $(REGS_H).
	* regs.h (target_reg_modes): New structure.
	(default_target_reg_modes): Declare.
	(this_target_reg_modes): Declare as a variable or define as a macro.
	(hard_regno_nregs, reg_raw_mode): Redefine as macros.
	* reginfo.c (default_target_reg_modes): New variable.
	(this_target_reg_modes): New conditional variable.
	(hard_regno_nregs, reg_raw_mode): Delete.
	* target-globals.h (this_target_regs): Declare.
	(target_globals): Add a regs field.
	(restore_target_globals): Copy the regs field to this_target_regs.
	* target-globals.c: Include regs.h.
	(default_target_globals): Initialize the regs field.
	(save_target_globals): Likewise.

From-SVN: r162087
2010-07-12 18:53:08 +00:00
Richard Sandiford 3bd36029de tm.texi.in (SWITCHABLE_TARGET): Document.
gcc/
	* doc/tm.texi.in (SWITCHABLE_TARGET): Document.
	* doc/tm.texi: Regenerate.
	* Makefile.in (OBJS-common): Add target-globals.o.
	(gtype-desc.o): Depend on $(IPA_PROP_H), $(LTO_STREAMER_H)
	and target-globals.h.
	(target-globals.o): New rule.
	(GTFILES): Include $(srcdir)/target-globals.h.
	* defaults.h (SWITCHABLE_TARGET): Define.
	* gengtype.c (open_base_files): Add target-globals.h to the
	list of includes.
	* target-globals.h: New file.
	* target-globals.c: Likewise.

	* Makefile.in (target-globals.o): Depend on $(FLAGS_H).
	* flags.h (target_flag_state): New structure.
	(default_target_flag_state): Declare.
	(this_target_flag_state): Declare as a variable or define as a macro.
	(align_loops_log): Redefine as a macro.
	(align_loops_max_skip, align_jumps_log): Likewise.
	(align_jumps_max_skip, align_labels_log): Likewise.
	(align_labels_max_skip, align_functions_log): Likewise.
	* toplev.c (default_target_flag_state): New variable.
	(this_target_flag_state): New conditional variable.
	(align_loops_log): Delete.
	(align_loops_max_skip, align_jumps_log): Likewise.
	(align_jumps_max_skip, align_labels_log): Likewise.
	(align_labels_max_skip, align_functions_log): Likewise.
	* target-globals.h (this_target_flag_state): Declare.
	(target_globals): Add a flag_state field.
	(restore_target_globals): Copy the flag_state field to
	this_target_flag_state.
	* target-globals.c: Include flags.h.
	(default_target_globals): Initialize the flag_state field.
	(save_target_globals): Likewise.

From-SVN: r162086
2010-07-12 18:53:01 +00:00