Commit Graph

450 Commits

Author SHA1 Message Date
Martin Liska 9a1e784ae8 symbol_summary is used for inline_summary.
* lto-partition.c (add_symbol_to_partition_1): New inline_summaries
	is used.
	(undo_partition): Likewise.
	(lto_balanced_map): Likewise.
	* cgraphunit.c (symbol_table::process_new_functions): New inline_summaries
	is used.
	* ipa-cp.c (ipcp_cloning_candidate_p): Likewise.
	(devirtualization_time_bonus): Likewise.
	(estimate_local_effects): Likewise.
	(ipcp_propagate_stage): Likewise.
	* ipa-inline-analysis.c (evaluate_conditions_for_known_args): Likewise.
	(evaluate_properties_for_edge): Likewise.
	(inline_summary_alloc): Likewise.
	(reset_inline_summary): New inline_summary argument is introduced.
	(inline_summary_t::remove): New function.
	(inline_summary_t::duplicate): Likewise.
	(dump_inline_edge_summary): New inline_summaries is used.
	(dump_inline_summary): Likewise.
	(estimate_function_body_sizes): Likewise.
	(compute_inline_parameters): Likewise.
	(estimate_edge_devirt_benefit): Likewise.
	(estimate_node_size_and_time): Likewise.
	(inline_update_callee_summaries): Likewise.
	(inline_merge_summary): Likewise.
	(inline_update_overall_summary): Likewise.
	(simple_edge_hints): Likewise.
	(do_estimate_edge_time): Likewise.
	(estimate_time_after_inlining): Likewise.
	(estimate_size_after_inlining): Likewise.
	(do_estimate_growth): Likewise.
	(growth_likely_positive): Likewise.
	(inline_generate_summary): Likewise.
	(inline_read_section): Likewise.
	(inline_read_summary): Likewise.
	(inline_write_summary): Likewise.
	(inline_free_summary): Likewise.
	* ipa-inline-transform.c (clone_inlined_nodes): Likewise.
	(inline_call): Likewise.
	* ipa-inline.c (caller_growth_limits): Likewise.
	(can_inline_edge_p): Likewise.
	(want_early_inline_function_p): Likewise.
	(compute_uninlined_call_time): Likewise.
	(compute_inlined_call_time): Likewise.
	(big_speedup_p): Likewise.
	(want_inline_small_function_p): Likewise.
	(edge_badness): Likewise.
	(update_caller_keys): Likewise.
	(update_callee_keys): Likewise.
	(recursive_inlining): Likewise.
	(inline_small_functions): Likewise.
	(inline_to_all_callers): Likewise.
	(dump_overall_stats): Likewise.
	(early_inline_small_functions): Likewise.
	* ipa-inline.h: New class inline_summary_t replaces
	vec<inline_summary_t>.
	* ipa-split.c (execute_split_functions): New inline_summaries is used.
	* ipa.c (walk_polymorphic_call_targets): Likewise.
	* tree-sra.c (ipa_sra_preliminary_function_checks): Likewise.

From-SVN: r219006
2014-12-22 09:33:05 +00:00
Martin Liska dd912cb89c ipa-prop uses symbol_summary class.
* lto-partition.c: Include of symbol-summary.h is added.
	* lto-symtab.c: Likewise.
	* lto.c: Likewise.
	* auto-profile.c: Include of symbol-summary.h is added.
	* cgraph.c: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-icf.c: Likewise.
	* ipa-inline-analysis.c (evaluate_properties_for_edge): New
	ipa_node_params_sum data structure is used.
	(inline_node_duplication_hook): Likewise.
	(estimate_function_body_sizes): Likewise.
	(remap_edge_change_prob): Likewise.
	(inline_merge_summary): Likewise.
	* ipa-inline-transform.c: Include of symbol-summary.h is added.
	* ipa-inline.c (early_inliner): New ipa_node_params_sum data structure
	is used.
	* ipa-polymorphic-call.c: Include of symbol-summary.h is added.
	* ipa-profile.c: Include of symbol-summary.h is added.
	* ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum
	data structure is used.
	(ipa_node_params::~ipa_node_params): New function.
	(ipa_free_all_node_params): Destruction is simplified.
	(ipa_node_removal_hook): Removed.
	(ipa_add_new_function): Renamed from ipa_node_duplication_hook.
	(ipa_node_params_t::duplicate): New function.
	(ipa_register_cgraph_hooks): Few hooks are removed.
	(ipa_unregister_cgraph_hooks): Likewise.
	(ipa_prop_write_jump_functions): New ipa_node_params_sum is used.
	* ipa-prop.h (struct ipa_node_params): Destructor introduced for
	the structure.
	(ipa_check_create_node_params): Vector for ipa_node_params is replaced
	with function_summary.
	* ipa-split.c: Include of symbol-summary.h is added.
	* ipa-utils.c: Include of symbol-summary.h is added.
	* ipa.c: Include of symbol-summary.h is added.
	* omp-low.c: Include of symbol-summary.h is added.
	* tree-inline.c: Include of symbol-summary.h is added.
	* tree-sra.c: Include of symbol-summary.h is added.
	* tree-ssa-pre.c: Include of symbol-summary.h is added.

From-SVN: r219005
2014-12-22 09:19:09 +00:00
Jan Hubicka 17e0fc9202 re PR ipa/61324 (ICE: SIGSEGV at ipa-comdats.c:321 with -fno-use-cxa-atexit -fkeep-inline-functions)
PR ipa/61324
	* testsuite/g++.dg/pr61324.C: New testcase by Trevor Saunders.
	* testsuite/g++.dg/tm/pr51411-2.C: Update se the extern function is
	not eliminated early.
	* testsuite/gcc.target/i386/pr57756.c: Turn extern inline into static
	inline.

	* passes.c (execute_todo): Update call of remove_unreachable_nodes.
	* ipa-chkp.c (chkp_produce_thunks): Use TODO_remove_functions.
	* cgraphunit.c (symbol_table::process_new_functions): Add
	IPA_SSA_AFTER_INLINING.
	(ipa_passes): Update call of remove_unreachable_nodes.
	(symbol_table::compile): Remove call of remove_unreachable_nodes.
	* ipa-inline.c (inline_small_functions): Do not ICE with
	-flto-partition=none
	(ipa_inline): Update symtab->state; fix formatting
	update call of remove_unreachable_nodes.
	* cgraphclones.c (symbol_table::materialize_all_clones): Likewise.
	* cgraph.h (enum symtab_state): Add IPA_SSA_AFTER_INLINING.
	(remove_unreachable_nodes): Update.
	* ipa.c (process_references): Keep external references only
	when optimizing.
	(walk_polymorphic_call_targets): Keep possible polymorphic call
	target only when devirtualizing.
	(symbol_table::remove_unreachable_nodes): Remove BEFORE_INLINING_P
	parameter.
	(ipa_single_use): Update comment.
	* ipa-pure-const.c (cdtor_p): New function.
	(propagate_pure_const): Track if some cdtor was turned pure/const.
	(execute): Return TODO_remove_functions if needed.
	* ipa-comdats.c (ipa_comdats): Update comment.
	
	* lto.c (read_cgraph_and_symbols): Update call of
	remove_unreachable_nodes.
	(do_whole_program_analysis): Remove call of
	symtab->remove_unreachable_nodes

From-SVN: r218640
2014-12-11 21:48:48 +00:00
Trevor Saunders 58dddbd21a move gimple_canonical_types htab out of gc memory
lto/

	* lto.c (read_cgraph_and_symbols): allocate gimple_canonical_types
	htab with malloc instead of ggc.

From-SVN: r218502
2014-12-09 02:30:13 +00:00
Trevor Saunders 907dadbd2a remove more ggc htabs
gcc/

	* ipa-utils.c, lto-section-in.c, lto-streamer.h,
	tree-scalar-evolution.c: Replace htab with hash_table.

lto/

	* lto.c: Replace htab with hash_table.

From-SVN: r217871
2014-11-20 15:10:49 +00:00
Trevor Saunders 9c71e9df38 use vec in lto_tree_ref_table
gcc/ChangeLog:

2014-11-20  Trevor Saunders  <tsaunders@mozilla.com>

	* lto-section-in.c (lto_delete_in_decl_state): Adjust.
	(lto_free_function_in_decl_state): Likewise.
	* lto-streamer-out.c (copy_function_or_variable): Likewise.
	* lto-streamer.h (lto_file_decl_data_get_ ## name): Likewise.
	(lto_file_decl_data_num_ ## name ## s): Likewise.
	(struct lto_tree_ref_table): Remove.
	(struct lto_in_decl_state): Replace lto_tree_ref_table with vec<tree>.

gcc/lto/ChangeLog:

2014-11-20  Trevor Saunders  <tsaunders@mozilla.com>

	* lto.c (lto_read_in_decl_state): Adjust.
	(lto_fixup_state): Likewise.

From-SVN: r217870
2014-11-20 15:10:42 +00:00
Jan Hubicka 72a4a8b0bc tree.c (free_lang_data_in_decl): Annotate all functio nbodies with DECL_FUNCTION_SPECIFIC_TARGET.
* tree.c (free_lang_data_in_decl): Annotate all functio nbodies with
	DECL_FUNCTION_SPECIFIC_TARGET.
	* i386.c (ix86_set_current_function): Handle explicit default options.

	* lto.c (lto_read_decls): Do not rebuild DECL_FUNCTION_SPECIFIC_TARGET.

From-SVN: r217659
2014-11-17 16:48:29 +00:00
Jan Hubicka 54e774c010 optc-save-gen.awk: Output cl_target_option_eq...
* optc-save-gen.awk: Output cl_target_option_eq,
	cl_target_option_hash, cl_target_option_stream_out,
	cl_target_option_stream_in functions.
	* opth-gen.awk: Output prototypes for
	cl_target_option_eq and cl_target_option_hash.
	* lto-streamer.h (cl_target_option_stream_out,
	cl_target_option_stream_in): Declare.
	* tree.c (cl_option_hash_hash): Use cl_target_option_hash.
	(cl_option_hash_eq): Use cl_target_option_eq.
	* tree-streamer-in.c (unpack_value_fields): Stream in
	TREE_TARGET_OPTION.
	* lto-streamer-out.c (DFS::DFS_write_tree_body): Follow
	DECL_FUNCTION_SPECIFIC_TARGET.
	(hash_tree): Hash TREE_TARGET_OPTION; visit
	DECL_FUNCTION_SPECIFIC_TARGET.
	* tree-streamer-out.c (streamer_pack_tree_bitfields): Skip
	TS_TARGET_OPTION.
	(streamer_write_tree_body): Output TS_TARGET_OPTION.

	* lto.c (compare_tree_sccs_1): Compare cl_target_option_eq.

From-SVN: r217571
2014-11-14 15:47:53 +00:00
Ilya Verbin ec6fe917cd [PATCH 3/7] OpenMP 4.0 offloading infrastructure: Offload tables.
gcc/
	* Makefile.in (GTFILES): Add omp-low.h to list of GC files.
	* cgraphunit.c: Include omp-low.h.
	* doc/tm.texi: Regenerate.
	* doc/tm.texi.in (TARGET_RECORD_OFFLOAD_SYMBOL): Document.
	* gengtype.c (open_base_files): Add omp-low.h to ifiles.
	* lto-cgraph.c (output_offload_tables): New function.
	(input_offload_tables): Likewise.
	* lto-section-in.c (lto_section_name): Add "offload_table".
	* lto-section-names.h (OFFLOAD_VAR_TABLE_SECTION_NAME): Define.
	(OFFLOAD_FUNC_TABLE_SECTION_NAME): Likewise.
	* lto-streamer-out.c (lto_output): Call output_offload_tables.
	* lto-streamer.h (lto_section_type): Add LTO_section_offload_table.
	(output_offload_tables, input_offload_tables): Declare.
	* omp-low.c: Include common/common-target.h and lto-section-names.h.
	(offload_funcs, offload_vars): New global <tree, va_gc> vectors.
	(expand_omp_target): Add child_fn into offload_funcs vector.
	(add_decls_addresses_to_decl_constructor): New function.
	(omp_finish_file): Likewise.
	* omp-low.h (omp_finish_file, offload_funcs, offload_vars): Declare.
	* target.def (record_offload_symbol): New DEFHOOK.
	* toplev.c: Include omp-low.h.
	(compile_file): Call omp_finish_file.
	* varpool.c: Include omp-low.h.
	(varpool_node::get_create): Add decl into offload_vars vector.

gcc/lto/
	* lto/lto.c (read_cgraph_and_symbols): Call input_offload_tables.

Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com>
Co-Authored-By: Bernd Schmidt <bernds@codesourcery.com>
Co-Authored-By: Ilya Tocar <ilya.tocar@intel.com>
Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com>

From-SVN: r217489
2014-11-13 13:44:04 +00:00
Ilya Verbin 1f6be68256 [PATCH 2/7] OpenMP 4.0 offloading infrastructure: LTO streaming.
gcc/
	* cgraph.c: Include context.h.
	(cgraph_node::create): Set node->offloadable and g->have_offload if
	decl have "omp declare target" attribute.
	* cgraph.h (symtab_node): Add need_lto_streaming and offloadable flags.
	* cgraphunit.c: Include lto-section-names.h.
	(ipa_passes): Call ipa_write_summaries if there is something to write to
	OFFLOAD_SECTION_NAME_PREFIX sections.
	(symbol_table::compile): Set flag_generate_lto if there is something to
	offload.
	Replace flag_lto with flag_generate_lto before lto_streamer_hooks_init.
	* context.c (gcc::context::context): Initialize have_offload with false.
	* context.h (class context): Add have_offload flag.
	* ipa-inline-analysis.c (inline_generate_summary): Do not exit under
	flag_generate_lto.
	(inline_free_summary): Always remove hooks.
	* lto-cgraph.c (referenced_from_other_partition_p): Ignore references
	from non-offloadable nodes while streaming a node into offload section.
	(reachable_from_other_partition_p): Likewise.
	(select_what_to_stream): New function.
	(compute_ltrans_boundary): Do not call
	lto_set_symtab_encoder_in_partition if the node should not be streamed.
	* lto-section-names.h (OFFLOAD_SECTION_NAME_PREFIX): Define.
	(section_name_prefix): Declare.
	* lto-streamer.c (section_name_prefix): New variable.
	(lto_get_section_name): Use section_name_prefix instead of
	LTO_SECTION_NAME_PREFIX.
	* lto-streamer.h (select_what_to_stream): Declare.
	* omp-low.c: Include context.h.
	(is_targetreg_ctx): New function.
	(scan_sharing_clauses): Use offloadable flag, instead of an attribute.
	(create_omp_child_function, check_omp_nesting_restrictions): Use new
	is_targetreg_ctx function.  Replace usage of "omp declare target"
	attribute with a cgraph_node flag offloadable.
	(expand_omp_target): Set mark_force_output for offloadable functions.
	(lower_omp_critical): Set offloadable flag for omp critical symbol.
	* passes.c (ipa_write_summaries): New argument offload_lto_mode.  Call
	select_what_to_stream.  Do not call lto_set_symtab_encoder_in_partition
	if the node should not be streamed out.
	* tree-pass.h (ipa_write_summaries): New bool argument.
	* varpool.c: Include context.h.
	(varpool_node::get_create): Set node->offloadable and g->have_offload if
	decl have "omp declare target" attribute.

gcc/lto/
	* lto-object.c (lto_obj_add_section): Use section_name_prefix instead of
	LTO_SECTION_NAME_PREFIX.
	* lto-partition.c (lto_promote_cross_file_statics): Call
	select_what_to_stream.
	* lto.c (lto_section_with_id): Use section_name_prefix instead of
	LTO_SECTION_NAME_PREFIX.
	(read_cgraph_and_symbols): Read OFFLOAD_SECTION_NAME_PREFIX sections, if
	being built as an offload compiler.

Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com>
Co-Authored-By: Bernd Schmidt <bernds@codesourcery.com>
Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com>

From-SVN: r217486
2014-11-13 13:37:38 +00:00
Richard Sandiford ef4bddc299 decl.c, [...]: Remove redundant enum from machine_mode.
gcc/ada/
	* gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c,
	gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c:
	Remove redundant enum from machine_mode.

gcc/c-family/
	* c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant
	enum from machine_mode.

gcc/c/
	* c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from
	machine_mode.

gcc/cp/
	* constexpr.c: Remove redundant enum from machine_mode.

gcc/fortran/
	* trans-types.c, trans-types.h: Remove redundant enum from
	machine_mode.

gcc/go/
	* go-lang.c: Remove redundant enum from machine_mode.

gcc/java/
	* builtins.c, java-tree.h, typeck.c: Remove redundant enum from
	machine_mode.

gcc/lto/
	* lto-lang.c: Remove redundant enum from machine_mode.

gcc/
	* addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c,
	builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h,
	cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c,
	config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md,
	config/aarch64/aarch64.c, config/aarch64/aarch64.h,
	config/aarch64/aarch64.md, config/alpha/alpha-protos.h,
	config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c,
	config/arc/arc.h, config/arc/predicates.md,
	config/arm/aarch-common-protos.h, config/arm/aarch-common.c,
	config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h,
	config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md,
	config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c,
	config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c,
	config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md,
	config/cr16/cr16-protos.h, config/cr16/cr16.c,
	config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md,
	config/darwin-protos.h, config/darwin.c,
	config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c,
	config/epiphany/epiphany.md, config/fr30/fr30.c,
	config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md,
	config/h8300/h8300-protos.h, config/h8300/h8300.c,
	config/i386/i386-builtin-types.awk, config/i386/i386-protos.h,
	config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md,
	config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h,
	config/ia64/ia64.c, config/iq2000/iq2000-protos.h,
	config/iq2000/iq2000.c, config/iq2000/iq2000.md,
	config/lm32/lm32-protos.h, config/lm32/lm32.c,
	config/m32c/m32c-protos.h, config/m32c/m32c.c,
	config/m32r/m32r-protos.h, config/m32r/m32r.c,
	config/m68k/m68k-protos.h, config/m68k/m68k.c,
	config/mcore/mcore-protos.h, config/mcore/mcore.c,
	config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c,
	config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c,
	config/mips/mips-protos.h, config/mips/mips.c,
	config/mmix/mmix-protos.h, config/mmix/mmix.c,
	config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c,
	config/moxie/moxie.c, config/msp430/msp430-protos.h,
	config/msp430/msp430.c, config/nds32/nds32-cost.c,
	config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c,
	config/nds32/nds32-protos.h, config/nds32/nds32.c,
	config/nios2/nios2-protos.h, config/nios2/nios2.c,
	config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h,
	config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c,
	config/rs6000/altivec.md, config/rs6000/rs6000-c.c,
	config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c,
	config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c,
	config/s390/predicates.md, config/s390/s390-protos.h,
	config/s390/s390.c, config/s390/s390.h, config/s390/s390.md,
	config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c,
	config/sh/sh.md, config/sparc/predicates.md,
	config/sparc/sparc-protos.h, config/sparc/sparc.c,
	config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c,
	config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c,
	config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c,
	config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h,
	config/tilepro/tilepro.c, config/v850/v850-protos.h,
	config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h,
	config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h,
	config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h,
	dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi,
	doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c,
	dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h,
	except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c,
	fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h,
	fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c,
	genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c,
	graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c,
	internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c,
	ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h,
	libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c,
	loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c,
	lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c,
	lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h,
	output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h,
	recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c,
	regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h,
	rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c,
	sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c,
	simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def,
	targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c,
	tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c,
	tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c,
	tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c,
	tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c,
	tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c,
	tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c,
	tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c,
	tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c,
	tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c,
	var-tracking.c, varasm.c: Remove redundant enum from
	machine_mode.
gcc/
	* gengtype.c (main): Treat machine_mode as a scalar typedef.
	* genmodes.c (emit_insn_modes_h): Hide inline functions if
	USED_FOR_TARGET.

From-SVN: r216834
2014-10-29 12:02:45 +00:00
Andrew MacLeod c582198bd9 cgraph.h: Flatten.
* cgraph.h: Flatten.  Remove all include files.
	(symbol_table::initialize): Move to cgraph.c.
	* cgraph.c: Adjust include files.
	(symbol_table::initialize): Relocate from cgraph.h.
	* gengtype.c (open_base_files): Adjust include files.
	* gccplugin.h: Add hash-map.h, is-a.h, plugin-api.h, and ipa-ref.h to
	included files.
	* ipa-inline.h: Remove all include files.
	* ipa-prop.h: Ditto.
	* ipa-reference.h: Ditto.
	* ipa-utils.h: Ditto:
	* lto-streamer.h: Remove cgraph.h from include list.
	* asan.c: Adjust include files.
	* auto-profile.c: Ditto.
	* bb-reorder.c: Ditto.
	* calls.c: Ditto.
	* cfgexpand.c: Ditto.
	* cgraphbuild.c: Ditto.
	* cgraphclones.c: Ditto.
	* cgraphunit.c: Ditto.
	* combine.c: Ditto.
	* coverage.c: Ditto.
	* data-streamer.c: Ditto.
	* data-streamer-in.c: Ditto.
	* data-streamer-out.c: Ditto.
	* dbxout.c: Ditto.
	* dwarf2out.c: Ditto.
	* except.c: Ditto.
	* expr.c: Ditto.
	* final.c: Ditto.
	* fold-const.c: Ditto.
	* ggc-page.c: Ditto.
	* gimple-fold.c: Ditto.
	* gimple-iterator.c: Ditto.
	* gimple-pretty-print.c: Ditto.
	* gimple-streamer-in.c: Ditto.
	* gimple-streamer-out.c: Ditto.
	* gimplify.c: Ditto.
	* ipa.c: Ditto.
	* ipa-comdats.c: Ditto.
	* ipa-cp.c: Ditto.
	* ipa-devirt.c: Ditto.
	* ipa-icf.c: Ditto.
	* ipa-icf-gimple.c: Ditto.
	* ipa-inline-analysis.c: Ditto.
	* ipa-inline.c: Ditto.
	* ipa-inline-transform.c: Ditto.
	* ipa-polymorphic-call.c: Ditto.
	* ipa-profile.c: Ditto.
	* ipa-prop.c: Ditto.
	* ipa-pure-const.c: Ditto.
	* ipa-ref.c: Ditto.
	* ipa-reference.c: Ditto.
	* ipa-split.c: Ditto.
	* ipa-utils.c: Ditto.
	* ipa-visibility.c: Ditto.
	* langhooks.c: Ditto.
	* lto-cgraph.c: Ditto.
	* lto-compress.c: Ditto.
	* lto-opts.c: Ditto.
	* lto-section-in.c: Ditto.
	* lto-section-out.c: Ditto.
	* lto-streamer.c: Ditto.
	* lto-streamer-in.c: Ditto.
	* lto-streamer-out.c: Ditto.
	* omp-low.c: Ditto.
	* opts-global.c: Ditto.
	* passes.c: Ditto.
	* predict.c: Ditto.
	* print-tree.c: Ditto.
	* profile.c: Ditto.
	* ree.c: Ditto.
	* stor-layout.c: Ditto.
	* symtab.c: Ditto.
	* toplev.c: Ditto.
	* trans-mem.c: Ditto.
	* tree.c: Ditto.
	* tree-cfg.c: Ditto.
	* tree-eh.c: Ditto.
	* tree-emutls.c: Ditto.
	* tree-inline.c: Ditto.
	* tree-nested.c: Ditto.
	* tree-pretty-print.c: Ditto.
	* tree-profile.c: Ditto.
	* tree-sra.c: Ditto.
	* tree-ssa-alias.c: Ditto.
	* tree-ssa-loop-ivcanon.c: Ditto.
	* tree-ssa-loop-ivopts.c: Ditto.
	* tree-ssa-pre.c: Ditto.
	* tree-ssa-structalias.c: Ditto.
	* tree-streamer.c: Ditto.
	* tree-streamer-in.c: Ditto.
	* tree-streamer-out.c: Ditto.
	* tree-switch-conversion.c: Ditto.
	* tree-tailcall.c: Ditto.
	* tree-vect-data-refs.c: Ditto.
	* tree-vectorizer.c: Ditto.
	* tree-vect-stmts.c: Ditto.
	* tsan.c: Ditto.
	* ubsan.c: Ditto.
	* value-prof.c: Ditto.
	* varasm.c: Ditto.
	* varpool.c: Ditto.
	* config/arm/arm.c: Ditto.
	* config/bfin/bfin.c: Ditto.
	* config/c6x/c6x.c: Ditto.
	* config/cris/cris.c: Ditto.
	* config/darwin.c: Ditto.
	* config/darwin-c.c: Ditto.
	* config/i386/i386.c: Ditto.
	* config/i386/winnt.c: Ditto.
	* config/microblaze/microblaze.c: Ditto.
	* config/mips/mips.c: Ditto.
	* config/rs6000/rs6000.c: Ditto.
	* config/rx/rx.c: Ditto.

	* ada/gcc-interface/trans.c: Adjust include files.
	* ada/gcc-interface/utils.c: Ditto.

	* c/c-decl.c: Adjust include files.
	* c/c-parser.c: Ditto.

	* c-family/c-common.c: Adjust include files.
	* c-family/c-gimplify.c: Ditto.
	* c-family/cilk.c: Ditto.
	* c-family/c-pragma.c: Ditto.
	* c-family/c-ubsan.c: Ditto.

	* cp/call.c: Adjust include files.
	* cp/class.c: Ditto.
	* cp/decl2.c: Ditto.
	* cp/decl.c: Ditto.
	* cp/lambda.c: Ditto.
	* cp/mangle.c: Ditto.
	* cp/method.c: Ditto.
	* cp/optimize.c: Ditto.
	* cp/parser.c: Ditto.
	* cp/semantics.c: Ditto.
	* cp/tree.c: Ditto.
	* cp/vtable-class-hierarchy.c: Ditto.

	* fortran/f95-lang.c: Adjust include files.
	* fortran/trans-decl.c: Ditto.

	* go/go-gcc.cc: Adjust include files.

	* java/class.c: Adjust include files.
	* java/decl.c: Ditto.
	* java/jcf-parse.c: Ditto.
	* java/resource.c: Ditto.

	* lto/lto.c: Adjust include files.
	* lto/lto-lang.c: Ditto.
	* lto/lto-object.c: Ditto.
	* lto/lto-partition.c: Ditto.
	* lto/lto-symtab.c: Ditto.

	* objc/objc-act.c: Adjust include files.

From-SVN: r216805
2014-10-28 16:17:19 +00:00
Andrew MacLeod 60393bbc61 ggcplug.c: Shuffle includes to include gcc-plugin.h earlier.
2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* testsuite/gcc.dg/plugin/ggcplug.c: Shuffle includes to include
	gcc-plugin.h earlier.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* c/c-typeck.c: Adjust include files.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* c-family/c-gimplify.c: Adjust include files.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* cp/cp-gimplify.c: Adjust include files.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* go/go-gcc.cc: Adjust include files.
	* go/go-lang.c: Ditto.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* java/java-gimplify.c: Adjust include files.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* lto/lto-lang.c: Adjust include files.
	* lto/lto-object.c: Ditto.
	* lto/lto-partition.c: Ditto.
	* lto/lto-symtab.c: Ditto.
	* lto/lto.c: Ditto.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* basic-block.h: Remove all includes.
	(enum profile_status_d, struct control_flow_graph): Move to cfg.h
	* cfg.h (profile_status_d, struct control_flow_graph): Relocate here.
	* Makefile.in (GTFILES): Add cfg.h to list.
	* cgraph.h (symbol_table::create_empty): Move to cgraph.c.
	* cgraph.c (symbol_table::create_empty): Relocate from cgraph.h.
	* genconditions.c (write_header): Add predict.h and basic-block.h to
	lits of includes.
	* genemit.c (main): Ditto.
	* genpreds.c (write_insn_preds_c): Ditto.
	* genrecog.c (write_header): Ditto.
	* gengtype.c (open_base_files): Add predict.h, basic-block.h, and cfg.h
	to list of includes.
	* alias.c: Adjust include files.
	* asan.c: Ditto.
	* auto-inc-dec.c: Ditto.
	* auto-profile.c: Ditto.
	* bb-reorder.c: Ditto.
	* bt-load.c: Ditto.
	* builtins.c: Ditto.
	* caller-save.c: Ditto.
	* calls.c: Ditto.
	* cfg.c: Ditto.
	* cfganal.c: Ditto.
	* cfgbuild.c: Ditto.
	* cfgcleanup.c: Ditto.
	* cfgexpand.c: Ditto.
	* cfghooks.c: Ditto.
	* cfgloop.c: Ditto.
	* cfgloopanal.c: Ditto.
	* cfgloopmanip.c: Ditto.
	* cfgrtl.c: Ditto.
	* cgraphbuild.c: Ditto.
	* cgraphclones.c: Ditto.
	* cgraphunit.c: Ditto.
	* combine-stack-adj.c: Ditto.
	* combine.c: Ditto.
	* compare-elim.c: Ditto.
	* coverage.c: Ditto.
	* cprop.c: Ditto.
	* cse.c: Ditto.
	* cselib.c: Ditto.
	* data-streamer-in.c: Ditto.
	* data-streamer-out.c: Ditto.
	* data-streamer.c: Ditto.
	* dce.c: Ditto.
	* ddg.c: Ditto.
	* ddg.h: Ditto.
	* df-core.c: Ditto.
	* df-problems.c: Ditto.
	* df-scan.c: Ditto.
	* df.h: Ditto.
	* dojump.c: Ditto.
	* dominance.c: Ditto.
	* domwalk.c: Ditto.
	* dse.c: Ditto.
	* dwarf2cfi.c: Ditto.
	* emit-rtl.c: Ditto.
	* et-forest.c: Ditto.
	* except.c: Ditto.
	* expmed.c: Ditto.
	* expr.c: Ditto.
	* final.c: Ditto.
	* fold-const.c: Ditto.
	* function.c: Ditto.
	* fwprop.c: Ditto.
	* gcc-plugin.h: Ditto.
	* gcse.c: Ditto.
	* generic-match-head.c: Ditto.
	* ggc-page.c: Ditto.
	* gimple-builder.c: Ditto.
	* gimple-expr.c: Ditto.
	* gimple-fold.c: Ditto.
	* gimple-iterator.c: Ditto.
	* gimple-low.c: Ditto.
	* gimple-match-head.c: Ditto.
	* gimple-pretty-print.c: Ditto.
	* gimple-ssa-isolate-paths.c: Ditto.
	* gimple-ssa-strength-reduction.c: Ditto.
	* gimple-streamer-in.c: Ditto.
	* gimple-streamer-out.c: Ditto.
	* gimple-streamer.h: Ditto.
	* gimple-walk.c: Ditto.
	* gimple.c: Ditto.
	* gimplify-me.c: Ditto.
	* gimplify.c: Ditto.
	* graph.c: Ditto.
	* graphite-blocking.c: Ditto.
	* graphite-clast-to-gimple.c: Ditto.
	* graphite-dependences.c: Ditto.
	* graphite-interchange.c: Ditto.
	* graphite-isl-ast-to-gimple.c: Ditto.
	* graphite-optimize-isl.c: Ditto.
	* graphite-poly.c: Ditto.
	* graphite-scop-detection.c: Ditto.
	* graphite-sese-to-poly.c: Ditto.
	* graphite.c: Ditto.
	* haifa-sched.c: Ditto.
	* hw-doloop.c: Ditto.
	* ifcvt.c: Ditto.
	* init-regs.c: Ditto.
	* internal-fn.c: Ditto.
	* ipa-cp.c: Ditto.
	* ipa-devirt.c: Ditto.
	* ipa-icf-gimple.c: Ditto.
	* ipa-icf.c: Ditto.
	* ipa-inline-analysis.c: Ditto.
	* ipa-inline.c: Ditto.
	* ipa-polymorphic-call.c: Ditto.
	* ipa-profile.c: Ditto.
	* ipa-prop.c: Ditto.
	* ipa-pure-const.c: Ditto.
	* ipa-reference.c: Ditto.
	* ipa-split.c: Ditto.
	* ipa-utils.c: Ditto.
	* ipa.c: Ditto.
	* ira-build.c: Ditto.
	* ira-color.c: Ditto.
	* ira-conflicts.c: Ditto.
	* ira-costs.c: Ditto.
	* ira-emit.c: Ditto.
	* ira-lives.c: Ditto.
	* ira.c: Ditto.
	* jump.c: Ditto.
	* lcm.c: Ditto.
	* loop-doloop.c: Ditto.
	* loop-init.c: Ditto.
	* loop-invariant.c: Ditto.
	* loop-iv.c: Ditto.
	* loop-unroll.c: Ditto.
	* lower-subreg.c: Ditto.
	* lra-assigns.c: Ditto.
	* lra-coalesce.c: Ditto.
	* lra-constraints.c: Ditto.
	* lra-eliminations.c: Ditto.
	* lra-lives.c: Ditto.
	* lra-spills.c: Ditto.
	* lra.c: Ditto.
	* lto-cgraph.c: Ditto.
	* lto-compress.c: Ditto.
	* lto-opts.c: Ditto.
	* lto-section-in.c: Ditto.
	* lto-section-out.c: Ditto.
	* lto-streamer-in.c: Ditto.
	* lto-streamer-out.c: Ditto.
	* lto-streamer.c: Ditto.
	* mcf.c: Ditto.
	* mode-switching.c: Ditto.
	* modulo-sched.c: Ditto.
	* omp-low.c: Ditto.
	* optabs.c: Ditto.
	* opts-global.c: Ditto.
	* passes.c: Ditto.
	* postreload-gcse.c: Ditto.
	* postreload.c: Ditto.
	* predict.c: Ditto.
	* print-rtl.c: Ditto.
	* profile.c: Ditto.
	* recog.c: Ditto.
	* ree.c: Ditto.
	* reg-stack.c: Ditto.
	* regcprop.c: Ditto.
	* regcprop.h: Ditto.
	* reginfo.c: Ditto.
	* regrename.c: Ditto.
	* regstat.c: Ditto.
	* reload.c: Ditto.
	* reload1.c: Ditto.
	* reorg.c: Ditto.
	* resource.c: Ditto.
	* rtlanal.c: Ditto.
	* sched-deps.c: Ditto.
	* sched-ebb.c: Ditto.
	* sched-int.h: Ditto.
	* sched-rgn.c: Ditto.
	* sched-vis.c: Ditto.
	* sel-sched-dump.c: Ditto.
	* sel-sched-ir.c: Ditto.
	* sel-sched-ir.h: Ditto.
	* sel-sched.c: Ditto.
	* sese.c: Ditto.
	* shrink-wrap.c: Ditto.
	* stack-ptr-mod.c: Ditto.
	* stmt.c: Ditto.
	* store-motion.c: Ditto.
	* symtab.c: Ditto.
	* toplev.c: Ditto.
	* tracer.c: Ditto.
	* trans-mem.c: Ditto.
	* tree-affine.c: Ditto.
	* tree-call-cdce.c: Ditto.
	* tree-cfg.c: Ditto.
	* tree-cfgcleanup.c: Ditto.
	* tree-chrec.c: Ditto.
	* tree-complex.c: Ditto.
	* tree-data-ref.c: Ditto.
	* tree-dfa.c: Ditto.
	* tree-eh.c: Ditto.
	* tree-emutls.c: Ditto.
	* tree-if-conv.c: Ditto.
	* tree-inline.c: Ditto.
	* tree-into-ssa.c: Ditto.
	* tree-loop-distribution.c: Ditto.
	* tree-nested.c: Ditto.
	* tree-nrv.c: Ditto.
	* tree-object-size.c: Ditto.
	* tree-outof-ssa.c: Ditto.
	* tree-parloops.c: Ditto.
	* tree-phinodes.c: Ditto.
	* tree-predcom.c: Ditto.
	* tree-pretty-print.c: Ditto.
	* tree-profile.c: Ditto.
	* tree-scalar-evolution.c: Ditto.
	* tree-sra.c: Ditto.
	* tree-ssa-address.c: Ditto.
	* tree-ssa-alias.c: Ditto.
	* tree-ssa-ccp.c: Ditto.
	* tree-ssa-coalesce.c: Ditto.
	* tree-ssa-copy.c: Ditto.
	* tree-ssa-copyrename.c: Ditto.
	* tree-ssa-dce.c: Ditto.
	* tree-ssa-dom.c: Ditto.
	* tree-ssa-dse.c: Ditto.
	* tree-ssa-forwprop.c: Ditto.
	* tree-ssa-ifcombine.c: Ditto.
	* tree-ssa-live.c: Ditto.
	* tree-ssa-loop-ch.c: Ditto.
	* tree-ssa-loop-im.c: Ditto.
	* tree-ssa-loop-ivcanon.c: Ditto.
	* tree-ssa-loop-ivopts.c: Ditto.
	* tree-ssa-loop-manip.c: Ditto.
	* tree-ssa-loop-niter.c: Ditto.
	* tree-ssa-loop-prefetch.c: Ditto.
	* tree-ssa-loop-unswitch.c: Ditto.
	* tree-ssa-loop.c: Ditto.
	* tree-ssa-math-opts.c: Ditto.
	* tree-ssa-operands.c: Ditto.
	* tree-ssa-phiopt.c: Ditto.
	* tree-ssa-phiprop.c: Ditto.
	* tree-ssa-pre.c: Ditto.
	* tree-ssa-propagate.c: Ditto.
	* tree-ssa-reassoc.c: Ditto.
	* tree-ssa-sccvn.c: Ditto.
	* tree-ssa-sink.c: Ditto.
	* tree-ssa-strlen.c: Ditto.
	* tree-ssa-structalias.c: Ditto.
	* tree-ssa-tail-merge.c: Ditto.
	* tree-ssa-ter.c: Ditto.
	* tree-ssa-threadedge.c: Ditto.
	* tree-ssa-threadupdate.c: Ditto.
	* tree-ssa-uncprop.c: Ditto.
	* tree-ssa-uninit.c: Ditto.
	* tree-ssa.c: Ditto.
	* tree-ssanames.c: Ditto.
	* tree-stdarg.c: Ditto.
	* tree-streamer-in.c: Ditto.
	* tree-streamer-out.c: Ditto.
	* tree-streamer.c: Ditto.
	* tree-switch-conversion.c: Ditto.
	* tree-tailcall.c: Ditto.
	* tree-vect-data-refs.c: Ditto.
	* tree-vect-generic.c: Ditto.
	* tree-vect-loop-manip.c: Ditto.
	* tree-vect-loop.c: Ditto.
	* tree-vect-patterns.c: Ditto.
	* tree-vect-slp.c: Ditto.
	* tree-vect-stmts.c: Ditto.
	* tree-vectorizer.c: Ditto.
	* tree-vrp.c: Ditto.
	* tree.c: Ditto.
	* tsan.c: Ditto.
	* ubsan.c: Ditto.
	* valtrack.c: Ditto.
	* valtrack.h: Ditto.
	* value-prof.c: Ditto.
	* var-tracking.c: Ditto.
	* varasm.c: Ditto.
	* varpool.c: Ditto.
	* vtable-verify.c: Ditto.
	* web.c: Ditto.
	* config/aarch64/aarch64-builtins.c: Ditto.
	* config/aarch64/aarch64.c: Ditto.
	* config/alpha/alpha.c: Ditto.
	* config/arc/arc.c: Ditto.
	* config/arm/arm.c: Ditto.
	* config/avr/avr.c: Ditto.
	* config/bfin/bfin.c: Ditto.
	* config/c6x/c6x.c: Ditto.
	* config/cr16/cr16.c: Ditto.
	* config/cris/cris.c: Ditto.
	* config/darwin-c.c: Ditto.
	* config/darwin.c: Ditto.
	* config/epiphany/epiphany.c: Ditto.
	* config/epiphany/mode-switch-use.c: Ditto.
	* config/epiphany/resolve-sw-modes.c: Ditto.
	* config/fr30/fr30.c: Ditto.
	* config/frv/frv.c: Ditto.
	* config/h8300/h8300.c: Ditto.
	* config/i386/i386.c: Ditto.
	* config/i386/winnt.c: Ditto.
	* config/ia64/ia64.c: Ditto.
	* config/iq2000/iq2000.c: Ditto.
	* config/lm32/lm32.c: Ditto.
	* config/m32c/m32c.c: Ditto.
	* config/m32r/m32r.c: Ditto.
	* config/m68k/m68k.c: Ditto.
	* config/mcore/mcore.c: Ditto.
	* config/mep/mep.c: Ditto.
	* config/microblaze/microblaze.c: Ditto.
	* config/mips/mips.c: Ditto.
	* config/mmix/mmix.c: Ditto.
	* config/mn10300/mn10300.c: Ditto.
	* config/moxie/moxie.c: Ditto.
	* config/msp430/msp430.c: Ditto.
	* config/nds32/nds32-cost.c: Ditto.
	* config/nds32/nds32-fp-as-gp.c: Ditto.
	* config/nds32/nds32-intrinsic.c: Ditto.
	* config/nds32/nds32-isr.c: Ditto.
	* config/nds32/nds32-md-auxiliary.c: Ditto.
	* config/nds32/nds32-memory-manipulation.c: Ditto.
	* config/nds32/nds32-pipelines-auxiliary.c: Ditto.
	* config/nds32/nds32-predicates.c: Ditto.
	* config/nds32/nds32.c: Ditto.
	* config/nios2/nios2.c: Ditto.
	* config/pa/pa.c: Ditto.
	* config/pdp11/pdp11.c: Ditto.
	* config/rl78/rl78.c: Ditto.
	* config/rs6000/rs6000.c: Ditto.
	* config/rx/rx.c: Ditto.
	* config/s390/s390.c: Ditto.
	* config/sh/sh-mem.cc: Ditto.
	* config/sh/sh.c: Ditto.
	* config/sh/sh_optimize_sett_clrt.cc: Ditto.
	* config/sh/sh_treg_combine.cc: Ditto.
	* config/sparc/sparc.c: Ditto.
	* config/spu/spu.c: Ditto.
	* config/stormy16/stormy16.c: Ditto.
	* config/tilegx/tilegx.c: Ditto.
	* config/tilepro/tilepro.c: Ditto.
	* config/v850/v850.c: Ditto.
	* config/vax/vax.c: Ditto.
	* config/xtensa/xtensa.c: Ditto.

From-SVN: r216735
2014-10-27 12:41:01 +00:00
DJ Delorie 957f47e6c8 lto-object.c (lto_obj_begin_section): In the event that pointer sizes aren't powers of two...
* lto-object.c (lto_obj_begin_section): In the event that pointer
sizes aren't powers of two, choose a more suitable alignment
than (unsigned)(-1).

From-SVN: r216350
2014-10-16 17:06:34 -04:00
DJ Delorie 78a7c3172f machmode.h (int_n_data_t): New.
* machmode.h (int_n_data_t): New.
	(int_n_enabled_p): New.
	(int_n_data): New.
	* tree.c (int_n_enabled_p): New.
	(int_n_trees): New.
	(make_or_reuse_type): Check for all __intN types, not just
	__int128.
	(build_common_tree_nodes): Likewise.  Also fill in integer_typs[]
	entries.
	* tree.h (int128_integer_type_node): Remove.
	(int128_unsigned_type_node): Remove.
	(int_n_trees_t): New.
	(int_n_enabled_p): New.
	(int_n_trees): New.
	* toplev.c (standard_type_bitsize): New.
	(do_compile): Check which __intN types are enabled for the current
	run.
	* builtin-types.def (BT_INT128): Remove.
	(BT_UINT128): Remove.
	* machmode.def: Add macro to create __int128 for all targets.
	* stor-layout.c (mode_for_size): Support __intN types.
	(smallest_mode_for_size): Likewise.
	(initialize_sizetypes): Support __intN types.
	* genmodes.c (struct mode_data): Add int_n field.
	(blank_mode): Likewise.
	(INT_N): New.
	(make_int_n): New.
	(emit_insn_modes_h): Count __intN entries and define
	NUM_INT_N_ENTS.
	(emit_mode_int_n): New.
	(emit_insn_modes_c): Call it.
	* gimple.c (gimple_signed_or_unsigned_type): Check for all __intN
	types, not just __int128.
	* tree-core.h (integer_type_kind): Remove __int128-specific
	entries, reserve spots for __intN entries.

libstdc++-v3/
	* src/c++11/limits.cc: Add support for __intN types.
	* include/std/type_traits: Likewise.
	* include/std/limits: Likewise.
	* include/c_std/cstdlib: Likewise.
	* include/bits/cpp_type_traits.h: Likewise.
	* include/c_global/cstdlib: Likewise.

c-family/
	* c-pretty-print.c (pp_c_integer_constant): Check for all __intN
	types, not just __int128.
	* c-cppbuiltin.c (c_cpp_builtins): Add builtins for all __intN
	types, not just __int128.
	(cpp_atomic_builtins): Round pointer sizes up.
	(type_suffix): Use type precision, not specific types.
	* c-common.c (c_common_reswords): Remove __int128 special case.
	(c_common_type_for_size): Check for all __intN types, not just
	__int128.
	(c_common_type_for_mode): Likewise.
	(c_common_signed_or_unsigned_type): Likewise.
	(c_build_bitfield_integer_type): Likewise.
	(c_common_nodes_and_builtins): Likewise.
	(keyword_begins_type_specifier): Likewise.
	* c-common.h (rid): Remove RID_INT128 and add RID_INT_N_* for all
	__intN variants.

c/
	* c-parser.c (c_parse_init): Add RID entries for each __intN.
	(c_token_starts_typename): Check all __intN, not just __int128.
	(c_token_starts_declspecs): Likewise.
	(c_parser_declspecs): Likewise.
	(c_parser_attribute_any_word): Likewise.
	(c_parser_objc_selector): Likewise.
	* c-tree.h (c_typespec_keyword): cts_int128 -> cts_int_n.
	(struct c_declspecs): Add int_n_idx field to record *which* __intN
	is specified.
	* c-decl.c (declspecs_add_type): Check for all __intN, not just
	__int128.
	(finish_declspecs): Likewise.

testsuite/
	* g++.dg/abi/mangle64.C: New.

cp/
	* typeck.c (cp_common_type): Check for all __intN types, not just
	__int128.
	* decl.c (grokdeclarator): Likewise.
	* rtti.c (emit_support_tinfos): Check for all __intN types, not just
	__int128.
	* parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Check
	for all __intN types, not just __int128.
	(cp_parser_simple_type_specifier): Likewise.
	* mangle.c (integer_type_codes): Remove int128-specific codes.
	* cp-tree.h (cp_decl_specifier_seq): Add int_n_idx to store which
	__intN was specified.
	* lex.c (init_reswords): Reserve all __intN keywords.

lto/
	* lto-lang.c (lto_build_c_type_nodes): Check intN types for
	size-type as well.
	(lto_init): Initialize all intN types, not just int128.

From-SVN: r216220
2014-10-14 15:44:36 -04:00
Martin Liska 70261a4fb1 lto.c (stream_out): ARG_UNUSED added for last argument.
* lto.c (stream_out): ARG_UNUSED added for last argument.

From-SVN: r215926
2014-10-06 11:51:09 +00:00
Aldy Hernandez 00de328a7a cgraph.h, [...]: Rename all instances of DECL_ABSTRACT to DECL_ABSTRACT_P.
* cgraph.h, dbxout.c, dwarfout2.c, gimple-fold.c,
    	lto-streamer-out.c, print-tree.c, symtab.c, tree-inline.c,
    	tree-streamer-in.c, tree-streamer-out.c, tree.c, tree.h,
    	varpool.c: Rename all instances of DECL_ABSTRACT to
    	DECL_ABSTRACT_P.

    cp/
    	* class.c, decl.c, optimize.c: Rename all instances of
    	DECL_ABSTRACT to DECL_ABSTRACT_P.

    lto/
    	* lto-symtab.c, lto.c: Rename all instances of DECL_ABSTRACT to
    	DECL_ABSTRACT_P.

From-SVN: r215567
2014-09-24 19:50:24 +00:00
Andi Kleen 7861b6489d Add an no_reorder attribute for LTO
Some projects need to prevent reordering of specific top level
declarations with LTO, in particular declarations defining init calls.

The only way to do that with LTO was to use -fno-toplevel-reorder,
which stops reordering for all declarations and makes LTO partitioning
less efficient.

This patch adds a new no_reorder attribute that stops reordering only
for the marked declaration. The program can then only mark e.g. the
initcalls and leave all the other declarations alone.

The patch does:

- Adds the new no_reorder attribute for the C family.
- Initializes a new no_reorder flag in the symtab_nodes in the
function visibility flag.
- Maintains the no_reorder flag when creating new nodes.
- Changes the partition code to always keep a separate
sorted queue of ordered nodes and flush them in order with the other
nodes. This is used by all nodes with -fno-toplevel-reorder,
and only the marked ones without it.
Parts of the old -fno-toplevel-reorder code paths are reused.
- Adds various checks throughout the tree to make no_reorder
marked functions behave the same as with -fno-toplevel-reorder
- Changes the LTO streamer to serialize the no_reorder attribute.

gcc/c-family/:

2014-09-23  Andi Kleen  <ak@linux.intel.com>

	* c-common.c (handle_no_reorder_attribute): New function.
	(c_common_attribute_table): Add no_reorder attribute.

gcc/:

2014-09-23  Andi Kleen  <ak@linux.intel.com>

	* cgraph.h (symtab_node): Add no_reorder attribute.
	(symbol_table::output_asm_statements): Remove.
	* cgraphclones.c (cgraph_node::create_clone): Copy no_reorder.
	(cgraph_node::create_version_clone): Dito.
	(symbol_table::output_asm_statements): Remove.
	* trans-mem.c (ipa_tm_create_version_alias): Dito.
	* cgraphunit.c (varpool_node::finalize_decl): Check no_reorder.
	(output_in_order): Add no_reorder flag. Only handle no_reorder
	nodes when set.
	(symbol_table::compile): Add separate pass for no_reorder nodes.
	(process_common_attributes): Set no_reorder flag in symtab node.
	Add node argument.
	(process_function_and_variable_attributes): Pass symtab nodes to
	process_common_attributes.
	* doc/extend.texi (no_reorder): Document no_reorder attribute.
	* lto-cgraph.c (lto_output_node): Serialize no_reorder.
	(lto_output_varpool_node): Dito.
	(input_overwrite_node): Dito.
	(input_varpool_node): Dito.
	* varpool.c (varpool_node::add): Set no_reorder attribute.
	(symbol_table::remove_unreferenced_decls): Handle no_reorder.
	(symbol_table::output_variables): Dito.
	* symtab.c (symtab_node::dump_base): Print no_reorder.

gcc/lto/:

2014-09-23  Andi Kleen  <ak@linux.intel.com>

	* lto-partition.c (node_cmp): Update comment.
	(varpool_node_cmp): Use symtab_node for comparison.
	(add_sorted_nodes): New function.
	(lto_balanced_map): Change to keep ordered queue
	of ordered node. Handle no_reorder attribute.

From-SVN: r215537
2014-09-24 03:29:24 +00:00
Jan Hubicka 1ee85ee19b common.opt (flto-odr-type-merging): New flag.
* common.opt (flto-odr-type-merging): New flag.
	* ipa-deivrt.c (hash_type_name): Use ODR names for hasing if availale.
	(types_same_for_odr): Likewise.
	(odr_subtypes_equivalent_p): Likewise.
	(add_type_duplicate): Do not walk type variants.
	(register_odr_type): New function.
	* ipa-utils.h (register_odr_type): Declare.
	(odr_type_p): New function.
	* langhooks.c (lhd_set_decl_assembler_name): Do not compute
	TYPE_DECLs
	* doc/invoke.texi (-flto-odr-type-merging): Document.
	* tree.c (need_assembler_name_p): Compute ODR names when asked
	for it.
	* tree.h (DECL_ASSEMBLER_NAME): Update comment.

	* lto.c (lto_read_decls): Register ODR types.

From-SVN: r215196
2014-09-11 23:16:42 +00:00
Jan Hubicka 8605403e2b cgraphunit.c (ipa_passes, compile): Reshedule symtab_remove_unreachable_nodes passes; update comments.
* cgraphunit.c (ipa_passes, compile): Reshedule
	symtab_remove_unreachable_nodes passes; update comments.
	* ipa-inline.c (pass_data_ipa_inline): Do not schedule
	TODO_remove_functions before the pass; the functions ought to be
	already removed.
	* ipa.c (pass_data_ipa_free_inline_summary): Enable dump; schedule
	TODO_remove_functions.
	* passes.c (pass_data_early_local_passes): Do not schedule function
	removal.
	(execute_one_pass): Fix call of symtab_remove_unreachable_nodes.

	* lto.c (read_cgraph_and_symbols): Fix symtab_remove_unreachable_nodes
	call.
	(do_whole_program_analysis): Only sanity check that IPA passes cleans up.

	* testsuite/g++.dg/ipa/devirt-17.C: Update template.
	* testsuite/g++.dg/ipa/devirt-16.C: Update template.

From-SVN: r214224
2014-08-20 13:55:06 +00:00
Jan Hubicka 56b1f114de ipa-utils.h (compare_virtual_tables): Declare.
* ipa-utils.h (compare_virtual_tables): Declare.
	* ipa-devirt.c (odr_subtypes_equivalent_p): New function

	* lto-symtab.c (lto_varpool_replace_node): Call compare_virtual_tables.

From-SVN: r213990
2014-08-14 23:30:46 +00:00
Richard Biener 833f94c011 re PR lto/62067 (lto-lang.c:549: too many calls to va_end on some code paths ?)
2014-08-14  Richard Biener  <rguenther@suse.de>

	PR lto/62067
	* lto-lang.c (def_fn_type): Fix error handling wrt va_end.

From-SVN: r213960
2014-08-14 13:13:41 +00:00
Richard Biener 207c68cd61 lto-streamer.h (struct lto_input_block): Make it a class with a constructor.
2014-08-08  Richard Biener  <rguenther@suse.de>

	* lto-streamer.h (struct lto_input_block): Make it a class
	with a constructor.
	(LTO_INIT_INPUT_BLOCK, LTO_INIT_INPUT_BLOCK_PTR): Remove.
	(struct lto_function_header, struct lto_simple_header,
	struct lto_simple_header_with_strings,
	struct lto_decl_header, struct lto_function_header): Make
	a simple inheritance hieararchy.  Remove unused fields.
	(struct lto_asm_header): Remove.
	* lto-streamer-out.c (produce_asm): Adjust.
	(lto_output_toplevel_asms): Likewise.
	(produce_asm_for_decls): Likewise.
	* lto-section-out.c (lto_destroy_simple_output_block): Likewise.
	* data-streamer-in.c (string_for_index): Likewise.
	* ipa-inline-analysis.c (inline_read_section): Likewise.
	* ipa-prop.c (ipa_prop_read_section): Likewise.
	(read_replacements_section): Likewise.
	* lto-cgraph.c (input_cgraph_opt_section): Likewise.
	* lto-section-in.c (lto_create_simple_input_block): Likewise.
	(lto_destroy_simple_input_block): Likewise.
	* lto-streamer-in.c (lto_read_body_or_constructor): Likewise.
	(lto_input_toplevel_asms): Likewise.

	lto/
	* lto.c (lto_read_decls): Adjust for lto_input_block changes.

From-SVN: r213759
2014-08-08 12:55:31 +00:00
Bin Cheng 7c581d613c re PR lto/62032 (FAIL: vsnprintf-chk.c execution, -O2 -flto -fno-use-linker-plugin -flto-partition=none)
PR lto/62032
	* lto/lto-lang.c (lto_init): Switch mis-matched arguments.

From-SVN: r213755
2014-08-08 10:21:12 +00:00
Trevor Saunders 39c8aaa4bf convert the rest of the users of pointer_map to hash_map
gcc/

	* hash-map.h (default_hashmap_traits): Adjust overloads of hash
	function to not conflict.
	* alias.c, cfgexpand.c, dse.c, except.h, gimple-expr.c,
	gimple-ssa-strength-reduction.c, gimple-ssa.h, ifcvt.c,
	lto-streamer-out.c, lto-streamer.h, tree-affine.c, tree-affine.h,
	tree-predcom.c, tree-scalar-evolution.c, tree-ssa-loop-im.c,
	tree-ssa-loop-niter.c, tree-ssa.c, value-prof.c: Use hash_map instead
	of pointer_map.

gcc/cp/

	* cp-tree.h, pt.c: Use hash_map instead of pointer_map.

gcc/lto/

	* lto-partition.c, lto.c: Use hash_map instead of pointer_map.

From-SVN: r213703
2014-08-07 10:44:14 +00:00
Trevor Saunders 6e2830c3db add a hash_set based on hash_table
This allows us to replace the usage of pointer_set outside of
pointer_map with a nicer interface.

gcc/ada/

	* gcc-interface/trans.c: Use hash_set instead of pointer_set.

gcc/c-family/

	* c-gimplify.c: Use hash_set instead of pointer_set.

gcc/c/

	* c-decl.c: Use hash_set instead of pointer_set.

gcc/cp/

	* class.c, cp-gimplify.c, cp-tree.h, decl.c, decl2.c, error.c,
	method.c, name-lookup.c, pt.c, semantics.c, tree.c: Use hash_set
	instead of pointer_set.

gcc/fortran/

	* openmp.c, trans-decl.c: Use hash_set instead of pointer_set.

gcc/

	* hash-set.h: new File.
	* cfgexpand.c, cfgloop.c, cgraph.c, cgraphbuild.c, cgraphunit.c,
	cprop.c, cse.c, gimple-walk.c, gimple-walk.h, gimplify.c, godump.c,
	ipa-devirt.c, ipa-pure-const.c, ipa-visibility.c, ipa.c, lto-cgraph.c,
	lto-streamer-out.c, stmt.c, tree-cfg.c, tree-core.h, tree-eh.c,
	tree-inline.c, tree-inline.h, tree-nested.c, tree-pretty-print.c,
	tree-ssa-loop-niter.c, tree-ssa-phiopt.c, tree-ssa-threadedge.c,
	tree-ssa-uninit.c, tree.c, tree.h, value-prof.c, varasm.c,
	varpool.c: Use hash_set instead of pointer_set.

gcc/lto/

	* lto-partition.c, lto-partition.h: Use hash_set instead of
	pointer_set.

From-SVN: r213516
2014-08-02 11:23:49 +00:00
Andi Kleen 50de5793fc Change inchash to name space.
Change class inchash to move into a inchash namespace as requested.
The class is now inchash::hash

Rename iterative_hstate_expr to inchash::add_expr
... and convert existing users. It wasn't possible to use hash::,
because that lead to name space conflicts with cp and objc.

So class inchash is now inchash::hash and iterative_hstate_expr
is now inchash::add_expr.

gcc/:

2014-07-31  Andi Kleen  <ak@linux.intel.com>

	* inchash.h (inchash): Change inchash class to namespace.
	(class hash): ... Rename from inchash.
	(add_object): Move from macro to class template.
	* lto-streamer-out.c (hash_tree): Change inchash
	to inchash::hash.
	* tree.c (build_type_attribute_qual_variant): Dito.
	(type_hash_list): Dito.
	(attribute_hash_list): Dito.
	(iterative_hstate_expr): Rename to inchash::add_expr
	(build_range_type_1): Change inchash to inchash::hash
	and use hash::add_expr.
	(build_array_type_1): Dito.
	(build_function_type): Dito
	(build_method_type_directly): Dito.
	(build_offset_type): Dito.
	(build_complex_type): Dito.
	(make_vector_type): Dito.
	* tree.h (iterative_hash_expr): Dito.

gcc/lto/:

2014-07-31  Andi Kleen  <ak@linux.intel.com>

	* lto.c (hash_canonical_type): Use inchash::hash
	and use inchash::add_expr.
	(iterative_hash_canonical_type): Dito.

From-SVN: r213394
2014-08-01 02:51:46 +00:00
Richard Biener f6bcdb5e05 lto-streamer.h (lto_write_data): New function.
2014-07-30  Richard Biener  <rguenther@suse.de>

	* lto-streamer.h (lto_write_data): New function.
	* langhooks.c (lhd_append_data): Do not free block.
	* lto-section-out.c (lto_write_data): New function writing
	raw data to the current section.
	(lto_write_stream): Adjust for langhook semantic change.
	(lto_destroy_simple_output_block): Write header directly.
	* lto-opts.c (lto_write_options): Write options directly.
	* lto-streamer-out.c (produce_asm): Write heaeder directly.
	(lto_output_toplevel_asms): Likewise.
	(copy_function_or_variable): Copy data directly.
	(write_global_references): Output index table directly.
	(lto_output_decl_state_refs): Likewise.
	(write_symbol): Write data directly.
	(produce_symtab): Adjust.
	(produce_asm_for_decls): Output header and refs directly.

	lto/
	* lto-object.c (lto_obj_append_data): Do not free block.

From-SVN: r213253
2014-07-30 12:14:58 +00:00
Andi Kleen 56fdfd3e85 Convert the tree.c type hashing over to inchash
v2: Use commutative interface. Be much nearer to the old
code.

gcc/:

2014-07-25  Andi Kleen  <ak@linux.intel.com>

	* tree.c (build_type_attribute_qual_variant): Use inchash.
	(type_hash_list): Dito.
	(attribute_hash_list): Dito
	(iterative_hstate_expr): Dito.
	(iterative_hash_expr): Dito.
	(build_range_type_1): Dito.
	(build_array_type_1): Dito.
	(build_function_type): Dito.
	(build_method_type_directly): Dito.
	(build_offset_type): Dito.
	(build_complex_type): Dito.
	(make_vector_type): Dito.
	* tree.h (iterative_hash_expr): Add compat wrapper.
	(iterative_hstate_expr): Add.

gcc/lto/:

2014-07-25  Andi Kleen  <ak@linux.intel.com>

	* lto.c (hash_canonical_type): Call iterative_hstate_expr.

From-SVN: r213056
2014-07-25 13:39:36 +00:00
Andi Kleen 0bd8bb0476 Convert LTO type hashing to the new inchash interface
Should not really change any behavior, it's just a more abstract
interface, but uses the same underlying hash functions.

gcc/lto/:

2014-07-25  Andi Kleen  <ak@linux.intel.com>

	* lto.c (hash_canonical_type): Convert to inchash.
	(iterative_hash_canonical_type): Dito.

From-SVN: r213055
2014-07-25 13:39:24 +00:00
Andi Kleen 6d8eb96b44 Add an abstract incremental hash data type
Some files in gcc, like lto or tree, do large scale incremential hashing.
The current jhash implementation of this could be likely improved
by using an incremential hash that does not do a full rehashing
for every new value added.

This patch adds a new "inchash" class that abstracts the internal
state of the hash. This makes it easier to plug in new hashes
and also cleans up the code a bit.

Right now it is just implemented in the same way as the old
iterative hash in tree.c. The previous iterative hash code
from tree.c moved into a new separate file. Also I fixed up all
users to include the new header.

It should not really significantly change any hashing by itself,
it's mostly a cleanup at this point.

v2: Remove begin. Add commutative interface.
Add merge hash interface.  Add add_flag.

gcc/:

2014-07-25  Andi Kleen  <ak@linux.intel.com>

	* Makefile.in (OBJS): Add inchash.o.
	(PLUGIN_HEADERS): Add inchash.h.
	* ipa-devirt.c: Include inchash.h.
	* lto-streamer-out.c: Dito.
	* tree-ssa-dom.c: Dito.
	* tree-ssa-pre.c: Dito.
	* tree-ssa-sccvn.c: Dito.
	* tree-ssa-tail-merge.c: Dito.
	* asan.c: Dito.
	* tree.c (iterative_hash_hashval_t): Move to ...
	(iterative_hash_host_wide_int): Move to ...
	* inchash.c: Here. New file.
	* tree.h (iterative_hash_hashval_t): Move to ...
	(iterative_hash_host_wide_int): Move to ...
	* inchash.h: Here. New file.

gcc/lto/:

2014-07-25  Andi Kleen  <ak@linux.intel.com>

	* lto.c: Include inchash.h

From-SVN: r213054
2014-07-25 13:39:05 +00:00
Jan Hubicka ad115a3c32 tree.c (tree_code_size): Add TRANSLATION_UNIT_DECL, NAMESPACE_DECL, IMPORTED_DECL and NAMELIST_DECL...
* tree.c (tree_code_size): Add TRANSLATION_UNIT_DECL,
	NAMESPACE_DECL, IMPORTED_DECL and NAMELIST_DECL;
	call langhook for unknown declaration.
	(find_decls_types_r): Do not walk DECL_ARGUMENT_FLD.
	* tree.h (DECL_ARGUMENTS): Update.
	* print-tree.c (print_node): Update.
	* tree-core.h (tree_decl_non_common): Remove arguments.
	(tree_function_decl): Add arguments.

	* class.c (build_clone): Do not clear assembler names of
	templates.
	* decl.c (cp_tree_node_structure): Add TEMPLATE_DECL.
	* cp-objcp-common.c (cp_tree_size): Add TEMPLATE_DECL
	as a special case return sizeof (struct tree_decl_non_common)
	for other decls.
	(cp_common_init_ts): Do not initialize NAMESPACE_DECL;
	initialize TEMPLATE_DECL as MARK_TS_DECL_COMMON.
	* cp/cp-tree.h (tree_template_decl): New structure.
	(cp_tree_node_structure_enum): Add TS_CP_TEMPLATE_DECL.
	(union cp_lang_tree_node): Add template_decl.
	(DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT): Update.

	* lto/lto.c (mentions_vars_p_decl_non_common): Skip
	DECL_ARGUMENT_FLD.
	mentions_vars_p_function): Do DECL_ARGUMENTS.
	(lto_fixup_prevailing_decls): Update.

	* objc-act.c (objc_common_tree_size): New function.
	* objc-act.h (KEYWORD_KEY_NAME, KEYWORD_ARG_NAME): Add type
	checking.
	(INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK): New macro.
	(METHOD_SEL_NAME, METHOD_SEL_ARGS, METHOD_ADD_ARGS,
 	METHOD_ADD_ARGS_ELLIPSIS_P, METHOD_DEFINITION, METHOD_ENCODING,
	METHOD_TYPE_ATTRIBUTES, METHOD_PROPERTY_CONTEXT): Add type checking.
	(METHOD_SEL_ARGS): Use decl_common.size instead of
	decl_non_common.result.
	(PROPERTY_NAME, PROPERTY_GETTER_NAME, PROPERTY_SETTER_NAME,
	PROPERTY_READONLY, PROPERTY_NONATOMIC, PROPERTY_ASSIGN_SEMANTICS,
	PROPERTY_IVAR_NAME, PROPERTY_DYNAMIC, PROPERTY_HAS_NO_GETTER,
	PROPERTY_HAS_NO_SETTER, PROPERTY_OPTIONAL): Add type checking.
	(objc_common_tree_size): Declare.
	* objc/objc-lang.c (LANG_HOOKS_TREE_SIZE): New macro.

From-SVN: r212549
2014-07-15 10:17:32 +00:00
Jan Hubicka 917dd9bf1e lto.c (read_cgraph_and_symbols): Do not push DECL_INIT_IO timevar
* lto.c (read_cgraph_and_symbols): Do not push DECL_INIT_IO
	timevar
	(materialize_cgraph): Do not push GIMPLE_IN timevar.

	* timevar.def (TV_IPA_LTO_DECL_INIT_IO): Remove.
	(TV_IPA_LTO_CTORS_IN, TV_IPA_LTO_CTORS_OUT): New timevar.
	* cgraph.c (cgraph_get_body): Push GIMPLE_IN timevar.
	(varpool_get_constructor): Push CTORS_IN timevar.
	* lto-streamer-out.c (lto_output): Push TV_IPA_LTO_CTORS_OUT
	timevar.

From-SVN: r212479
2014-07-12 09:35:00 +00:00
Jan Hubicka 0b83e68824 vapool.c: Include tree-ssa-alias.h, gimple.h and lto-streamer.h
* vapool.c: Include tree-ssa-alias.h, gimple.h and lto-streamer.h
	(varpool_get_constructor): New function.
	(varpool_ctor_useable_for_folding_p): Break out from ...
	(ctor_for_folding): ... here; use varpool_get_constructor.
	(varpool_assemble_decl): Likewise.
	* lto-streamer.h (struct output_block): Turn cgraph_node
	to symbol filed.
	(lto_input_variable_constructor): Declare.
	* ipa-visibility.c (function_and_variable_visibility): Use
	varpool_get_constructor.
	* cgraph.h (varpool_get_constructor): Declare.
	(varpool_ctor_useable_for_folding_p): New function.
	* lto-streamer-out.c (get_symbol_initial_value): Take encoder
	parameter; return error_mark_node for non-trivial constructors.
	(lto_write_tree_1, DFS_write_tree): UPdate use of
	get_symbol_initial_value.
	(output_function): Update initialization of symbol.
	(output_constructor): New function.
	(copy_function): Rename to ..
	(copy_function_or_variable): ... this one; handle vars too.
	(lto_output): Output variable sections.
	* lto-streamer-in.c (input_constructor): New function.
	(lto_read_body): Rename from ...
	(lto_read_body_or_constructor): ... this one; handle vars
	too.
	(lto_input_variable_constructor): New function.
	* ipa-prop.c (ipa_prop_write_jump_functions,
	ipa_prop_write_all_agg_replacement): Update.
	* lto-cgraph.c (compute_ltrans_boundary): Use it.
	(output_cgraph_opt_summary): Set symbol to NULL.

	* lto-partition.c (add_references_to_partition): Use 
	varpool_ctor_useable_for_folding_p.
	* lto.c (lto_read_in_decl_state): Update sanity check.

From-SVN: r212467
2014-07-11 17:43:44 +00:00
Martin Liska e55637b715 IPA REF alias refactoring
* cgraph.h (iterate_direct_aliases): New function.
	(FOR_EACH_ALIAS): New macro iterates all direct aliases for a node.
	* cgraph.c (cgraph_for_node_thunks_and_aliases): Usage of
	FOR_EACH_ALIAS added.
	(cgraph_for_node_and_aliases): Likewise.
	* cgraphunit.c (assemble_thunks_and_aliases): Likewise.
	* ipa-inline.c (reset_edge_caches): Likewise.
	(update_caller_keys): Likewise.
	* trans-mem.c (ipa_tm_execute): Likewise.
	*varpool.c (varpool_analyze_node): Likewise.
	(varpool_for_node_and_aliases): Likewise.
	* ipa-ref.h (first_alias): New function.
	(last_alias): Likewise.
	(has_aliases_p): Likewise.
	* ipa-ref.c (ipa_ref::remove_reference): Removal function
	is sensitive to IPA_REF_ALIASes.
	* symtab.c (symtab_node::add_reference): Node of IPA_REF_ALIAS type
	are put at the beginning of the list.
	(symtab_node::iterate_direct_aliases): New function.

	* lto-partition.c (add_symbol_to_partition_1): Usage of
	FOR_EACH_ALIAS added.

From-SVN: r212191
2014-07-01 06:45:26 +00:00
Jan Hubicka 010f4e272f revert: tree-streamer-out.c (pack_ts_type_common_value_fields): Stream if type is complete.
Revert:
	* tree-streamer-out.c (pack_ts_type_common_value_fields): Stream if type
	is complete.
	(write_ts_type_common_tree_pointers): Do not stream fields not set for incomplete
	types; do not stream duplicated fields for variants; sanity check that variant
	and type match.
	(write_ts_type_non_common_tree_pointers): Likewise.
	* tree-streamer-in.c (unpack_ts_type_common_value_fields): Mark in TYPE_SIZE whether
	type is complete.
	(lto_input_ts_type_common_tree_pointers): Do same changes as in
	write_ts_type_common_tree_pointers
	(lto_input_ts_type_non_common_tree_pointers): Likewise.

	* lto.c (lto_copy_fields_not_streamed): New function.
	(compare_tree_sccs_1): Do not compare fields shared in between type
	and variant.
	(lto_read_decls): Fixup types first before inserting into hash.

From-SVN: r212179
2014-06-30 22:18:25 +00:00
Andrew Pinski b82fe35410 lto.c (lto_read_decls): Fix comment in comment.
2014-06-28  Andrew Pinski  <apinski@cavium.com>

	* lto.c (lto_read_decls): Fix comment in comment.

From-SVN: r212119
2014-06-28 21:46:07 -07:00
Jan Hubicka 288eeff72b tree-streamer-out.c (pack_ts_type_common_value_fields): Stream if type is complete.
* tree-streamer-out.c (pack_ts_type_common_value_fields): Stream if type
	is complete.
	(write_ts_type_common_tree_pointers): Do not stream fields not set for incomplete
	types; do not stream duplicated fields for variants; sanity check that variant
	and type match.
	(write_ts_type_non_common_tree_pointers): Likewise.
	* tree-streamer-in.c (unpack_ts_type_common_value_fields): Mark in TYPE_SIZE whether
	type is complete.
	(lto_input_ts_type_common_tree_pointers): Do same changes as in
	write_ts_type_common_tree_pointers
	(lto_input_ts_type_non_common_tree_pointers): Likewise.

	* lto.c (lto_copy_fields_not_streamed): New function.
	(compare_tree_sccs_1): Do not compare fields shared in between type
	and variant.
	(lto_read_decls): Fixup types first before inserting into hash.

From-SVN: r212114
2014-06-28 23:40:46 +00:00
Martin Liska e01fa630f7 ChangeLog entry splitted to gcc/ChangeLog and gcc/lto/ChangeLog.
From-SVN: r212029
2014-06-26 13:07:29 +00:00
Jan Hubicka aaf8a23ef3 class.c (check_methods, [...]): Guard VINDEX checks by FUNCTION_DECL check.
* class.c (check_methods, create_vtable_ptr, determine_key_method,
	add_vcall_offset_vtbl_entries_1): Guard VINDEX checks by FUNCTION_DECL check.
	* cp-tree.h (lang_decl_ns): Add ns_using and ns_users.
	(DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): Use lang_decl_ns.
	(DECL_NAMESPACE_ASSOCIATIONS): Use DECL_INITIAL.
	(DECL_TEMPLATE_INSTANTIATIONS): Use DECL_SIZE_UNIT.
	* tree.c (find_decls_types_r): Do not check DECL_VINDEX for TYPE_DECL.
	* tree.h (DECL_VINDEX, DECL_SAVED_TREE): Restrict to DECL_FUNCTION.
	* tree-core.h (tree_decl_non_common): Move saved_tree and vindex...
	(tree_function_decl): ... here.
	* tree-streamer-out.c (write_ts_decl_non_common_tree_pointers): Move
	streaming of vindex to ...
	(write_ts_function_decl_tree_pointers): ... here.

	* tree-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers):
	Do not stream DECL_VINDEX.
	(lto_input_ts_function_decl_tree_pointers): Stream it here.

	* lto.c (mentions_vars_p_decl_non_common): Move DECL_VINDEX check to ..
	(mentions_vars_p_function): ... here.
	(compare_tree_sccs_1): Update VINDEX checks.
	(lto_fixup_prevailing_decls): Likewise.

From-SVN: r211960
2014-06-24 23:14:26 +00:00
Trevor Saunders 1eb68d2d01 add hash_map class
gcc/

	* alloc-pool.c (alloc_pool_hash): Use hash_map instead of hash_table.
	* dominance.c (iterate_fix_dominators): Use hash_map instead of
	pointer_map.
	* hash-map.h: New file.
	* ipa-comdats.c: Use hash_map instead of pointer_map.
	* ipa.c: Likewise.
	* lto-section-out.c: Adjust.
	* lto-streamer.h: Replace pointer_map with hash_map.
	* symtab.c (verify_symtab): Likewise.
	* tree-ssa-strlen.c (decl_to_stridxlist_htab): Likewise.
	* tree-ssa-uncprop.c (val_ssa_equiv): Likewise.
	* tree-streamer.h: Likewise.
	* tree-streamer.c: Adjust.
	* pointer-set.h: Remove pointer_map.

gcc/lto/

	* lto.c (canonical_type_hash_cache): Use hash_map instead of
	pointer_map.

From-SVN: r211938
2014-06-24 13:22:11 +00:00
Trevor Saunders c203e8a73b Remove a layer of indirection from hash_table
gcc/

	* hash-table.h: Remove a layer of indirection from hash_table so that
	it contains the hash table's data instead of a pointer to the data.
	* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
	config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
	config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
	data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
	fold-const.c, gcse.c, ggc-common.c,
	gimple-ssa-strength-reduction.c, gimplify.c,
	graphite-clast-to-gimple.c, graphite-dependences.c,
	graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
	ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
	loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
	lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
	postreload-gcse.c, sese.c, statistics.c, store-motion.c,
	trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
	tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
	tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
	tree-ssa-live.c, tree-ssa-loop-im.c,
	tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
	tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
	tree-ssa-structalias.c, tree-ssa-tail-merge.c,
	tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.

gcc/c/

	* c-decl.c: Adjust.

gcc/cp/

	* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
	Adjust.

gcc/java/

	* jcf-io.c: Adjust.

gcc/lto/

	* lto.c: Adjust.

gcc/objc/

	* objc-act.c: Adjust.

From-SVN: r211936
2014-06-24 13:21:35 +00:00
Jan Hubicka 714c800f1f cgraph.h (tls_model_names): New variable.
* cgraph.h (tls_model_names): New variable.
	* print-tree.c (print_node): Simplify.
	* varpool.c (tls_model_names): New variable.
	(dump_varpool_node): Output tls model.

	* lto-symtab.c (lto_varpool_replace_node): Report TLS model conflicts.

From-SVN: r211865
2014-06-21 02:46:34 +00:00
Jan Hubicka 569b1784fe cgraph.h (struct symtab_node): Add field in_init_priority_hash (set_init_priority...
* cgraph.h (struct symtab_node): Add field in_init_priority_hash
	(set_init_priority, get_init_priority, set_fini_priority,
	get_fini_priority): New methods.
	* tree.c (init_priority_for_decl): Remove.
	(init_ttree): Do not initialize init priority.
	(decl_init_priority_lookup, decl_fini_priority_lookup): Rewrite.
	(decl_priority_info): Remove.
	(decl_init_priority_insert): Rewrite.
	(decl_fini_priority_insert): Rewrite.
	* tree.h (tree_priority_map_eq, tree_priority_map_hash,
	tree_priority_map_marked_p): Remove.
	* lto-cgraph.c (lto_output_node, input_node): Stream init priorities.
	* lto-streamer-out.c (hash_tree): Do not hash priorities.
	* tree-streamer-out.c (pack_ts_decl_with_vis_value_fields): Do
	not output priorities.
	(pack_ts_function_decl_value_fields): Likewise.
	* tree-streamer-in.c (unpack_ts_decl_with_vis_value_fields): Do
	not input priorities.
	(unpack_ts_function_decl_value_fields): Likewise.
	* symtab.c (symbol_priority_map): Declare.
	(init_priority_hash): Declare.
	(symtab_unregister_node): Unregister from priority hash, too.
	(symtab_node::get_init_priority, cgraph_node::get_fini_priority):
	New methods.
	(symbol_priority_map_eq, symbol_priority_map_hash): New functions.
	(symbol_priority_info): New function.
	(symtab_node::set_init_priority, cgraph_node::set_fini_priority):
	New methods.
	* tree-core.h (tree_priority_map): Remove.

	* lto.c (compare_tree_sccs_1): Do not compare priorities.

From-SVN: r211838
2014-06-20 07:09:27 +00:00
Jan Hubicka 56363ffd48 c-common.c (handle_tls_model_attribute): Use set_decl_tls_model.
* c-family/c-common.c (handle_tls_model_attribute): Use set_decl_tls_model.
	* cgraph.h (struct varpool_node): Add tls_model.
	* tree.c (decl_tls_model, set_decl_tls_model): New functions.
	* tree.h (DECL_TLS_MODEL): Update.
	(DECL_THREAD_LOCAL_P): Check that variable is static.
	(decl_tls_model): Declare.
	(set_decl_tls_model): Declare.
	* tree-emutls.c (get_emutls_init_templ_addr): First build decl and then
	set symbol prorperties.
	(get_emutls_init_templ_addr): Cleanup.
	(new_emutls_decl): Update.
	* lto-cgraph.c (lto_output_varpool_node): Stream TLS model
	(lto_input_varpool_node): Likewise.
	* lto-streamer-out.c (hash_tree): Likewise.
	* tree-streamer-in.c (unpack_ts_decl_with_vis_value_fields): Do
	not stream DECL_TLS_MODEL.
	* tree-profile.c (init_ic_make_global_vars): Use
	set_decl_tls_model.
	* tree-core.h (tree_decl_with_vis): Remove tls_model;
	update comments.

	* c-parser.c (c_parser_omp_threadprivate): Likewise.
	* c-decl.c (merge_decls): Likewise.

	* decl.c (duplicate_decls): Use set_decl_tls_model.
	(grokdeclarator): Likewise.
	* semantics.c (finish_id_expression): Check TLS only for
	static variables.
	(finish_omp_threadprivate): Use decl_default_tls_model.
	* decl2.c (get_guard): Likewise.
	* call.c (make_temporary_var_for_ref_to_temp): Likewise.

	* gcc-interface/utils.c (process_attributes): Use
	set_decl_tls_model.

	* trans-common.c (build_common_decl): Use
	set_decl_tls_model.
	* trans-decl.c (gfc_finish_var_decl): Likewise.
	(get_proc_pointer_decl): Likewise.

	* lto.c (compare_tree_sccs_1): Do not compare DECL_TLS_MODEL.

From-SVN: r211689
2014-06-15 23:38:29 +00:00
Jan Hubicka e257a17cb9 varasm.c (set_implicit_section): New function.
* varasm.c (set_implicit_section): New function.
	(resolve_unique_section): Use it to set implicit section
	for aliases, too.
	(get_named_text_section): Use symtab_get_node (decl)->implicit_section
	(default_function_section): Likewise.
	(decl_binds_to_current_def_p): Constify argument.
	* varasm.h (decl_binds_to_current_def_p): Update prototype.
	* asan.c (asan_protect_global): Use symtab_get_node (decl)->implicit_section.
	* symtab.c (dump_symtab_base): Dump implicit sections.
	(verify_symtab_base): Verify sanity of sectoins and comdats.
	(symtab_resolve_alias): Alias share the section of its target.
	(set_section_1): New function.
	(symtab_node::set_section): Move here, recurse to aliases.
	(verify_symtab): Check for duplicated symtab lists.
	* tree-core.h (implicit_section_name_p): Remove.
	* tree-vect-data-refs.c: Include varasm.h.
	(vect_can_force_dr_alignment_p): Fix conditional on when
	decl bints to current definition; use
	symtab_get_node (decl)->implicit_section.
	* cgraph.c (cgraph_make_node_local_1): Fix section set.
	* cgraph.h (struct symtab_node): Add implicit_section.
	(set_section): Rename to ...
	(set_section_for_node): ... this one.
	(set_section): Declare.
	* tree.h (DECL_HAS_IMPLICIT_SECTION_NAME_P): Remove.
	* lto-cgraph.c (lto_output_node, lto_output_varpool_node,
	input_overwrite_node, input_varpool_node): Stream implicit_section.
	* ipa.c (symtab_remove_unreachable_nodes): Do not check symtab before
	removal; it will fail in LTO.
	
	* vtable-class-hierarchy.c: Use symtab_get_node (var_decl)->implicit_section.
	* optimize.c (cdtor_comdat_group): Fix handling of aliases.
	(maybe_clone_body): Move symbol across comdat groups.
	* method.c (use_thunk): Copy implicit section flag.

	* go/go-gcc.cc (Gcc_backend::global_variable_set_init): Use
	symtab_get_node(var_decl)->implicit_section.

	* lto.c (read_cgraph_and_symbols): Remove unreachable symbols.
	(do_whole_program_analysis): Use verify_symtab.

From-SVN: r211434
2014-06-11 05:51:23 +00:00
Jan Hubicka 24d047a30a symtab.c (dump_symtab_base): Update dumping.
* symtab.c (dump_symtab_base): Update dumping.
	(symtab_make_decl_local): Clear only DECL_COMDAT.
	* tree-vect-data-refs.c (Check that variable is static before
	tampering with sections.
	* cgraphclones.c (duplicate_thunk_for_node): Do not clear section name.
	(cgraph_create_virtual_clone): Likewise.
	* tree.c (decl_comdat_group, decl_comdat_group_id): Constify argument.
	(decl_section_name, set_decl_section_name): New accessors.
	(find_decls_types_r): Do not walk section name
	* tree.h (DECL_SECTION_NAME): Implement using
	decl_section_name.
	(decl_comdat_group, decl_comdat_group_id): Constify.
	(decl_section_name, set_decl_section_name): Update.
	* varpool.c (varpool_finalize_named_section_flags): Use
	get_section.
	* cgraph.c (cgraph_add_thunk): Reset node instead of rebuilding.
	(cgraph_make_node_local_1): Clear section and comdat group.
	* cgraph.h (set_comdat_group): Sanity check.
	(get_section, set_section): New.
	* ipa-comdats.c (ipa_comdats): Use get_section.
	* ipa.c (ipa_discover_readonly_nonaddressable_var): Likewise.
	* lto-streamer-out.c: Do not follow section names.
	* c-family/c-common.c (handle_section_attribute):
	Update.
	* lto-cgraph.c (lto_output_node): Output section.
	(lto_output_varpool_node): Likewise.
	(read_comdat_group): Rename to ...
	(read_identifier): ... this one.
	(read_string_cst): New function.
	(input_node, input_varpool_node): Input section names.
	* tree-emutls.c (get_emutls_init_templ_addr): Update.
	(new_emutls_decl): Update.
	(secname_for_decl): Check section names only of static
	vars.
	* config/mep/mep.c (mep_unique_section): Use set_decl_section_name.
	* config/i386/winnt.c (i386_pe_unique_section): Likewise.
	* config/i386/i386.c (x86_64_elf_unique_section): Likewise.
	* config/c6x/c6x.c (c6x_elf_unique_section): Likewise.
	* config/rs6000/rs6000.c (rs6000_xcoff_unique_section): Likewise.
	* config/mcore/mcore.c (mcore_unique_section): Likewise.
	* config/mips/mips.c (mips16_build_function_stub): Likewise.
	* config/v850/v850.c (v850_insert_attributes): Likewise.
	* config/h8300/h8300.c: (h8300_handle_eightbit_data_attribute):
	Likewise.
	(h8300_handle_tiny_data_attribute): Likewise.
	* config/bfin/bfin.c (bfin_handle_l1_text_attribute): Likewise.
	(bfin_handle_l2_attribute): Likewise.
	* tree-streamer-in.c (lto_input_ts_decl_with_vis_tree_pointers): Do not read section name.

	* lto.c (mentions_vars_p_decl_with_vis, compare_tree_sccs_1,
	lto_fixup_prevailing_decls): Skip section names.

	* go-gcc.cc (global_variable_set_init): Use
	set_decl_section_name.

	* gcc-interface/utils.c (process_attributes): Use it.

	* c-decl.c (merge_decls): Use set_decl_section_name.
	(duplicate_decls): Remove node if it exists.

	* class.c (build_utf8_ref): Use set_decl_section_name.
	(emit_register_classes_in_jcr_section): Likewise.
	(emit_register_classes_in_jcr_section): Likewise.

	* method.c (use_thunk): Use set_decl_section_name.
	* optimize.c (maybe_clone_body): Use set_decl_section_name.
	* decl.c (duplicate_decls): Likewise.
	* vtable-class-hierarchy.c: Likewise.

From-SVN: r211363
2014-06-09 02:30:30 +00:00
Andrew MacLeod 9b2b72791e expr.h: Remove prototypes of functions defined in builtins.c.
* expr.h: Remove prototypes of functions defined in builtins.c.
	* tree.h: (build_call_expr_*, build_string_literal): Add prototypes.
	Remove prototypes of functions defined in builtins.c.
	* builtins.h: Update prototype list to include all exported functions.
	* builtins.c: (default_libc_has_function, gnu_libc_has_function,
	no_c99_libc_has_function): Move to targhooks.c
	(build_string_literal, build_call_expr_loc_array,
	build_call_expr_loc_vec, build_call_expr_loc, build_call_expr): Move
	to tree.c.
	(expand_builtin_object_size, fold_builtin_object_size): Make static.
	* targhooks.c (default_libc_has_function, gnu_libc_has_function,
	no_c99_libc_has_function): Relocate from builtins.c.
	* tree.c: Include builtins.h.
	(build_call_expr_loc_array, build_call_expr_loc_vec,
	build_call_expr_loc, build_call_expr, build_string_literal): Relocate
	from builtins.c.
	* fold-const.h (fold_fma): Move prototype to builtins.h.
	* realmpfr.h (do_mpc_arg2): Move prototype to builtins.h.

	* fortran/trans.c (trans_runtime_error_vararg): Call
	fold_build_call_array_loc instead of fold_builtin_call_array.

	* asan.c: Include builtins.h.
	* cfgexpand.c: Likewise.
	* convert.c: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* fold-const.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimplify.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-prop.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* stmt.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-stmts.c: Likewise.

	c
	* c-decl.c: Include builtins.h.
	* c-parser.c: Likewise.

	cp
	* decl.c: Include builtins.h.
	* semantics.c: Likewise.

	go
	* go-gcc.cc: Include builtins.h.

	lto
	* lto-symtab.c: Include builtins.h.

	config
	* aarch64/aarch64.c: Include builtins.h.
	* alpha/alpha.c: Likewise.
	* arc/arc.c: Likewise.
	* arm/arm.c: Likewise.
	* avr/avr.c: Likewise.
	* bfin/bfin.c: Likewise.
	* c6x/c6x.c: Likewise.
	* cr16/cr16.c: Likewise.
	* cris/cris.c: Likewise.
	* epiphany/epiphany.c: Likewise.
	* fr30/fr30.c: Likewise.
	* frv/frv.c: Likewise.
	* h8300/h8300.c: Likewise.
	* i386/i386.c: Likewise.
	* i386/winnt.c: Likewise.
	* ia64/ia64.c: Likewise.
	* iq2000/iq2000.c: Likewise.
	* lm32/lm32.c: Likewise.
	* m32c/m32c.c: Likewise.
	* m32r/m32r.c: Likewise.
	* m68k/m68k.c: Likewise.
	* mcore/mcore.c: Likewise.
	* mep/mep.c: Likewise.
	* microblaze/microblaze.c: Likewise.
	* mips/mips.c: Likewise.
	* mmix/mmix.c: Likewise.
	* mn10300/mn10300.c: Likewise.
	* moxie/moxie.c: Likewise.
	* msp430/msp430.c: Likewise.
	* nds32/nds32.c: Likewise.
	* pa/pa.c: Likewise.
	* pdp11/pdp11.c: Likewise.
	* picochip/picochip.c: Likewise.
	* rl78/rl78.c: Likewise.
	* rs6000/rs6000.c: Likewise.
	* rx/rx.c: Likewise.
	* s390/s390.c: Likewise.
	* score/score.c: Likewise.
	* sh/sh.c: Likewise.
	* sparc/sparc.c: Likewise.
	* spu/spu.c: Likewise.
	* stormy16/stormy16.c: Likewise.
	* tilegx/tilegx.c: Likewise.
	* tilepro/tilepro.c: Likewise.
	* v850/v850.c: Likewise.
	* vax/vax.c: Likewise.
	* xtensa/xtensa.c: Likewise.

From-SVN: r211145
2014-06-02 20:13:44 +00:00
Richard Biener a9243bfced system.h: Define __STDC_FORMAT_MACROS before including inttypes.h.
2014-05-23  Richard Biener  <rguenther@suse.de>

	* system.h: Define __STDC_FORMAT_MACROS before
	including inttypes.h.
	* hwint.h (HOST_WIDEST_INT, HOST_BITS_PER_WIDEST_INT,
	HOST_WIDEST_INT_PRINT, HOST_WIDEST_INT_PRINT_DEC,
	HOST_WIDEST_INT_PRINT_DEC_C, HOST_WIDEST_INT_PRINT_UNSIGNED,
	HOST_WIDEST_INT_PRINT_HEX, HOST_WIDEST_INT_PRINT_DOUBLE_HEX,
	HOST_WIDEST_INT_C): Remove.
	(PRId64, PRIi64, PRIo64, PRIu64, PRIx64, PRIX64): Define
	if C99 inttypes.h is not available.

	* coretypes.h (gcov_type, gcov_type_unsigned): Use [u]int64_t.
	* gcov-io.h (gcov_type, gcov_type_unsigned): Likewise.
	* gcov-io.c (gcov_histo_index): Drop non-64bit hwi case.
	* cfgloop.h (struct niter_desc): Use uint64_t for niter field.
	* bitmap.c (struct bitmap_descriptor_d): Use uint64_t for counters.
	(struct output_info): Likewise.
	(print_statistics): Adjust.
	(dump_bitmap_statistics): Likewise.
	* bt-load.c (migrate_btr_defs): Print with PRId64.
	* cfg.c (dump_edge_info, dump_bb_info): Likewise.
	(MAX_SAFE_MULTIPLIER): Adjust.
	* cfghooks.c (dump_bb_for_graph): Print with PRId64.
	* cgraph.c (cgraph_redirect_edge_call_stmt_to_callee,
	dump_cgraph_node): Likewise.
	* final.c (dump_basic_block_info): Likewise.
	* gcov-dump.c (tag_counters, tag_summary, dump_working_sets): Likewise.
	* gcov.c (format_gcov): Likewise.
	* ipa-cp.c (good_cloning_opportunity_p): Likewise.  Use int64_t
	for calculation.
	(get_clone_agg_value): Use HOST_WIDE_INT for offset.
	* ipa-inline.c (compute_max_insns): Use int64_t for calcuation.
	(inline_small_functions, dump_overall_stats, dump_inline_stats):
	Use PRId64 for dumping.
	* ipa-profile.c (dump_histogram, ipa_profile): Likewise.
	* ira-color.c (struct allocno_hard_regs): Use int64_t for cost.
	(add_allocno_hard_regs): Adjust.
	* loop-doloop.c (doloop_modify): Print using PRId64.
	* loop-iv.c (inverse): Compute in uint64_t.
	(determine_max_iter, iv_number_of_iterations): Likewise.
	* loop-unroll.c (decide_peel_completely, decide_peel_simple):
	Print using PRId64.
	* lto-streamer-out.c (write_symbol): Use uint64_t.
	* mcf.c (CAP_INFINITY): Use int64_t maximum.
	(dump_fixup_edge, create_fixup_graph, cancel_negative_cycle,
	find_max_flow, adjust_cfg_counts): Use int64_t and dump with PRId64.
	* modulo-sched.c (const_iteration_count): Use int64_t.
	(sms_schedule): Dump using PRId64.
	* predict.c (dump_prediction): Likewise.
	* pretty-print.h (pp_widest_integer): Remove.
	* profile.c (get_working_sets, is_edge_inconsistent,
	is_inconsistent, read_profile_edge_counts): Dump using PRId64.
	* tree-pretty-print.c (pp_double_int): Remove case handling
	HOST_BITS_PER_DOUBLE_INT == HOST_BITS_PER_WIDEST_INT.
	* tree-ssa-math-opts.c (struct symbolic_number): Use uint64_t
	and adjust users.
	(pass_optimize_bswap::execute): Remove restriction on hosts.
	* tree-streamer-in.c (streamer_alloc_tree): Use HOST_WIDE_INT.
	* tree-streamer-out.c (streamer_write_tree_header): Likewise.
	* tree.c (widest_int_cst_value): Remove.
	* tree.h (widest_int_cst_value): Likewise.
	* value-prof.c (dump_histogram_value): Print using PRId64.
	* gengtype.c (main): Also inject int64_t.
	* ggc-page.c (struct max_alignment): Use int64_t.
	* alloc-pool.c (struct allocation_object_def): Likewise.
	* ira-conflicts.c (build_conflict_bit_table): Use uint64_t
	for computation.
	* doc/tm.texi.in: Remove reference to HOST_WIDEST_INT.
	* doc/tm.texi: Regenerated.
	* gengtype-lex.l (IWORD): Handle [u]int64_t.
	* config/sh/sh.c (expand_cbranchdi4): Use gcov_type.
	* config/mmix/mmix-protos.h (mmix_intval, mmix_shiftable_wyde_value,
	mmix_output_register_setting): Use [u]int64_t in prototypes.
	* config/mmix/mmix.c (mmix_print_operand, mmix_output_register_setting,
	mmix_shiftable_wyde_value, mmix_output_shiftvalue_op_from_str,
	mmix_output_octa, mmix_output_shifted_value): Adjust.
	(mmix_intval): Adjust.  Remove unreachable case.
	* config/mmix/mmix.md (*nonlocal_goto_receiver_expanded): Use
	int64_t.

	lto/
	* lto.c (lto_parse_hex): Use int64_t.
	(lto_resolution_read): Likewise.

From-SVN: r210931
2014-05-26 10:42:43 +00:00
Jan Hubicka fd1e930270 ggc.h (ggc_grow): New function.
* ggc.h (ggc_grow): New function.
	* ggc-none.c (ggc_grow): New function.
	* ggc-page.c (ggc_grow): Likewise.
	* lto.c (read_cgraph_and_symbols): Grow ggc memory after streaming.

From-SVN: r210908
2014-05-25 02:58:54 +00:00
Jan Hubicka aede2c10ca tree-core.h (tree_decl_with_vis): Replace comdat_group by symtab_node pointer.
* tree-core.h (tree_decl_with_vis): Replace comdat_group by
	symtab_node pointer.
	* tree.c (copy_node_stat): Be sure tonot copy
	symtab_node pointer.
	(find_decls_types_r): Do not walk COMDAT_GROUP.
	* tree.h (DECL_COMDAT_GROUP): Revamp to use decl_comdat_group.
	* varasm.c (make_decl_one_only): Use set_comdat_group;
	create node if needed.
	* ipa-inline-transform.c (save_inline_function_body): Update
	way we decl->symtab mapping.
	* symtab.c (symtab_hash, hash_node, eq_node
	symtab_insert_node_to_hashtable): Remove.
	(symtab_register_node): Update.
	(symtab_unregister_node): Update.
	(symtab_get_node): Reimplement as inline function.
	(symtab_add_to_same_comdat_group): Update.
	(symtab_dissolve_same_comdat_group_list): Update.
	(dump_symtab_base): Update.
	(verify_symtab_base): Update.
	(symtab_make_decl_local): Update.
	(fixup_same_cpp_alias_visibility): Update.
	(symtab_nonoverwritable_alias): Update.
	* cgraphclones.c (set_new_clone_decl_and_node_flags): Update.
	* ipa.c (update_visibility_by_resolution_info): UPdate.
	* bb-reorder.c: Include cgraph.h
	* lto-streamer-out.c (DFS_write_tree_body, hash_tree): Do not deal
	with comdat groups.
	* ipa-comdats.c (set_comdat_group, ipa_comdats): Update.
	* cgraph.c (cgraph_get_create_node): Update.
	* cgraph.h (struct symtab_node): Add get_comdat_group, set_comdat_group
	and comdat_group_.
	(symtab_get_node): Make inline.
	(symtab_insert_node_to_hashtable): Remove.
	(symtab_can_be_discarded): Update.
	(decl_comdat_group): New function.
	* tree-streamer-in.c (lto_input_ts_decl_with_vis_tree_pointers): Update.
	* lto-cgraph.c (lto_output_node, lto_output_varpool_node): Stream out
	comdat group name.
	(read_comdat_group): New function.
	(input_node, input_varpool_node): Use it.
	* trans-mem.c (ipa_tm_create_version_alias): Update code creating
	comdat groups.
	* mips.c (mips_start_unique_function): Likewise.
	(ix86_code_end): Likewise.
	(rs6000_code_end): Likweise.
	* tree-streamer-out.c (DECL_COMDAT_GROUP): Do not stream
	comdat group.

	* lto-symtab.c (lto_symtab_merge_symbols): Update code setting
	symtab pointer.
	* lto.c (compare_tree_sccs_1): Do not compare comdat groups.

	* optmize.c (maybe_thunk_body): Use set_comdat_group.
	(maybe_clone_body): Likewise.
	* decl.c (duplicate_decls): Update code duplicating comdat group;
	do not copy symtab pointer; before freeing newdecl remove it
	from symtab.
	* decl2.c (constrain_visibility): Use set_comdat_group.

	* c-decl.c (merge_decls): Preserve symtab node pointers.
	(duplicate_decls): Free new decl.

From-SVN: r210901
2014-05-24 22:00:14 +00:00
Thomas Schwinge f6a7cffce1 Cosmetic fixes for DEF_FUNCTION_TYPE_* macros.
gcc/ada/
	* gcc-interface/utils.c (DEF_FUNCTION_TYPE_0, DEF_FUNCTION_TYPE_6)
	(DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_8)
	(DEF_FUNCTION_TYPE_VAR_5): Cosmetic fixes.
	gcc/
	* builtin-types.def: Simplify examples for DEF_FUNCTION_TYPE_*.
	gcc/c-family/
	* c-common.c (DEF_FUNCTION_TYPE_0, DEF_FUNCTION_TYPE_6)
	(DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_8)
	(DEF_FUNCTION_TYPE_VAR_5): Cosmetic fixes.
	gcc/fortran/
	* f95-lang.c (DEF_FUNCTION_TYPE_0, DEF_FUNCTION_TYPE_6)
	(DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_8)
	(DEF_FUNCTION_TYPE_VAR_5): Cosmetic fixes.
	* types.def: Simplify examples for DEF_FUNCTION_TYPE_*.
	gcc/lto/
	* lto-lang.c (DEF_FUNCTION_TYPE_0, DEF_FUNCTION_TYPE_6)
	(DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_8)
	(DEF_FUNCTION_TYPE_VAR_5): Cosmetic fixes.

From-SVN: r210822
2014-05-22 22:16:07 +02:00
Bernd Schmidt 4000360e40 Create a new header lto-section-names.h
gcc/
        * config/darwin.c: Include "lto-section-names.h".
        (LTO_SEGMENT_NAME): Don't define.
        * config/i386/winnt.c: Include "lto-section-names.h".
        * lto-streamer.c: Include "lto-section-names.h".
        * lto-streamer.h (LTO_SECTION_NAME_PREFIX): Don't define.
        * lto-wrapper.c: Include "lto-section-names.h".
        (LTO_SECTION_NAME_PREFIX): Don't define.
        * lto-section-names.h: New file.
        * cgraphunit.c: Include "lto-section-names.h".

        gcc/lto/
        * lto-object.c: Include "lto-section-names.h".
        (LTO_SEGMENT_NAME): Don't define.
        * lto.c: Include "lto-section-names.h".

From-SVN: r210819
2014-05-22 16:21:18 +00:00
Jan Hubicka b95591361e re PR lto/61012 (lto1: errors during merging of translation units (error: variable ‘link’ redeclared as function))
PR lto/61012
	* lto-symtab.c (lto_symtab_merge_decls_1): Do not ICE on undefined externals
	mixed with variables.

From-SVN: r210740
2014-05-22 05:38:04 +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
Kenneth Zadeck 1d60af0867 Update ChangeLogs for wide-int work.
Co-Authored-By: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Co-Authored-By: Mike Stump <mikestump@comcast.net>
Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com>

From-SVN: r210116
2014-05-06 16:35:35 +00:00
Richard Biener 22869a37b0 re PR middle-end/60092 (posix_memalign not recognized to derive alias and alignment info)
2014-04-28  Richard Biener  <rguenther@suse.de>

	PR middle-end/60092
	* builtins.def (DEF_C11_BUILTIN): Add.
	(BUILT_IN_ALIGNED_ALLOC): Likewise.
	* coretypes.h (enum function_class): Add function_c11_misc.
	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Handle
	BUILT_IN_ALIGNED_ALLOC like BUILT_IN_MALLOC.
	(call_may_clobber_ref_p_1): Likewise.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise.
	(mark_all_reaching_defs_necessary_1): Likewise.
	(propagate_necessity): Likewise.
	(eliminate_unnecessary_stmts): Likewise.
	* tree-ssa-ccp.c (evaluate_stmt): Handle BUILT_IN_ALIGNED_ALLOC.

	ada/
	* gcc-interface/utils.c: Define flag_isoc11.

	lto/
	* lto-lang.c: Define flag_isoc11.

	* gcc.dg/tree-ssa/alias-32.c: New testcase.
	* gcc.dg/vect/pr60092.c: Likewise.

From-SVN: r209863
2014-04-28 14:36:13 +00:00
David Malcolm 7de90a6c27 Change is-a.h to support typedefs of pointers
gcc/
	* is-a.h: Update comments to reflect the following changes to the
	"pointerness" of the API, making the template parameter match the
	return type, allowing use of is-a.h with typedefs of pointers.
	(is_a_helper::cast): Return a T rather then a pointer to a T, so
	that the return type matches the parameter to the is_a_helper.
	(as_a): Likewise.
	(dyn_cast): Likewise.

	* cgraph.c (cgraph_node_for_asm): Update for removal of implicit
	pointer from the is-a.h API.

	* cgraph.h (is_a_helper <cgraph_node>::test): Convert to...
	(is_a_helper <cgraph_node *>::test): ...this, matching change to
	is-a.h API.
	(is_a_helper <varpool_node>::test): Likewise, convert to...
	(is_a_helper <varpool_node *>::test): ...this.

	(varpool_first_variable): Update for removal of implicit pointer
	from the is-a.h API.
	(varpool_next_variable): Likewise.
	(varpool_first_static_initializer): Likewise.
	(varpool_next_static_initializer): Likewise.
	(varpool_first_defined_variable): Likewise.
	(varpool_next_defined_variable): Likewise.
	(cgraph_first_defined_function): Likewise.
	(cgraph_next_defined_function): Likewise.
	(cgraph_first_function): Likewise.
	(cgraph_next_function): Likewise.
	(cgraph_first_function_with_gimple_body): Likewise.
	(cgraph_next_function_with_gimple_body): Likewise.
	(cgraph_alias_target): Likewise.
	(varpool_alias_target): Likewise.
	(cgraph_function_or_thunk_node): Likewise.
	(varpool_variable_node): Likewise.
	(symtab_real_symbol_p): Likewise.
	* cgraphunit.c (referred_to_p): Likewise.
	(analyze_functions): Likewise.
	(handle_alias_pairs): Likewise.
	* gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise.
	* gimple-ssa.h (gimple_vuse_op): Likewise.
	(gimple_vdef_op): Likewise.
	* gimple-streamer-in.c (input_gimple_stmt): Likewise.
	* gimple.c (gimple_build_asm_1): Likewise.
	(gimple_build_try): Likewise.
	(gimple_build_resx): Likewise.
	(gimple_build_eh_dispatch): Likewise.
	(gimple_build_omp_for): Likewise.
	(gimple_omp_for_set_clauses): Likewise.

	* gimple.h (is_a_helper <gimple_statement_asm>::test): Convert to...
	(is_a_helper <gimple_statement_asm *>::test): ...this.
	(is_a_helper <gimple_statement_bind>::test): Convert to...
	(is_a_helper <gimple_statement_bind *>::test): ...this.
	(is_a_helper <gimple_statement_call>::test): Convert to...
	(is_a_helper <gimple_statement_call *>::test): ...this.
	(is_a_helper <gimple_statement_catch>::test): Convert to...
	(is_a_helper <gimple_statement_catch *>::test): ...this.
	(is_a_helper <gimple_statement_resx>::test): Convert to...
	(is_a_helper <gimple_statement_resx *>::test): ...this.
	(is_a_helper <gimple_statement_eh_dispatch>::test): Convert to...
	(is_a_helper <gimple_statement_eh_dispatch *>::test): ...this.
	(is_a_helper <gimple_statement_eh_else>::test): Convert to...
	(is_a_helper <gimple_statement_eh_else *>::test): ...this.
	(is_a_helper <gimple_statement_eh_filter>::test): Convert to...
	(is_a_helper <gimple_statement_eh_filter *>::test): ...this.
	(is_a_helper <gimple_statement_eh_mnt>::test): Convert to...
	(is_a_helper <gimple_statement_eh_mnt *>::test): ...this.
	(is_a_helper <gimple_statement_omp_atomic_load>::test): Convert to...
	(is_a_helper <gimple_statement_omp_atomic_load *>::test): ...this.
	(is_a_helper <gimple_statement_omp_atomic_store>::test): Convert to...
	(is_a_helper <gimple_statement_omp_atomic_store *>::test): ...this.
	(is_a_helper <gimple_statement_omp_return>::test): Convert to...
	(is_a_helper <gimple_statement_omp_return *>::test): ...this.
	(is_a_helper <gimple_statement_omp_continue>::test): Convert to...
	(is_a_helper <gimple_statement_omp_continue *>::test): ...this.
	(is_a_helper <gimple_statement_omp_critical>::test): Convert to...
	(is_a_helper <gimple_statement_omp_critical *>::test): ...this.
	(is_a_helper <gimple_statement_omp_for>::test): Convert to...
	(is_a_helper <gimple_statement_omp_for *>::test): ...this.
	(is_a_helper <gimple_statement_omp_taskreg>::test): Convert to...
	(is_a_helper <gimple_statement_omp_taskreg *>::test): ...this.
	(is_a_helper <gimple_statement_omp_parallel>::test): Convert to...
	(is_a_helper <gimple_statement_omp_parallel *>::test): ...this.
	(is_a_helper <gimple_statement_omp_target>::test): Convert to...
	(is_a_helper <gimple_statement_omp_target *>::test): ...this.
	(is_a_helper <gimple_statement_omp_sections>::test): Convert to...
	(is_a_helper <gimple_statement_omp_sections *>::test): ...this.
	(is_a_helper <gimple_statement_omp_single>::test): Convert to...
	(is_a_helper <gimple_statement_omp_single *>::test): ...this.
	(is_a_helper <gimple_statement_omp_teams>::test): Convert to...
	(is_a_helper <gimple_statement_omp_teams *>::test): ...this.
	(is_a_helper <gimple_statement_omp_task>::test): Convert to...
	(is_a_helper <gimple_statement_omp_task *>::test): ...this.
	(is_a_helper <gimple_statement_phi>::test): Convert to...
	(is_a_helper <gimple_statement_phi *>::test): ...this.
	(is_a_helper <gimple_statement_transaction>::test): Convert to...
	(is_a_helper <gimple_statement_transaction *>::test): ...this.
	(is_a_helper <gimple_statement_try>::test): Convert to...
	(is_a_helper <gimple_statement_try *>::test): ...this.
	(is_a_helper <gimple_statement_wce>::test): Convert to...
	(is_a_helper <gimple_statement_wce *>::test): ...this.
	(is_a_helper <const gimple_statement_asm>::test): Convert to...
	(is_a_helper <const gimple_statement_asm *>::test): ...this.
	(is_a_helper <const gimple_statement_bind>::test): Convert to...
	(is_a_helper <const gimple_statement_bind *>::test): ...this.
	(is_a_helper <const gimple_statement_call>::test): Convert to...
	(is_a_helper <const gimple_statement_call *>::test): ...this.
	(is_a_helper <const gimple_statement_catch>::test): Convert to...
	(is_a_helper <const gimple_statement_catch *>::test): ...this.
	(is_a_helper <const gimple_statement_resx>::test): Convert to...
	(is_a_helper <const gimple_statement_resx *>::test): ...this.
	(is_a_helper <const gimple_statement_eh_dispatch>::test):
	Convert to...
	(is_a_helper <const gimple_statement_eh_dispatch *>::test):
	...this.
	(is_a_helper <const gimple_statement_eh_filter>::test): Convert
	to...
	(is_a_helper <const gimple_statement_eh_filter *>::test): ...this.
	(is_a_helper <const gimple_statement_omp_atomic_load>::test):
	Convert to...
	(is_a_helper <const gimple_statement_omp_atomic_load *>::test):
	...this.
	(is_a_helper <const gimple_statement_omp_atomic_store>::test):
	Convert to...
	(is_a_helper <const gimple_statement_omp_atomic_store *>::test):
	...this.
	(is_a_helper <const gimple_statement_omp_return>::test): Convert
	to...
	(is_a_helper <const gimple_statement_omp_return *>::test): ...this.
	(is_a_helper <const gimple_statement_omp_continue>::test): Convert
	to...
	(is_a_helper <const gimple_statement_omp_continue *>::test): ...this.
	(is_a_helper <const gimple_statement_omp_critical>::test): Convert
	to...
	(is_a_helper <const gimple_statement_omp_critical *>::test): ...this.
	(is_a_helper <const gimple_statement_omp_for>::test): Convert to...
	(is_a_helper <const gimple_statement_omp_for *>::test): ...this.
	(is_a_helper <const gimple_statement_omp_taskreg>::test): Convert
	to...
	(is_a_helper <const gimple_statement_omp_taskreg *>::test): ...this.
	(is_a_helper <const gimple_statement_omp_parallel>::test): Convert
	to...
	(is_a_helper <const gimple_statement_omp_parallel *>::test): ...this.
	(is_a_helper <const gimple_statement_omp_target>::test): Convert
	to...
	(is_a_helper <const gimple_statement_omp_target *>::test): ...this.
	(is_a_helper <const gimple_statement_omp_sections>::test): Convert
	to...
	(is_a_helper <const gimple_statement_omp_sections *>::test): ...this.
	(is_a_helper <const gimple_statement_omp_single>::test): Convert
	to...
	(is_a_helper <const gimple_statement_omp_single *>::test): ...this.
	(is_a_helper <const gimple_statement_omp_teams>::test): Convert
	to...
	(is_a_helper <const gimple_statement_omp_teams *>::test): ...this.
	(is_a_helper <const gimple_statement_omp_task>::test): Convert
	to...
	(is_a_helper <const gimple_statement_omp_task *>::test): ...this.
	(is_a_helper <const gimple_statement_phi>::test): Convert to...
	(is_a_helper <const gimple_statement_phi *>::test): ...this.
	(is_a_helper <const gimple_statement_transaction>::test): Convert
	to...
	(is_a_helper <const gimple_statement_transaction *>::test): ...this.
	(is_a_helper <const gimple_statement_with_ops>::test): Convert
	to...
	(is_a_helper <const gimple_statement_with_ops *>::test): ...this.
	(is_a_helper <gimple_statement_with_ops>::test): Convert to...
	(is_a_helper <gimple_statement_with_ops *>::test): ...this.
	(is_a_helper <const gimple_statement_with_memory_ops>::test):
	Convert to...
	(is_a_helper <const gimple_statement_with_memory_ops *>::test):
	...this.
	(is_a_helper <gimple_statement_with_memory_ops>::test): Convert
	to...
	(is_a_helper <gimple_statement_with_memory_ops *>::test): ...this.

	(gimple_use_ops): Update for removal of implicit pointer from the
	is-a.h API.
	(gimple_set_use_ops): Likewise.
	(gimple_vuse): Likewise.
	(gimple_vdef): Likewise.
	(gimple_vuse_ptr): Likewise.
	(gimple_vdef_ptr): Likewise.
	(gimple_set_vuse): Likewise.
	(gimple_set_vdef): Likewise.
	(gimple_omp_return_set_lhs): Likewise.
	(gimple_omp_return_lhs): Likewise.
	(gimple_omp_return_lhs_ptr): Likewise.
	(gimple_call_fntype): Likewise.
	(gimple_call_set_fntype): Likewise.
	(gimple_call_set_internal_fn): Likewise.
	(gimple_call_use_set): Likewise.
	(gimple_call_clobber_set): Likewise.
	(gimple_bind_vars): Likewise.
	(gimple_bind_set_vars): Likewise.
	(gimple_bind_body_ptr): Likewise.
	(gimple_bind_set_body): Likewise.
	(gimple_bind_add_stmt): Likewise.
	(gimple_bind_block): Likewise.
	(gimple_bind_set_block): Likewise.
	(gimple_asm_ninputs): Likewise.
	(gimple_asm_noutputs): Likewise.
	(gimple_asm_nclobbers): Likewise.
	(gimple_asm_nlabels): Likewise.
	(gimple_asm_input_op): Likewise.
	(gimple_asm_input_op_ptr): Likewise.
	(gimple_asm_output_op): Likewise.
	(gimple_asm_output_op_ptr): Likewise.
	(gimple_asm_set_output_op): Likewise.
	(gimple_asm_clobber_op): Likewise.
	(gimple_asm_set_clobber_op): Likewise.
	(gimple_asm_label_op): Likewise.
	(gimple_asm_set_label_op): Likewise.
	(gimple_asm_string): Likewise.
	(gimple_catch_types): Likewise.
	(gimple_catch_types_ptr): Likewise.
	(gimple_catch_handler_ptr): Likewise.
	(gimple_catch_set_types): Likewise.
	(gimple_catch_set_handler): Likewise.
	(gimple_eh_filter_types): Likewise.
	(gimple_eh_filter_types_ptr): Likewise.
	(gimple_eh_filter_failure_ptr): Likewise.
	(gimple_eh_filter_set_types): Likewise.
	(gimple_eh_filter_set_failure): Likewise.
	(gimple_eh_must_not_throw_fndecl): Likewise.
	(gimple_eh_must_not_throw_set_fndecl): Likewise.
	(gimple_eh_else_n_body_ptr): Likewise.
	(gimple_eh_else_e_body_ptr): Likewise.
	(gimple_eh_else_set_n_body): Likewise.
	(gimple_eh_else_set_e_body): Likewise.
	(gimple_try_eval_ptr): Likewise.
	(gimple_try_cleanup_ptr): Likewise.
	(gimple_try_set_eval): Likewise.
	(gimple_try_set_cleanup): Likewise.
	(gimple_wce_cleanup_ptr): Likewise.
	(gimple_wce_set_cleanup): Likewise.
	(gimple_phi_capacity): Likewise.
	(gimple_phi_num_args): Likewise.
	(gimple_phi_result): Likewise.
	(gimple_phi_result_ptr): Likewise.
	(gimple_phi_set_result): Likewise.
	(gimple_phi_arg): Likewise.
	(gimple_phi_set_arg): Likewise.
	(gimple_resx_region): Likewise.
	(gimple_resx_set_region): Likewise.
	(gimple_eh_dispatch_region): Likewise.
	(gimple_eh_dispatch_set_region): Likewise.
	(gimple_omp_critical_name): Likewise.
	(gimple_omp_critical_name_ptr): Likewise.
	(gimple_omp_critical_set_name): Likewise.
	(gimple_omp_for_clauses): Likewise.
	(gimple_omp_for_clauses_ptr): Likewise.
	(gimple_omp_for_set_clauses): Likewise.
	(gimple_omp_for_collapse): Likewise.
	(gimple_omp_for_index): Likewise.
	(gimple_omp_for_index_ptr): Likewise.
	(gimple_omp_for_set_index): Likewise.
	(gimple_omp_for_initial): Likewise.
	(gimple_omp_for_initial_ptr): Likewise.
	(gimple_omp_for_set_initial): Likewise.
	(gimple_omp_for_final): Likewise.
	(gimple_omp_for_final_ptr): Likewise.
	(gimple_omp_for_set_final): Likewise.
	(gimple_omp_for_incr): Likewise.
	(gimple_omp_for_incr_ptr): Likewise.
	(gimple_omp_for_set_incr): Likewise.
	(gimple_omp_for_pre_body_ptr): Likewise.
	(gimple_omp_for_set_pre_body): Likewise.
	(gimple_omp_parallel_clauses): Likewise.
	(gimple_omp_parallel_clauses_ptr): Likewise.
	(gimple_omp_parallel_set_clauses): Likewise.
	(gimple_omp_parallel_child_fn): Likewise.
	(gimple_omp_parallel_child_fn_ptr): Likewise.
	(gimple_omp_parallel_set_child_fn): Likewise.
	(gimple_omp_parallel_data_arg): Likewise.
	(gimple_omp_parallel_data_arg_ptr): Likewise.
	(gimple_omp_parallel_set_data_arg): Likewise.
	(gimple_omp_task_clauses): Likewise.
	(gimple_omp_task_clauses_ptr): Likewise.
	(gimple_omp_task_set_clauses): Likewise.
	(gimple_omp_task_child_fn): Likewise.
	(gimple_omp_task_child_fn_ptr): Likewise.
	(gimple_omp_task_set_child_fn): Likewise.
	(gimple_omp_task_data_arg): Likewise.
	(gimple_omp_task_data_arg_ptr): Likewise.
	(gimple_omp_task_set_data_arg): Likewise.
	(gimple_omp_taskreg_clauses): Likewise.
	(gimple_omp_taskreg_clauses_ptr): Likewise.
	(gimple_omp_taskreg_set_clauses): Likewise.
	(gimple_omp_taskreg_child_fn): Likewise.
	(gimple_omp_taskreg_child_fn_ptr): Likewise.
	(gimple_omp_taskreg_set_child_fn): Likewise.
	(gimple_omp_taskreg_data_arg): Likewise.
	(gimple_omp_taskreg_data_arg_ptr): Likewise.
	(gimple_omp_taskreg_set_data_arg): Likewise.
	(gimple_omp_task_copy_fn): Likewise.
	(gimple_omp_task_copy_fn_ptr): Likewise.
	(gimple_omp_task_set_copy_fn): Likewise.
	(gimple_omp_task_arg_size): Likewise.
	(gimple_omp_task_arg_size_ptr): Likewise.
	(gimple_omp_task_set_arg_size): Likewise.
	(gimple_omp_task_arg_align): Likewise.
	(gimple_omp_task_arg_align_ptr): Likewise.
	(gimple_omp_task_set_arg_align): Likewise.
	(gimple_omp_single_clauses): Likewise.
	(gimple_omp_single_clauses_ptr): Likewise.
	(gimple_omp_single_set_clauses): Likewise.
	(gimple_omp_target_clauses): Likewise.
	(gimple_omp_target_clauses_ptr): Likewise.
	(gimple_omp_target_set_clauses): Likewise.
	(gimple_omp_target_child_fn): Likewise.
	(gimple_omp_target_child_fn_ptr): Likewise.
	(gimple_omp_target_set_child_fn): Likewise.
	(gimple_omp_target_data_arg): Likewise.
	(gimple_omp_target_data_arg_ptr): Likewise.
	(gimple_omp_target_set_data_arg): Likewise.
	(gimple_omp_teams_clauses): Likewise.
	(gimple_omp_teams_clauses_ptr): Likewise.
	(gimple_omp_teams_set_clauses): Likewise.
	(gimple_omp_sections_clauses): Likewise.
	(gimple_omp_sections_clauses_ptr): Likewise.
	(gimple_omp_sections_set_clauses): Likewise.
	(gimple_omp_sections_control): Likewise.
	(gimple_omp_sections_control_ptr): Likewise.
	(gimple_omp_sections_set_control): Likewise.
	(gimple_omp_for_set_cond): Likewise.
	(gimple_omp_for_cond): Likewise.
	(gimple_omp_atomic_store_set_val): Likewise.
	(gimple_omp_atomic_store_val): Likewise.
	(gimple_omp_atomic_store_val_ptr): Likewise.
	(gimple_omp_atomic_load_set_lhs): Likewise.
	(gimple_omp_atomic_load_lhs): Likewise.
	(gimple_omp_atomic_load_lhs_ptr): Likewise.
	(gimple_omp_atomic_load_set_rhs): Likewise.
	(gimple_omp_atomic_load_rhs): Likewise.
	(gimple_omp_atomic_load_rhs_ptr): Likewise.
	(gimple_omp_continue_control_def): Likewise.
	(gimple_omp_continue_control_def_ptr): Likewise.
	(gimple_omp_continue_set_control_def): Likewise.
	(gimple_omp_continue_control_use): Likewise.
	(gimple_omp_continue_control_use_ptr): Likewise.
	(gimple_omp_continue_set_control_use): Likewise.
	(gimple_transaction_body_ptr): Likewise.
	(gimple_transaction_label): Likewise.
	(gimple_transaction_label_ptr): Likewise.
	(gimple_transaction_set_body): Likewise.
	(gimple_transaction_set_label): Likewise.

	* ipa-devirt.c (build_type_inheritance_graph): Likewise.
	* ipa-inline-analysis.c (inline_write_summary): Likewise.
	* ipa-ref.c (ipa_record_reference): Likewise.
	* ipa-reference.c (analyze_function): Likewise.
	(ipa_reference_write_optimization_summary): Likewise.
	* ipa.c (symtab_remove_unreachable_nodes): Likewise.
	(address_taken_from_non_vtable_p): Likewise.
	(comdat_can_be_unshared_p_1): Likewise.
	* lto-cgraph.c (lto_output_ref): Likewise.
	(add_references): Likewise.
	(compute_ltrans_boundary): Likewise.
	(output_symtab): Likewise.
	(input_ref): Likewise.
	(input_cgraph_1): Likewise.
	(output_cgraph_opt_summary): Likewise.
	* lto-streamer-out.c (lto_output): Likewise.
	(output_symbol_p): Likewise.
	* lto-streamer.h (lsei_next_function_in_partition): Likewise.
	(lsei_start_function_in_partition): Likewise.
	(lsei_next_variable_in_partition): Likewise.
	(lsei_start_variable_in_partition): Likewise.
	* symtab.c (insert_to_assembler_name_hash): Likewise.
	(unlink_from_assembler_name_hash): Likewise.
	(symtab_unregister_node): Likewise.
	(symtab_remove_node): Likewise.
	(dump_symtab_node): Likewise.
	(verify_symtab_base): Likewise.
	(verify_symtab_node): Likewise.
	(symtab_make_decl_local): Likewise.
	(symtab_alias_ultimate_target): Likewise.
	(symtab_resolve_alias): Likewise.
	(symtab_get_symbol_partitioning_class): Likewise.
	* tree-phinodes.c (allocate_phi_node): Likewise.
	(reserve_phi_args_for_new_edge): Likewise.
	(remove_phi_args): Likewise.
	* varpool.c (varpool_node_for_asm): Likewise.
	(varpool_remove_unreferenced_decls): Likewise.

gcc/lto/
	* lto-partition.c (add_references_to_partition): Update for
	removal of implicit pointer from the is-a.h API.
	(add_symbol_to_partition_1): Likewise.
	(contained_in_symbol): Likewise.
	(undo_partition): Likewise.
	(lto_balanced_map): Likewise.
	(promote_symbol): Likewise.
	* lto-symtab.c (lto_symtab_merge_symbols_1): Likewise.
	(lto_symtab_merge_symbols): Likewise.
	* lto.c (lto_wpa_write_files): Likewise.

From-SVN: r209719
2014-04-23 19:06:40 +00:00
Richard Biener 783dab6bd5 common.opt (lto_partition_model): New enum.
2014-04-15  Richard Biener  <rguenther@suse.de>

	* common.opt (lto_partition_model): New enum.
	(flto-partition=): Merge separate options with a single with argument,
	add -flto-partition=one support.
	* flag-types.h (enum lto_partition_model): Declare.
	* opts.c (finish_options): Remove duplicate -flto-partition=
	option check.
	* lto-wrapper.c (run_gcc): Adjust.

	lto/
	* lto.c: Include params.h.
	(do_whole_program_analysis): Switch on flag_lto_partition value,
	add support for LTO_PARTITION_ONE.
	* lto-partition.h (lto_balanced_map): Adjust.
	* lto-partition.c (lto_balanced_map): Get number of desired
	partitions as argument to support -flto-partition=one.

From-SVN: r209416
2014-04-15 12:56:16 +00:00
Jan Hubicka cb90235dad ipa-utils.c (ipa_merge_profiles): Merge profile_id.
* ipa-utils.c (ipa_merge_profiles): Merge profile_id.
	* coverage.c (coverage_compute_profile_id): Handle externally visible
	symbols.

	* lto/lto-symtab.c (lto_cgraph_replace_node): Don't re-merge
	tp_first_run.

From-SVN: r209387
2014-04-14 17:18:54 +00:00
Jan Hubicka bbe281da97 lto.c: Include ipa-inline.h
* lto.c: Include ipa-inline.h
	(do_whole_program_analysis): Free inline summary after partitioning.

From-SVN: r209322
2014-04-11 19:22:20 +00:00
Richard Biener ce2f49b3bf re PR c++/60553 (segfault in gt_ggc_mx_lang_tree_node in Chromium with LTO)
2014-03-19  Richard Biener  <rguenther@suse.de>

	PR middle-end/60553
	* tree-core.h (tree_type_common): Re-order pointer members
	to reduce recursion depth during GC walks.

	lto/
	* lto-tree.h (lang_tree_node): For types use TYPE_NEXT_VARIANT 
	instead of TREE_CHAIN as chain_next.

From-SVN: r208682
2014-03-19 15:37:28 +00:00
Richard Biener e41106fc81 lto.c (lto_wpa_write_files): Move call to lto_promote_cross_file_statics ...
2014-03-19  Richard Biener  <rguenther@suse.de>

	* lto.c (lto_wpa_write_files): Move call to
	lto_promote_cross_file_statics ...
	(do_whole_program_analysis): ... here, into the partitioning
	block.  Do not ggc_collect after lto_wpa_write_files but
	for a last time before it.

From-SVN: r208679
2014-03-19 11:35:59 +00:00
Jakub Jelinek 15df2655d8 re PR lto/60571 (FTBFS on hurd-i386)
PR lto/60571
	* lto.c (wait_for_child): Define WCONTINUED if not defined to 0.
	Fix formatting.

From-SVN: r208675
2014-03-19 08:18:46 +01:00
Jakub Jelinek 415e2e6b2c re PR sanitizer/60535 (Link failure with -flto and -fsanitize=undefined)
PR sanitizer/60535
	* ubsan.c (ubsan_type_descriptor, ubsan_create_data): Call
	varpool_finalize_decl instead of rest_of_decl_compilation.
lto/
	* lto-lang.c (lto_init): Add NAME_TYPE for int128_integer_type_node
	and complex_{float,{,long_}double}_type_node.
testsuite/
	* c-c++-common/ubsan/null-1.c: Don't skip if -flto.
	* c-c++-common/ubsan/null-2.c: Likewise.
	* c-c++-common/ubsan/null-3.c: Likewise.
	* c-c++-common/ubsan/null-4.c: Likewise.
	* c-c++-common/ubsan/null-5.c: Likewise.
	* c-c++-common/ubsan/null-6.c: Likewise.
	* c-c++-common/ubsan/null-7.c: Likewise.
	* c-c++-common/ubsan/null-8.c: Likewise.
	* c-c++-common/ubsan/null-9.c: Likewise.
	* c-c++-common/ubsan/null-10.c: Likewise.
	* c-c++-common/ubsan/null-11.c: Likewise.
	* c-c++-common/ubsan/overflow-1.c: Likewise.
	* c-c++-common/ubsan/overflow-2.c: Likewise.
	* c-c++-common/ubsan/overflow-add-1.c: Likewise.
	* c-c++-common/ubsan/overflow-add-2.c: Likewise.
	* c-c++-common/ubsan/overflow-int128.c: Likewise.
	* c-c++-common/ubsan/overflow-mul-1.c: Likewise.
	* c-c++-common/ubsan/overflow-mul-2.c: Likewise.
	* c-c++-common/ubsan/overflow-mul-3.c: Likewise.
	* c-c++-common/ubsan/overflow-mul-4.c: Likewise.
	* c-c++-common/ubsan/overflow-negate-1.c: Likewise.
	* c-c++-common/ubsan/overflow-negate-2.c: Likewise.
	* c-c++-common/ubsan/overflow-sub-1.c: Likewise.
	* c-c++-common/ubsan/overflow-sub-2.c: Likewise.
	* c-c++-common/ubsan/pr59333.c: Likewise.
	* c-c++-common/ubsan/pr59503.c: Likewise.
	* c-c++-common/ubsan/pr59667.c: Likewise.
	* c-c++-common/ubsan/undefined-1.c: Likewise.
	* g++.dg/ubsan/pr59250.C: Likewise.
	* g++.dg/ubsan/pr59306.C: Likewise.

From-SVN: r208651
2014-03-18 15:56:23 +01:00
Paulo Matos f42c637eb7 lto-wrapper.c (merge_and_complain): Ensure -fshort-double is used consistently accross all TUs.
2014-03-08  Paulo Matos  <paulo@matos-sorge.com>
	    Richard Biener  <rguenther@suse.de>

	* lto-wrapper.c (merge_and_complain): Ensure -fshort-double is used
	consistently accross all TUs.
	(run_gcc): Enable -fshort-double automatically at link at link-time
	and disallow override.

2014-03-08  Paulo Matos  <paulo@matos-sorge.com>

    * c.opt: Enable LTO FE for fshort-double.

2014-03-08  Paulo Matos  <paulo@matos-sorge.com>

    * gcc.dg/lto/pr55113_0.c: New testcase.

2014-03-08  Paulo Matos  <paulo@matos-sorge.com>

    * lto-lang.c (lto_init): Pass flag_short_double to
    build_common_tree_nodes.


Co-Authored-By: Richard Biener <rguenther@suse.de>

From-SVN: r208428
2014-03-08 11:54:05 +01:00
Jan Hubicka 6dab804dc7 re PR lto/60295 (Too many lto1-wpa-stream processes are forked)
PR lto/60295
	* lto.c (stream_out): Avoid parallel streaming with
	-flto=jobserver until we are able to throttle it down
	resonably.

From-SVN: r208097
2014-02-24 22:58:44 +00:00
Jan Hubicka 39434bce6c lto-partition.c (add_symbol_to_partition_1, [...]): Aliases have no defined size.
* lto-partition.c (add_symbol_to_partition_1,
	undo_partition, lto_balanced_map): Aliases have no
	defined size.
	(lto_balanced_map): Do not follow refering variables
	if they can be optimized out.

From-SVN: r207967
2014-02-20 19:40:14 +00:00
Richard Biener 1966fd99d8 re PR target/60179 (target optimization attribute streaming is broken)
2014-02-14  Richard Biener  <rguenther@suse.de>

	PR lto/60179
	* lto-streamer-out.c (DFS_write_tree_body): Do not follow
	DECL_FUNCTION_SPECIFIC_TARGET.
	(hash_tree): Do not hash DECL_FUNCTION_SPECIFIC_TARGET.
	* tree-streamer-out.c (pack_ts_target_option): Remove.
	(streamer_pack_tree_bitfields): Do not stream
	TS_TARGET_OPTION.
	(write_ts_function_decl_tree_pointers): Do not stream
	DECL_FUNCTION_SPECIFIC_TARGET.
	* tree-streamer-in.c (unpack_ts_target_option): Remove.
	(unpack_value_fields): Do not stream TS_TARGET_OPTION.
	(lto_input_ts_function_decl_tree_pointers): Do not stream
	DECL_FUNCTION_SPECIFIC_TARGET.

	lto/
	* lto.c (compare_tree_sccs_1): Do not compare
	DECL_FUNCTION_SPECIFIC_TARGET.
	(lto_read_decls): Re-build DECL_FUNCTION_SPECIFIC_TARGET.

From-SVN: r207783
2014-02-14 12:03:43 +00:00
Richard Biener 283416b3fb re PR fortran/60060 (lto1: internal compiler error: in add_AT_specification, at dwarf2out.c:4096)
2014-02-12  Richard Biener  <rguenther@suse.de>

	PR lto/60060
	* lto-lang.c (lto_write_globals): Do not call
	wrapup_global_declarations or emit_debug_global_declarations
	but emit debug info for non-function scope variables
	directly.

From-SVN: r207715
2014-02-12 09:01:30 +00:00
Jan Hubicka b7e85694cf * lto.c (unify_scc): Free CONSTRUCTOR_ELTS.
From-SVN: r207619
2014-02-07 23:47:17 +00:00
Jan Hubicka 964512791e re PR ipa/59469 (LLVM build failure with gcc LTO)
PR ipa/59469
	* lto-cgraph.c (lto_output_node): Use
	symtab_get_symbol_partitioning_class.
	(lto_output_varpool_node): likewise.
	(symtab_get_symbol_partitioning_class): Move here from
	lto/lto-partition.c
	* cgraph.h (symbol_partitioning_class): Likewise.
	(symtab_get_symbol_partitioning_class): Declare.

	* lto-partition.c (symbol_class): Move to cgraph.h
	(get_symbol_class): Move to symtab.c
	(add_references_to_partition, add_symbol_to_partition_1,
	lto_max_map, lto_1_to_1_map, lto_balanced_map,
	lto_promote_cross_file_statics): Update.

From-SVN: r207589
2014-02-07 02:27:05 +00:00
Jan Hubicka f300e7b88c lto-cgraph.c (asm_nodes_output): Make global.
* lto-cgraph.c (asm_nodes_output): Make global.
	* lto-wrapper.c (run_gcc): Pass down paralelizm to WPA.
	* gcc.c (AS_NEEDS_DASH_FOR_PIPED_INPUT): Allow WPA
	parameter
	(driver_handle_option): Handle OPT_fwpa.

	* lto.c (lto_parallelism): New static var.
	(do_stream_out, wait_for_child, stream_out): New static functions.
	(lto_wpa_write_files): Add support for parallel streaming.
	(do_whole_program_analysis): Set parallelism.
	* lang.opt (fwpa): Add parameter.
	* lto-lang.c (lto_handle_option): Handle flag_wpa.
	(lto_init): Update use of flag_wpa.
	* lto-streamer.h (asm_nodes_output): Declare.

From-SVN: r207515
2014-02-05 17:21:07 +00:00
Richard Biener f0f91770c3 lto.h (lto_global_var_decls): Remove.
2014-02-05  Richard Biener  <rguenther@suse.de>

	lto/
	* lto.h (lto_global_var_decls): Remove.
	* lto-lang.c (lto_init): Do not allocate lto_global_var_decls.
	(lto_write_globals): Do nothing in WPA stage, gather globals from
	the varpool here ...
	* lto.c (lto_main): ... not here.
	(materialize_cgraph): Do not call rest_of_decl_compilation
	on the empty lto_global_var_decls vector.
	(lto_global_var_decls): Remove.

From-SVN: r207510
2014-02-05 15:23:36 +00:00
Jan Hubicka d665f8dde6 ipa.c (function_and_variable_visibility): Decompose DECL_ONE_ONLY groups when we know they are controlled by LTO.
* ipa.c (function_and_variable_visibility): Decompose DECL_ONE_ONLY
	groups when we know they are controlled by LTO.
	* varasm.c (default_binds_local_p_1): If object is in other partition,
	it will be resolved locally.

	* lto-partition.c (get_symbol_class): Only unforced DECL_ONE_ONLY 
	needs duplicating, not generic COMDAT.

From-SVN: r207489
2014-02-04 23:26:36 +00:00
Richard Biener c39276b8d6 re PR lto/59723 (ICE: in lto_output_tree, at lto-streamer-out.c:1390 when compiling some Fortran tests with -flto)
2014-02-04  Richard Biener  <rguenther@suse.de>

	PR lto/59723
	* lto-streamer-out.c (tree_is_indexable): Force NAMELIST_DECLs
	in function context local.
	(lto_output_tree_ref): Do not write trees from lto_output_tree_ref.
	* lto-streamer-in.c (lto_input_tree_ref): Handle LTO_namelist_decl_ref
	similar to LTO_imported_decl_ref.

	lto/
	* lto.c (mentions_vars_p): Handle NAMELIST_DECL.
	(lto_fixup_prevailing_decls): Handle fixing up CONSTRUCTOR values.

From-SVN: r207471
2014-02-04 14:53:24 +00:00
Jan Hubicka 5f876ae722 re PR ipa/59469 (LLVM build failure with gcc LTO)
PR ipa/59469
	* lto-symtab.c (lto_cgraph_replace_node, lto_varpool_replace_node):
	merge force_output and forced_by_abi flags.

From-SVN: r207449
2014-02-04 05:50:18 +00:00
Balaji V. Iyer b72271b953 Replace flag_enable_cilkplus with flag_cilkplus.
gcc/ChangeLog
+2014-01-24  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+       * builtins.c (is_builtin_name): Renamed flag_enable_cilkplus to
+       flag_cilkplus.
+       * builtins.def: Likewise.
+       * cilk.h (fn_contains_cilk_spawn_p): Likewise.
+       * cppbuiltin.c (define_builtin_macros_for_compilation_flags): Likewise.
+       * ira.c (ira_setup_eliminable_regset): Likewise.
+       * omp-low.c (gate_expand_omp): Likewise.
+       (execute_lower_omp): Likewise.
+       (diagnose_sb_0): Likewise.
+       (gate_diagnose_omp_blocks): Likewise.
+       (simd_clone_clauses_extract): Likewise.
+       (gate): Likewise.
+

gcc/c-family/ChangeLog
+2014-01-24  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+       * c-common.c (c_define_builtins): Replaced flag_enable_cilkplus with
+       flag_cilkplus.
+       * c-pragma.c (init_pragma): Likewise.
+       * c.opt: Likewise.
+

gcc/c/ChangeLog
+2014-01-24  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+       * c-parser.c (c_parser_declaration_or_fndef): Replaced
+       flag_enable_cilkplus with flag_cilkplus.
+       (c_parser_direct_declarator_inner): Likewise.
+       (c_parser_attribute_any_word): Likewise.
+       (c_parser_attributes): Likewise.
+       (c_parser_compound_statement): Likewise.
+       (c_parser_statement_after_labels): Likewise.
+       (c_parser_if_statement): Likewise.
+       (c_parser_switch_statement): Likewise.
+       (c_parser_do_statement): Likewise.
+       (c_parser_for_statement): Likewise.
+       (c_parser_unary_expression): Likewise.
+       (c_parser_postfix_expression): Likewise.
+       (c_parser_postfix_expression_after_primary): Likewise.
+       (c_parser_postfix_expression_after_primary): Likewise.
+       (c_parser_omp_clause_name): Likewise.
+       (c_finish_omp_declare_simd): Likewise.
+       (c_parser_cilk_verify_simd): Likewise.
+       * c-typeck.c (build_array_ref): Likewise.
+       (build_function_call_vec): Likewise.
+       (convert_arguments): Likewise.
+       (build_compound_expr): Likewise.
+       (c_finish_return): Likewise.
+       (c_finish_if_stmt): Likewise.
+       (c_finish_loop): Likewise.
+       (build_binary_op): Likewise.
+

gcc/lto/ChangeLog
+2014-01-24  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+       * lto-lang.c (lto_init): Replaced flag_enable_cilkplus with
+       flag_cilkplus.
+

From-SVN: r207064
2014-01-24 15:13:49 -08:00
Richard Biener 63124c486d lto.c (gimple_canonical_types_compatible_p): Fix comment.
2014-01-09  Richard Biener  <rguenther@suse.de>

	* lto.c (gimple_canonical_types_compatible_p): Fix comment.

From-SVN: r206462
2014-01-09 12:34:39 +00:00
Richard Biener d05b99205d re PR fortran/45586 (ICE non-trivial conversion at assignment)
2014-01-09  Richard Biener  <rguenther@suse.de>

	PR lto/45586
	* lto.c (hash_canonical_type): Do not hash TREE_ADDRESSABLE,
	TYPE_ALIGN, TYPE_RESTRICT or TYPE_REF_CAN_ALIAS_ALL.
	(gimple_canonical_types_compatible_p): Do not compare them either.

From-SVN: r206461
2014-01-09 11:52:43 +00:00
Richard Sandiford 23a5b65a92 Update copyright years in gcc/
From-SVN: r206289
2014-01-02 22:23:26 +00:00
Oleg Endo 2c8326a568 asan.c: Remove struct tags when referring to class varpool_node.
* asan.c: Remove struct tags when referring to class varpool_node.
	* cgraph.h: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphunit.c: Likewise.
	* dbxout.c: Likewise.
	* dwarf2out.c: Likewise.
	* gimple-fold.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-ref-inline.h: Likewise.
	* ipa-ref.h: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.h: Likewise.
	* passes.c: Likewise.
	* toplev.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-pass.h: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.

	* cp/decl2.c: Remove struct tags when referring to class varpool_node.

	* lto/lto.c: Remove struct tags when referring to class varpool_node.
	* lto/lto-partition.c: Likewise.
	* lto/lto-symtab.c: Likewise.

From-SVN: r205733
2013-12-06 10:40:53 +00:00
Jakub Jelinek e06f9964af re PR lto/59326 (FAIL: gcc.dg/vect/vect-simd-clone-*.c)
PR lto/59326
	* omp-low.c (simd_clone_create): Return NULL if for definition
	!cgraph_function_with_gimple_body_p (old_node).  Call cgraph_get_body
	before calling cgraph_function_versioning.
	(expand_simd_clones): Look for "omp declare simd" attribute first.
	Don't check targetm.simd_clone.compute_vecsize_and_simdlen here.
	Punt if node->global.inlined_to.
	(pass_omp_simd_clone::gate): Also enable if in_lto_p && !flag_wpa.
	Disable pass if targetm.simd_clone.compute_vecsize_and_simdlen is NULL.
	* lto-streamer-out.c (hash_tree): Handle OMP_CLAUSE.
lto/
	* lto.c (compare_tree_sccs_1): Handle OMP_CLAUSE.
testsuite/
	* gcc.dg/vect/vect-simd-clone-12.c: New test.
	* gcc.dg/vect/vect-simd-clone-12a.c: New test.
	* gcc.dg/vect/vect-simd-clone-10a.c: Remove extern keywords.

Co-Authored-By: Richard Biener <rguenther@suse.de>

From-SVN: r205514
2013-11-29 11:41:12 +01:00
Jakub Jelinek c193f58b67 re PR lto/59326 (FAIL: gcc.dg/vect/vect-simd-clone-*.c)
PR lto/59326
	* tree-core.h (enum omp_clause_schedule_kind): Add
	OMP_CLAUSE_SCHEDULE_LAST.
	(enum omp_clause_default_kind): Add OMP_CLAUSE_DEFAULT_LAST.
	(enum omp_clause_depend_kind): Add OMP_CLAUSE_DEPEND_LAST.
	(enum omp_clause_map_kind): Add OMP_CLAUSE_MAP_LAST.
	(enum omp_clause_proc_bind_kind): Add OMP_CLAUSE_PROC_BIND_LAST.
	* lto-streamer-out.c (lto_is_streamable): Allow streaming
	OMP_CLAUSE.
	(DFS_write_tree_body): Handle OMP_CLAUSE.
	* tree-streamer-out.c (pack_ts_omp_clause_value_fields): New
	function.
	(streamer_pack_tree_bitfields): Call it for OMP_CLAUSE.
	(write_ts_omp_clause_tree_pointers): New function.
	(streamer_write_tree_body): Call it for OMP_CLAUSE.
	(streamer_write_tree_header): For OMP_CLAUSE stream OMP_CLAUSE_CODE.
	* tree-streamer-in.c (unpack_ts_omp_clause_value_fields): New
	function.
	(unpack_value_fields): Call it for OMP_CLAUSE.
	(streamer_alloc_tree): Handle OMP_CLAUSE.
	(lto_input_ts_omp_clause_tree_pointers): New function.
	(streamer_read_tree_body): Call it for OMP_CLAUSE.
lto/
	* lto.c (mentions_vars_p_omp_clause): New function.
	(mentions_vars_p): Call it for OMP_CLAUSE.  Remove break;
	after return stmts.

From-SVN: r205512
2013-11-29 11:36:10 +01:00
Andrew MacLeod 2fb9a547b4 gimple.h: Remove all includes.
* gimple.h: Remove all includes.
	(recalculate_side_effects): Move prototype to gimplify.h.
	* Makefile.in (PLUGIN_HEADERS): Add flattened gimple.h includes.
	* gengtype.c (open_base_files): Add gimple.h include list.
	* gimplify.h (recalculate_side_effects): Relocate prototype here.
	* gimple.c: Adjust include list.
	(recalculate_side_effects): Move to gimplify.c.
	* gimplify.c: Adjust include list.
	(recalculate_side_effects): Relocate from gimple.c.
	* alias.c: Add required include files removed from gimple.h.
	* asan.c: Likewise.
	* builtins.c: Likewise.
	* calls.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* cilk-common.c: Likewise.
	* data-streamer.c: Likewise.
	* data-streamer-in.c: Likewise.
	* data-streamer-out.c: Likewise.
	* dse.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* gimple-builder.c: Likewise.
	* gimple-expr.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple-ssa-isolate-paths.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple-streamer-out.c: Likewise.
	* gimple-walk.c: Likewise.
	* gimplify-me.c: Likewise.
	* graphite-blocking.c: Likewise.
	* graphite.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.
	* internal-fn.c: Likewise.
	* ipa.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* langhooks.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-compress.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* omp-low.c: Likewise.
	* opts-global.c: Likewise.
	* passes.c: Likewise.
	* predict.c: Likewise.
	* profile.c: Likewise.
	* sese.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* symtab.c: Likewise.
	* targhooks.c: Likewise.
	* toplev.c: Likewise.
	* tracer.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-affine.c: Likewise.
	* tree.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-copyrename.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-loop-ch.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-loop-unswitch.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-streamer.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vrp.c: Likewise.
	* tsan.c: Likewise.
	* ubsan.c: Likewise.
	* value-prof.c: Likewise.
	* varpool.c: Likewise.
	* var-tracking.c: Likewise.
	* vtable-verify.c: Likewise.

	* ada/gcc-interface/trans.c: Add required include files from gimple.h.

	* c/c-typeck.c: Add required include files from gimple.h.

	* c-family/c-common.c: Add required include files from gimple.h.
	* c-family/c-gimplify.c: Likewise
	* c-family/cilk.c: Likewise

	* cp/class.c: Add required include files from gimple.h.
	* cp/cp-gimplify.c: Likewise
	* cp/decl2.c: Likewise
	* cp/init.c: Likewise
	* cp/optimize.c: Likewise
	* cp/pt.c: Likewise
	* cp/semantics.c: Likewise
	* cp/tree.c: Likewise
	* cp/typeck.c: Likewise
	* cp/vtable-class-hierarchy.c: Likewise

	* fortran/trans.c: Add required include files from gimple.h.
	* fortran/trans-expr.c: Likewise
	* fortran/trans-openmp.c: Likewise

	* go/gofrontend/expressions.cc: Add required include files from
	gimple.h.
	* go/gofrontend/gogo-tree.cc: Likewise
	* go/gofrontend/types.cc: Likewise
	* go/go-gcc.cc: Likewise
	* go/go-lang.c: Likewise

	* java/java-gimplify.c: Add required include files from gimple.h.

	* lto/lto.c: Add required include files from gimple.h.
	* lto/lto-lang.c: Likewise
	* lto/lto-object.c: Likewise
	* lto/lto-partition.c: Likewise
	* lto/lto-symtab.c: Likewise

	* objc/objc-act.c: Add required include files from gimple.h.

	* config/darwin.c: Add required include files removed from gimple.h.
	* config/aarch64/aarch64-builtins.c: Likewise.
	* config/aarch64/aarch64.c: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/i386/winnt.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/m32c/m32c.c: Likewise.
	* config/mep/mep.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/s390/s390.c: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/spu/spu.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/tilegx/tilegx.c: Likewise.
	* config/tilepro/tilepro.c: Likewise.
	* config/xtensa/xtensa.c: Likewise.

	* testsuite/gcc.dg/plugin/finish_unit_plugin.c: Add required include
	files removed from gimple.h.
	* testsuite/gcc.dg/plugin/ggcplug.c: Likewise.
	* testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise.
	* testsuite/gcc.dg/plugin/selfassign.c: Likewise.
	* testsuite/gcc.dg/plugin/start_unit_plugin.c: Likewise.
	* testsuite/g++.dg/plugin/selfassign.c: Likewise.

From-SVN: r205272
2013-11-22 15:58:51 +00:00
Diego Novillo d8a2d370dc Factor unrelated declarations out of tree.h.
This patch applies the rule that functions defined in FOO.c must be
declared in FOO.h. One of the worst offenders in the code base is
tree.h, unsurprisingly.

The patch creates several new headers: attribs.h calls.h fold-const.h
gcc-symtab.h print-rtl.h print-tree.h stmt.h stor-layout.h stringpool.h
tree-nested.h tree-object-size.h varasm.h.

Functions in each corresponding .c file got moved to those headers and
others that already existed. I wanted to make this patch as mechanical
as possible, so I made no attempt to fix problems like having
build_addr defined in tree-inline.c. I left that for later.

There were some declarations that I could not move out of tree.h
because of header poisoning or the use of target macros. We forbid the
inclusion of things like expr.h from FE files. While that's a
reasonable idea, the FE file *still* manage to at expr.c functionality
because the declarations they want to use were defined in tree.h.

The affected files are builtins.h, emit-rtl.h and expr.h.

If that functionality is allowed to be accessed from the FEs,
then I will later move those functions out of expr.c into tree.c.
I have moved these declarations to the bottom of tree.h so they
are easy to identify later.

There is a namespace collision with libcpp. The file gcc/symtab.c
cannot use gcc/symtab.h because the #include command picks up
libcpp/include/symtab.h first. So I named this file gcc-symtab.h
for now.

Finally, I added a new header to PLUGIN_HEADERS to account for the
tree.h refactoring. I did not add all headers factored out of tree.h
because it is unclear (and impossible to tell) what plugins need.
This adds the one header used by the plugins in the testsuite.

This will be changing quite dramatically as we progress with the header
refactoring.

This patch should offer some minimal incremental build advantages
by reducing the size of tree.h. Changes that would otherwise
affected tree.h, will now go to other headers which are less
frequently included.

	* tree.h: Include fold-const.h.
	(aggregate_value_p): Moved to function.h.
	(alloca_call_p): Moved to calls.h.
	(allocate_struct_function): Moved to function.h.
	(apply_tm_attr): Moved to attribs.h.
	(array_at_struct_end_p): Moved to expr.h.
	(array_ref_element_size): Moved to tree-dfa.h.
	(array_ref_low_bound): Moved to tree-dfa.h.
	(array_ref_up_bound): Moved to tree.h.
	(assemble_alias): Moved to cgraph.h.
	(bit_from_pos): Moved to stor-layout.h.
	(build_addr): Moved to tree-nested.h.
	(build_duplicate_type): Moved to tree-inline.h.
	(build_fold_addr_expr): Moved to fold-const.h.
	(build_fold_addr_expr_with_type): Moved to fold-const.h.
	(build_fold_addr_expr_with_type_loc): Moved to fold-const.h.
	(build_fold_indirect_ref): Moved to fold-const.h.
	(build_fold_indirect_ref_loc): Moved to fold-const.h.
	(build_personality_function): Moved to tree.h.
	(build_range_check): Moved to fold-const.h.
	(build_simple_mem_ref): Moved to fold-const.h.
	(build_simple_mem_ref_loc): Moved to fold-const.h.
	(build_tm_abort_call): Moved to trans-mem.h.
	(byte_from_pos): Moved to stor-layout.h.
	(call_expr_flags): Moved to calls.h.
	(can_move_by_pieces): Moved to expr.h.
	(categorize_ctor_elements): Moved to expr.h.
	(change_decl_assembler_name): Moved to gcc-symtab.h.
	(combine_comparisons): Moved to fold-const.h.
	(complete_ctor_at_level_p): Moved to tree.h.
	(component_ref_field_offset): Moved to tree-dfa.h.
	(compute_builtin_object_size): Moved to tree-object-size.h.
	(compute_record_mode): Moved to stor-layout.h.
	(constant_boolean_node): Moved to fold-const.h.
	(constructor_static_from_elts_p): Moved to varasm.h.
	(cxx11_attribute_p): Moved to attribs.h.
	(debug_body): Moved to print-tree.h.
	(debug_find_tree): Moved to tree-inline.h.
	(debug_fold_checksum): Moved to fold-const.h.
	(debug_head): Moved to print-tree.h.
	(debug_head): Moved to print-tree.h.
	(debug_raw): Moved to print-tree.h.
	(debug_tree): Moved to print-tree.h.
	(debug_vec_tree): Moved to print-tree.h.
	(debug_verbose): Moved to print-tree.h.
	(debug_verbose): Moved to print-tree.h.
	(decl_attributes): Moved to attribs.h.
	(decl_binds_to_current_def_p): Moved to varasm.h.
	(decl_default_tls_model): Moved to varasm.h.
	(decl_replaceable_p): Moved to varasm.h.
	(div_if_zero_remainder): Moved to fold-const.h.
	(double_int mem_ref_offset): Moved to fold-const.h.
	(dump_addr): Moved to print-tree.h.
	(element_precision): Moved to machmode.h.
	(expand_dummy_function_end): Moved to function.h.
	(expand_function_end): Moved to function.h.
	(expand_function_start): Moved to function.h.
	(expand_label): Moved to stmt.h.
	(expr_first): Moved to tree-iterator.h.
	(expr_last): Moved to tree-iterator.h.
	(finalize_size_functions): Moved to stor-layout.h.
	(finish_builtin_struct): Moved to stor-layout.h.
	(finish_record_layout): Moved to stor-layout.h.
	(fixup_signed_type): Moved to stor-layout.h.
	(fixup_unsigned_type): Moved to stor-layout.h.
	(flags_from_decl_or_type): Moved to calls.h.
	(fold): Moved to fold-const.h.
	(fold_abs_const): Moved to fold-const.h.
	(fold_binary): Moved to fold-const.h.
	(fold_binary_loc): Moved to fold-const.h.
	(fold_binary_to_constant): Moved to fold-const.h.
	(fold_build1): Moved to fold-const.h.
	(fold_build1_initializer_loc): Moved to fold-const.h.
	(fold_build1_loc): Moved to fold-const.h.
	(fold_build1_stat_loc): Moved to fold-const.h.
	(fold_build2): Moved to fold-const.h.
	(fold_build2_initializer_loc): Moved to fold-const.h.
	(fold_build2_loc): Moved to fold-const.h.
	(fold_build2_stat_loc): Moved to fold-const.h.
	(fold_build3): Moved to fold-const.h.
	(fold_build3_loc): Moved to fold-const.h.
	(fold_build3_stat_loc): Moved to fold-const.h.
	(fold_build_call_array): Moved to fold-const.h.
	(fold_build_call_array_initializer): Moved to fold-const.h.
	(fold_build_call_array_initializer_loc): Moved to fold-const.h.
	(fold_build_call_array_loc): Moved to fold-const.h.
	(fold_build_cleanup_point_expr): Moved to fold-const.h.
	(fold_convert): Moved to fold-const.h.
	(fold_convert_loc): Moved to fold-const.h.
	(fold_convertible_p): Moved to fold-const.h.
	(fold_defer_overflow_warnings): Moved to fold-const.h.
	(fold_deferring_overflow_warnings_p): Moved to fold-const.h.
	(fold_fma): Moved to fold-const.h.
	(fold_ignored_result): Moved to fold-const.h.
	(fold_indirect_ref): Moved to fold-const.h.
	(fold_indirect_ref_1): Moved to fold-const.h.
	(fold_indirect_ref_loc): Moved to fold-const.h.
	(fold_read_from_constant_string): Moved to fold-const.h.
	(fold_real_zero_addition_p): Moved to fold-const.h.
	(fold_single_bit_test): Moved to fold-const.h.
	(fold_strip_sign_ops): Moved to fold-const.h.
	(fold_ternary): Moved to fold-const.h.
	(fold_ternary_loc): Moved to fold-const.h.
	(fold_unary): Moved to tree-data-ref.h.
	(fold_unary_ignore_overflow): Moved to fold-const.h.
	(fold_unary_ignore_overflow_loc): Moved to fold-const.h.
	(fold_unary_loc): Moved to fold-const.h.
	(fold_unary_to_constant): Moved to fold-const.h.
	(fold_undefer_and_ignore_overflow_warnings): Moved to fold-const.h.
	(fold_undefer_overflow_warnings): Moved to fold-const.h.
	(folding_initializer): Moved to fold-const.h.
	(free_temp_slots): Moved to function.h.
	(generate_setjmp_warnings): Moved to function.h.
	(get_attribute_name): Moved to attribs.h.
	(get_identifier): Moved to stringpool.h.
	(get_identifier_with_length): Moved to stringpool.h.
	(get_inner_reference): Moved to tree.h.
	(gimple_alloca_call_p): Moved to calls.h.
	(gimplify_parameters): Moved to function.h.
	(highest_pow2_factor): Moved to expr.h.
	(indent_to): Moved to print-tree.h.
	(init_attributes): Moved to attribs.h.
	(init_dummy_function_start): Moved to function.h.
	(init_function_start): Moved to function.h.
	(init_inline_once): Moved to tree-inline.h.
	(init_object_sizes): Moved to tree-object-size.h.
	(init_temp_slots): Moved to function.h.
	(init_tree_optimization_optabs): Moved to optabs.h.
	(initialize_sizetypes): Moved to stor-layout.h.
	(initializer_constant_valid_for_bitfield_p): Moved to varasm.h.
	(initializer_constant_valid_p): Moved to varasm.h.
	(int_const_binop): Moved to fold-const.h.
	(internal_reference_types): Moved to stor-layout.h.
	(invert_tree_comparison): Moved to fold-const.h.
	(invert_truthvalue): Moved to fold-const.h.
	(invert_truthvalue_loc): Moved to fold-const.h.
	(is_tm_ending_fndecl): Moved to trans-mem.h.
	(is_tm_may_cancel_outer): Moved to trans-mem.h.
	(is_tm_pure): Moved to trans-mem.h.
	(is_tm_safe): Moved to trans-mem.h.
	(layout_decl): Moved to stor-layout.h.
	(layout_type): Moved to stor-layout.h.
	(lookup_attribute_spec): Moved to attribs.h.
	(make_accum_type): Moved to stor-layout.h.
	(make_decl_one_only): Moved to varasm.h.
	(make_decl_rtl): Moved to tree.h.
	(make_decl_rtl_for_debug): Moved to varasm.h.
	(make_fract_type): Moved to stor-layout.h.
	(make_or_reuse_sat_signed_accum_type): Moved to stor-layout.h.
	(make_or_reuse_sat_signed_fract_type): Moved to stor-layout.h.
	(make_or_reuse_sat_unsigned_accum_type): Moved to stor-layout.h.
	(make_or_reuse_sat_unsigned_fract_type): Moved to stor-layout.h.
	(make_or_reuse_signed_accum_type): Moved to stor-layout.h.
	(make_or_reuse_signed_fract_type): Moved to stor-layout.h.
	(make_or_reuse_unsigned_accum_type): Moved to stor-layout.h.
	(make_or_reuse_unsigned_fract_type): Moved to stor-layout.h.
	(make_range): Moved to fold-const.h.
	(make_range_step): Moved to fold-const.h.
	(make_sat_signed_accum_type): Moved to stor-layout.h.
	(make_sat_signed_fract_type): Moved to stor-layout.h.
	(make_sat_unsigned_accum_type): Moved to stor-layout.h.
	(make_sat_unsigned_fract_type): Moved to stor-layout.h.
	(make_signed_accum_type): Moved to stor-layout.h.
	(make_signed_fract_type): Moved to stor-layout.h.
	(make_signed_type): Moved to stor-layout.h.
	(make_unsigned_accum_type): Moved to stor-layout.h.
	(make_unsigned_fract_type): Moved to stor-layout.h.
	(make_unsigned_type): Moved to stor-layout.h.
	(mark_decl_referenced): Moved to varasm.h.
	(mark_referenced): Moved to varasm.h.
	(may_negate_without_overflow_p): Moved to fold-const.h.
	(maybe_get_identifier): Moved to stringpool.h.
	(merge_ranges): Moved to fold-const.h.
	(merge_weak): Moved to varasm.h.
	(mode_for_size_tree): Moved to stor-layout.h.
	(multiple_of_p): Moved to fold-const.h.
	(must_pass_in_stack_var_size): Moved to calls.h.
	(must_pass_in_stack_var_size_or_pad): Moved to calls.h.
	(native_encode_expr): Moved to fold-const.h.
	(native_interpret_expr): Moved to fold-const.h.
	(non_lvalue): Moved to fold-const.h.
	(non_lvalue_loc): Moved to fold-const.h.
	(normalize_offset): Moved to stor-layout.h.
	(normalize_rli): Moved to stor-layout.h.
	(notice_global_symbol): Moved to varasm.h.
	(omit_one_operand): Moved to fold-const.h.
	(omit_one_operand_loc): Moved to fold-const.h.
	(omit_two_operands): Moved to fold-const.h.
	(omit_two_operands_loc): Moved to fold-const.h.
	(operand_equal_p): Moved to tree-data-ref.h.
	(parse_input_constraint): Moved to stmt.h.
	(parse_output_constraint): Moved to stmt.h.
	(place_field): Moved to stor-layout.h.
	(pop_function_context): Moved to function.h.
	(pop_temp_slots): Moved to function.h.
	(pos_from_bit): Moved to stor-layout.h.
	(preserve_temp_slots): Moved to function.h.
	(print_node): Moved to print-tree.h.
	(print_node_brief): Moved to print-tree.h.
	(print_rtl): Moved to rtl.h.
	(process_pending_assemble_externals): Moved to varasm.h.
	(ptr_difference_const): Moved to fold-const.h.
	(push_function_context): Moved to function.h.
	(push_struct_function): Moved to function.h.
	(push_temp_slots): Moved to function.h.
	(record_tm_replacement): Moved to trans-mem.h.
	(relayout_decl): Moved to stor-layout.h.
	(resolve_asm_operand_names): Moved to stmt.h.
	(resolve_unique_section): Moved to varasm.h.
	(rli_size_so_far): Moved to stor-layout.h.
	(rli_size_unit_so_far): Moved to stor-layout.h.
	(round_down): Moved to fold-const.h.
	(round_down_loc): Moved to fold-const.h.
	(round_up): Moved to fold-const.h.
	(round_up_loc): Moved to fold-const.h.
	(set_decl_incoming_rtl): Moved to emit-rtl.h.
	(set_decl_rtl): Moved to tree.h.
	(set_min_and_max_values_for_integral_type): Moved to stor-layout.h.
	(set_user_assembler_name): Moved to varasm.h.
	(setjmp_call_p): Moved to calls.h.
	(size_binop): Moved to fold-const.h.
	(size_binop_loc): Moved to fold-const.h.
	(size_diffop): Moved to fold-const.h.
	(size_diffop_loc): Moved to fold-const.h.
	(size_int_kind): Moved to fold-const.h.
	(stack_protect_epilogue): Moved to function.h.
	(start_record_layout): Moved to stor-layout.h.
	(supports_one_only): Moved to varasm.h.
	(swap_tree_comparison): Moved to fold-const.h.
	(tm_malloc_replacement): Moved to trans-mem.h.
	(tree build_fold_addr_expr_loc): Moved to fold-const.h.
	(tree build_invariant_address): Moved to fold-const.h.
	(tree_binary_nonnegative_warnv_p): Moved to fold-const.h.
	(tree_binary_nonzero_warnv_p): Moved to fold-const.h.
	(tree_call_nonnegative_warnv_p): Moved to fold-const.h.
	(tree_expr_nonnegative_p): Moved to fold-const.h.
	(tree_expr_nonnegative_warnv_p): Moved to fold-const.h.
	(tree_output_constant_def): Moved to varasm.h.
	(tree_overlaps_hard_reg_set): Moved to stmt.h.
	(tree_single_nonnegative_warnv_p): Moved to fold-const.h.
	(tree_single_nonzero_warnv_p): Moved to fold-const.h.
	(tree_swap_operands_p): Moved to fold-const.h.
	(tree_unary_nonnegative_warnv_p): Moved to fold-const.h.
	(tree_unary_nonzero_warnv_p): Moved to fold-const.h.
	(update_alignment_for_field): Moved to stor-layout.h.
	(use_register_for_decl): Moved to function.h.
	(variable_size): Moved to rtl.h.
	(vector_type_mode): Moved to stor-layout.h.
	* cgraph.h: Corresponding changes.
	* emit-rtl.h: Corresponding changes.
	* expr.h: Corresponding changes.
	* function.h: Corresponding changes.
	* optabs.h: Corresponding changes.
	* trans-mem.h: Corresponding changes.
	Protect against multiple inclusion.
	* tree-inline.h: Corresponding changes.
	* tree-iterator.h: Corresponding changes.
	* tree-dfa.h: Include expr.h.
	* tree-ssanames.h: Include stringpool.h.
	* attribs.h: New file.
	* calls.h: New file.
	* fold-const.h: New file.
	* gcc-symtab.h: New file.
	* print-rtl.h: New file.
	* print-tree.h: New file.
	* stmt.h: New file.
	* stor-layout.h: New file.
	* strinpool.h: New file.
	* tree-nested.h: New file
	* tree-object-size.h: New file.
	* varasm.h: New file.
	* Makefile.in (PLUGIN_HEADERS): Add stringpool.h.

	* alias.c: Include varasm.h.
	Include expr.h.
	* asan.c: Include calls.h.
	Include stor-layout.h.
	Include varasm.h.
	* attribs.c: Include stringpool.h.
	Include attribs.h.
	Include stor-layout.h.
	* builtins.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	Include tree-object-size.h.
	* calls.c: Include stor-layout.h.
	Include varasm.h.
	Include stringpool.h.
	Include attribs.h.
	* cfgexpand.c: Include stringpool.h.
	Include varasm.h.
	Include stor-layout.h.
	Include stmt.h.
	Include print-tree.h.
	* cgraph.c: Include varasm.h.
	Include calls.h.
	Include print-tree.h.
	* cgraphclones.c: Include stringpool.h.
	Include function.h.
	Include emit-rtl.h.
	Move inclusion of rtl.h earlier in the file.
	* cgraphunit.c: Include varasm.h.
	Include stor-layout.h.
	Include stringpool.h.
	* cilk-common.c: Include stringpool.h.
	Include stor-layout.h.
	* combine.c: Include stor-layout.h.
	* config/aarch64/aarch64-builtins.c: Include stor-layout.h.
	Include stringpool.h.
	Include calls.h.
	* config/aarch64/aarch64.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/alpha/alpha.c: Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/arc/arc.c: Include varasm.h.
	Include stor-layout.h.
	Include stringpool.h.
	Include calls.h.
	* config/arm/arm.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/avr/avr-c.c: Include stor-layout.h.
	* config/avr/avr-log.c: Include print-tree.h.
	* config/avr/avr.c: Include print-tree.h.
	Include calls.h.
	Include stor-layout.h.
	Include stringpool.h.
	* config/bfin/bfin.c: Include varasm.h.
	Include calls.h.
	* config/c6x/c6x.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	Include stringpool.h.
	* config/cr16/cr16.c: Include stor-layout.h.
	Include calls.h.
	* config/cris/cris.c: Include varasm.h.
	Include stor-layout.h.
	Include calls.h.
	Include stmt.h.
	* config/darwin.c: Include stringpool.h.
	Include varasm.h.
	Include stor-layout.h.
	* config/epiphany/epiphany.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	Include stringpool.h.
	* config/fr30/fr30.c: Include stor-layout.h.
	Include varasm.h.
	* config/frv/frv.c: Include varasm.h.
	Include stor-layout.h.
	Include stringpool.h.
	* config/h8300/h8300.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	Include stringpool.h.
	* config/i386/i386.c: Include stringpool.h.
	Include attribs.h.
	Include calls.h.
	Include stor-layout.h.
	Include varasm.h.
	* config/i386/winnt-cxx.c: Include stringpool.h.
	Include attribs.h.
	* config/i386/winnt.c: Include stringpool.h.
	Include varasm.h.
	* config/ia64/ia64-c.c: Include stringpool.h.
	* config/ia64/ia64.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/iq2000/iq2000.c: Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/lm32/lm32.c: Include calls.h.
	* config/m32c/m32c.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/m32r/m32r.c: Include stor-layout.h.
	Include varasm.h.
	Include stringpool.h.
	Include calls.h.
	* config/m68k/m68k.c: Include calls.h.
	Include stor-layout.h.
	Include varasm.h.
	* config/mcore/mcore.c: Include stor-layout.h.
	Include varasm.h.
	Include stringpool.h.
	Include calls.h.
	* config/mep/mep.c: Include varasm.h.
	Include calls.h.
	Include stringpool.h.
	Include stor-layout.h.
	* config/microblaze/microblaze.c: Include varasm.h.
	Include stor-layout.h.
	Include calls.h.
	* config/mips/mips.c: Include varasm.h.
	Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	* config/mmix/mmix.c: Include varasm.h.
	Include stor-layout.h.
	Include calls.h.
	* config/mn10300/mn10300.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/moxie/moxie.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/msp430/msp430.c: Include stor-layout.h.
	Include calls.h.
	* config/nds32/nds32.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/pa/pa.c: Include stor-layout.h.
	Include stringpool.h.
	Include varasm.h.
	Include calls.h.
	* config/pdp11/pdp11.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/picochip/picochip.c: Include calls.h.
	Include stor-layout.h.
	Include stringpool.h.
	Include varasm.h.
	* config/rl78/rl78.c: Include varasm.h.
	Include stor-layout.h.
	Include calls.h.
	* config/rs6000/rs6000-c.c: Include stor-layout.h.
	Include stringpool.h.
	* config/rs6000/rs6000.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include print-tree.h.
	Include varasm.h.
	* config/rx/rx.c: Include varasm.h.
	Include stor-layout.h.
	Include calls.h.
	* config/s390/s390.c: Include print-tree.h.
	Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/score/score.c: Include stringpool.h.
	Include calls.h.
	Include varasm.h.
	Include stor-layout.h.
	* config/sh/sh-c.c: Include stringpool.h.
	Include attribs.h.h.
	* config/sh/sh.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/sol2-c.c: Include stringpool.h.
	Include attribs.h.
	* config/sol2-cxx.c: Include stringpool.h.
	* config/sol2.c: Include stringpool.h.
	Include varasm.h.
	* config/sparc/sparc.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/spu/spu-c.c: Include stringpool.h.
	* config/spu/spu.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/stormy16/stormy16.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/tilegx/tilegx.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/tilepro/tilepro.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/v850/v850-c.c: Include stringpool.h.
	Include attribs.h.
	* config/v850/v850.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/vax/vax.c: Include calls.h.
	Include varasm.h.
	* config/vms/vms.c: Include stringpool.h.
	* config/vxworks.c: Include stringpool.h.
	* config/xtensa/xtensa.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* convert.c: Include stor-layout.h.
	* coverage.c: Include stringpool.h.
	Include stor-layout.h.
	* dbxout.c: Include varasm.h.
	Include stor-layout.h.
	* dojump.c: Include stor-layout.h.
	* dse.c: Include stor-layout.h.
	* dwarf2asm.c: Include stringpool.h.
	Include varasm.h.
	* dwarf2cfi.c: Include stor-layout.h.
	* dwarf2out.c: Include rtl.h.
	Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include function.h.
	Include emit-rtl.h.
	Move inclusion of rtl.h earlier in the file.
	* emit-rtl.c: Include varasm.h.
	* except.c: Include stringpool.h.
	Include stor-layout.h.
	* explow.c: Include stor-layout.h.
	* expmed.c: Include stor-layout.h.
	* expr.c: Include stringpool.h.
	Include stor-layout.h.
	Include attribs.h.
	Include varasm.h.
	* final.c: Include varasm.h.
	* fold-const.c: Include stor-layout.h.
	Include calls.h.
	Include tree-iterator.h.
	* function.c: Include stor-layout.h.
	Include varasm.h.
	Include stringpool.h.
	* genattrtab.c (write_header): Emit includes for varasm.h,
	stor-layout.h and calls.h.
	* genautomata.c (main): Likewise.
	* genemit.c: Likewise.
	* genopinit.c: Likewise.
	* genoutput.c (output_prologue): Likewise.
	* genpeep.c: Likewise.
	* genpreds.c (write_insn_preds_c): Likewise.
	* gengtype.c (open_base_files): Add stringpool.h.
	* gimple-expr.c: Include stringpool.h.
	Include stor-layout.h.
	* gimple-fold.c: Include stringpool.h.
	Include expr.h.
	Include stmt.h.
	Include stor-layout.h.
	* gimple-low.c: Include tree-nested.h.
	Include calls.h.
	* gimple-pretty-print.c: Include stringpool.h.
	* gimple-ssa-strength-reduction.c: Include stor-layout.h.
	Include expr.h.
	* gimple-walk.c: Include stmt.h.
	* gimple.c: Include calls.h.
	Include stmt.h.
	Include stor-layout.h.
	* gimplify.c: Include stringpool.h.
	Include calls.h.
	Include varasm.h.
	Include stor-layout.h.
	Include stmt.h.
	Include print-tree.h.
	Include expr.h.
	* gimplify-me.c: Include stmt.h
	Include stor-layout.h
	* internal-fn.c: Include stor-layout.h.
	* ipa-devirt.c: Include print-tree.h.
	Include calls.h.
	* ipa-inline-analysis.c: Include stor-layout.h.
	Include stringpool.h.
	Include print-tree.h.
	* ipa-inline.c: Include trans-mem.h.
	Include calls.h.
	* ipa-prop.c: Include expr.h.
	Include stor-layout.h.
	Include print-tree.h.
	* ipa-pure-const.c: Include print-tree.h.
	Include calls.h.
	* ipa-reference.c: Include calls.h.
	* ipa-split.c: Include stringpool.h.
	Include expr.h.
	Include calls.h.
	* ipa.c: Include calls.h.
	Include stringpool.h.
	* langhooks.c: Include stringpool.h.
	Include attribs.h.
	* lto-cgraph.c: Include stringpool.h.
	* lto-streamer-in.c: Include stringpool.h.
	* lto-streamer-out.c: Include stor-layout.h.
	Include stringpool.h.
	* omp-low.c: Include stringpool.h.
	Include stor-layout.h.
	Include expr.h.
	* optabs.c: Include stor-layout.h.
	Include stringpool.h.
	Include varasm.h.
	* passes.c: Include varasm.h.
	* predict.c: Include calls.h.
	* print-rtl.c: Include print-tree.h.
	* print-tree.c: Include varasm.h.
	Include print-rtl.h.
	Include stor-layout.h.
	* realmpfr.c: Include stor-layout.h.
	* reg-stack.c: Include varasm.h.
	* sdbout.c: Include varasm.h.
	Include stor-layout.h.
	* simplify-rtx.c: Include varasm.h.
	* stmt.c: Include varasm.h.
	Include stor-layout.h.
	* stor-layout.c: Include stor-layout.h.
	Include stringpool.h.
	Include varasm.h.
	Include print-tree.h.
	* symtab.c: Include rtl.h.
	Include print-tree.h.
	Include varasm.h.
	Include function.h.
	Include emit-rtl.h.
	* targhooks.c: Include stor-layout.h.
	Include varasm.h.
	* toplev.c: Include varasm.h.
	Include tree-inline.h.
	* trans-mem.c: Include calls.h.
	Include function.h.
	Include rtl.h.
	Include emit-rtl.h.
	* tree-affine.c: Include expr.h.
	* tree-browser.c: Include print-tree.h.
	* tree-call-cdce.c: Include stor-layout.h.
	* tree-cfg.c: Include trans-mem.h.
	Include stor-layout.h.
	Include print-tree.h.
	* tree-complex.c: Include stor-layout.h.
	* tree-data-ref.c: Include expr.h.
	* tree-dfa.c: Include stor-layout.h.
	* tree-eh.c: Include expr.h.
	Include calls.h.
	* tree-emutls.c: Include stor-layout.h.
	Include varasm.h.
	* tree-if-conv.c: Include stor-layout.h.
	* tree-inline.c: Include stor-layout.h.
	Include calls.h.
	* tree-loop-distribution.c: Include stor-layout.h.
	* tree-nested.c: Include stringpool.h.
	Include stor-layout.h.
	* tree-object-size.c: Include tree-object-size.h.
	* tree-outof-ssa.c: Include stor-layout.h.
	* tree-parloops.c: Include stor-layout.h.
	Include tree-nested.h.
	* tree-pretty-print.c: Include stor-layout.h.
	Include expr.h.
	* tree-profile.c: Include varasm.h.
	Include tree-nested.h.
	* tree-scalar-evolution.c: Include expr.h.
	* tree-sra.c: Include stor-layout.h.
	* tree-ssa-address.c: Include stor-layout.h.
	* tree-ssa-ccp.c: Include stor-layout.h.
	* tree-ssa-dce.c: Include calls.h.
	* tree-ssa-dom.c: Include stor-layout.h.
	* tree-ssa-forwprop.c: Include stor-layout.h.
	* tree-ssa-ifcombine.c: Include stor-layout.h.
	* tree-ssa-loop-ivopts.c: Include stor-layout.h.
	* tree-ssa-loop-niter.c: Include calls.h.
	Include expr.h.
	* tree-ssa-loop-prefetch.c: Include stor-layout.h.
	* tree-ssa-math-opts.c: Include stor-layout.h.
	* tree-ssa-operands.c: Include stmt.h.
	Include print-tree.h.
	* tree-ssa-phiopt.c: Include stor-layout.h.
	* tree-ssa-reassoc.c: Include stor-layout.h.
	* tree-ssa-sccvn.c: Include stor-layout.h.
	* tree-ssa-sink.c: Include stor-layout.h.
	* tree-ssa-strlen.c: Include stor-layout.h.
	* tree-ssa-structalias.c: Include stor-layout.h.
	Include stmt.h.
	* tree-ssa-tail-merge.c: Include stor-layout.h.
	Include trans-mem.h.
	* tree-ssa-uncprop.c: Include stor-layout.h.
	* tree-ssa.c: Include stor-layout.h.
	* tree-ssanames.c: Include stor-layout.h.
	* tree-streamer-in.c: Include stringpool.h.
	* tree-streamer-out.c: Include stor-layout.h.
	* tree-switch-conversion.c: Include varasm.h.
	Include stor-layout.h.
	* tree-tailcall.c: Include stor-layout.h.
	* tree-vect-data-refs.c: Include stor-layout.h.
	* tree-vect-generic.c: Include stor-layout.h.
	* tree-vect-loop.c: Include stor-layout.h.
	* tree-vect-patterns.c: Include stor-layout.h.
	* tree-vect-slp.c: Include stor-layout.h.
	* tree-vect-stmts.c: Include stor-layout.h.
	* tree-vectorizer.c: Include stor-layout.h.
	* tree-vrp.c: Include stor-layout.h.
	Include calls.h.
	* tree.c: Include stor-layout.h.
	Include calls.h.
	Include attribs.h.
	Include varasm.h.
	* tsan.c: Include expr.h.
	* ubsan.c: Include stor-layout.h.
	Include stringpool.h.
	* value-prof.c: Include tree-nested.h.
	Include calls.h.
	* var-tracking.c: Include varasm.h.
	Include stor-layout.h.
	* varasm.c: Include stor-layout.h.
	Include stringpool.h.
	Include gcc-symtab.h.
	Include varasm.h.
	* varpool.c: Include varasm.h.
	* vmsdbgout.c: Include varasm.h.
	* xcoffout.c: Include varasm.h.

ada/ChangeLog

	* gcc-interface/decl.c: Include stringpool.h
	Include stor-layout.h
	* gcc-interface/misc.c: Include stor-layout.h
	Include print-tree.h
	* gcc-interface/trans.c: Include stringpool.h
	Include stor-layout.h
	Include stmt.h
	Include varasm.h
	* gcc-interface/utils.c: Include stringpool.h
	Include stor-layout.h
	Include attribs.h
	Include varasm.h
	* gcc-interface/utils2.c: Include stringpool.h
	Include stor-layout.h
	Include attribs.h
	Include varasm.h

c-family/ChangeLog

	* c-common.c: Include fold-const.h.
	Include stor-layout.h.
	Include calls.h.
	Include stringpool.h.
	Include attribs.h.
	Include varasm.h.
	Include trans-mem.h.
	* c-cppbuiltin.c: Include stor-layout.h.
	Include stringpool.h.
	* c-format.c: Include stringpool.h.
	* c-lex.c: Include stringpool.h.
	Include stor-layout.h.
	* c-pragma.c: Include stringpool.h.
	Include attribs.h.
	Include varasm.h.
	Include gcc-symtab.h.
	* c-pretty-print.c: Include stor-layout.h.
	Include attribs.h.
	* cilk.c: Include stringpool.h.
	Include calls.h.

c/ChangeLog

	* c-decl.c: Include print-tree.h.
	Include stor-layout.h.
	Include varasm.h.
	Include attribs.h.
	Include stringpool.h.
	* c-lang.c: Include fold-const.h.
	* c-parser.c: Include stringpool.h.
	Include attribs.h.
	Include stor-layout.h.
	Include varasm.h.
	Include trans-mem.h.
	* c-typeck.c: Include stor-layout.h.
	Include trans-mem.h.
	Include varasm.h.
	Include stmt.h.

cp/ChangeLog

	* call.c: Include stor-layout.h.
	Include trans-mem.h.
	Include stringpool.h.
	* class.c: Include stringpool.h.
	Include stor-layout.h.
	Include attribs.h.
	* cp-gimplify.c: Include stor-layout.h.
	* cvt.c: Include stor-layout.h.
	* decl.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include attribs.h.
	Include calls.h.
	* decl2.c: Include stringpool.h.
	Include varasm.h.
	Include attribs.h.
	Include stor-layout.h.
	Include calls.h.
	* error.c: Include stringpool.h.
	* except.c: Include stringpool.h.
	Include trans-mem.h.
	Include attribs.h.
	* init.c: Include stringpool.h.
	Include varasm.h.
	* lambda.c: Include stringpool.h.
	* lex.c: Include stringpool.h.
	* mangle.c: Include stor-layout.h.
	Include stringpool.h.
	* method.c: Include stringpool.h.
	Include varasm.h.
	* name-lookup.c: Include stringpool.h.
	Include print-tree.h.
	Include attribs.h.
	* optimize.c: Include stringpool.h.
	* parser.c: Include print-tree.h.
	Include stringpool.h.
	Include attribs.h.
	Include trans-mem.h.
	* pt.c: Include stringpool.h.
	Include varasm.h.
	Include attribs.h.
	Include stor-layout.h.
	* ptree.c: Include print-tree.h.
	* repo.c: Include stringpool.h.
	* rtti.c: Include stringpool.h.
	Include stor-layout.h.
	* semantics.c: Include stmt.h.
	Include varasm.h.
	Include stor-layout.h.
	Include stringpool.h.
	* tree.c: Include stor-layout.h.
	Include print-tree.h.
	Include tree-iterator.h.
	* typeck.c: Include stor-layout.h.
	Include varasm.h.
	* typeck2.c: Include stor-layout.h.
	Include varasm.h.
	* vtable-class-hierarchy.c: Include stringpool.h.
	Include stor-layout.h.

fortran/ChangeLog

	* decl.c: Include stringpool.h.
	* iresolve.c: Include stringpool.h.
	* match.c: Include stringpool.h.
	* module.c: Include stringpool.h.
	* target-memory.c: Include stor-layout.h.
	* trans-common.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	* trans-const.c: Include stor-layout.h.
	* trans-decl.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include attribs.h.
	* trans-expr.c: Include stringpool.h.
	* trans-intrinsic.c: Include stringpool.h.
	Include tree-nested.h.
	Include stor-layout.h.
	* trans-io.c: Include stringpool.h.
	Include stor-layout.h.
	* trans-openmp.c: Include stringpool.h.
	* trans-stmt.c: Include stringpool.h.
	* trans-types.c: Include stor-layout.h.
	Include stringpool.h.
	* trans.c: Include stringpool.h.

go/ChangeLog

	* go-backend.c: Include stor-layout.h.
	* go-gcc.cc: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	* go-lang.c: Include stor-layout.h.

java/ChangeLog

	* builtins.c: Include stor-layout.h.
	Include stringpool.h.
	* class.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	* constants.c: Include stringpool.h.
	Include stor-layout.h.
	* decl.c: Include stor-layout.h.
	Include stringpool.h.
	Include varasm.h.
	* except.c: Include stringpool.h.
	Include stor-layout.h.
	* expr.c: Include stringpool.h.
	Include stor-layout.h.
	* jcf-parse.c: Include stringpool.h.
	* mangle.c: Include stringpool.h.
	* resource.c: Include stringpool.h.
	Include stor-layout.h.
	* typeck.c: Include stor-layout.h.
	Include stringpool.h.
	* verify-glue.c: Include stringpool.h.

lto/ChangeLog
	* lto-lang.c: Include stringpool.h.
	Include stor-layout.h.
	* lto-partition.c: Include gcc-symtab.h.
	* lto.c: Include stor-layout.h.

objc/ChangeLog
	* objc-act.c: Include stringpool.h.
	Include stor-layout.h.
	Include attribs.h.
	* objc-encoding.c: Include stringpool.h.
	Include stor-layout.h.
	* objc-gnu-runtime-abi-01.c: Include stringpool.h.
	* objc-next-runtime-abi-01.c:
	Include stringpool.h.
	* objc-next-runtime-abi-02.c: Include stringpool.h.
	* objc-runtime-shared-support.c: Include stringpool.h.

testsuite/ChangeLog

	* gcc.dg/plugin/selfassign.c: Include stringpool.h.
	* gcc.dg/plugin/start_unit_plugin.c: Likewise.

From-SVN: r205023
2013-11-19 07:31:09 -05:00
Trevor Saunders fec39fa6b0 remove nolonger needed {cgraph,varpool}_node_{,asm_}name () functions
From-SVN: r204946
2013-11-18 12:18:12 +00:00
David Malcolm 5e20cdc96e Automated part of renaming of symtab_node_base to symtab_node.
gcc/

	Patch autogenerated by rename_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622
	with ChangeLog entry fixed up by hand.

	* cgraph.c (x_cgraph_nodes_queue): Rename symtab_node_base to
	symtab_node.
	(cgraph_node_for_asm): Likewise.
	* cgraph.h (symtab_node_base): Likewise.
	(cgraph_node): Likewise.
	(varpool_node): Likewise.
	(is_a_helper <cgraph_node>::test): Likewise.
	(is_a_helper <varpool_node>::test): Likewise.
	(symtab_nodes): Likewise.
	(symtab_register_node): Likewise.
	(symtab_unregister_node): Likewise.
	(symtab_remove_node): Likewise.
	(symtab_get_node): Likewise.
	(symtab_node_for_asm): Likewise.
	(symtab_node_asm_name): Likewise.
	(symtab_node_name): Likewise.
	(symtab_insert_node_to_hashtable): Likewise.
	(symtab_add_to_same_comdat_group): Likewise.
	(symtab_dissolve_same_comdat_group_list): Likewise.
	(dump_symtab_node): Likewise.
	(debug_symtab_node): Likewise.
	(dump_symtab_base): Likewise.
	(verify_symtab_node): Likewise.
	(verify_symtab_base): Likewise.
	(symtab_used_from_object_file_p): Likewise.
	(symtab_alias_ultimate_target): Likewise.
	(symtab_resolve_alias): Likewise.
	(fixup_same_cpp_alias_visibility): Likewise.
	(symtab_for_node_and_aliases): Likewise.
	(symtab_nonoverwritable_alias): Likewise.
	(availability symtab_node_availability): Likewise.
	(symtab_semantically_equivalent_p): Likewise.
	(fixup_same_cpp_alias_visibility): Likewise.
	(symtab_prevail_in_asm_name_hash): Likewise.
	(cgraph): Likewise.
	(varpool): Likewise.
	(varpool_first_variable): Likewise.
	(varpool_next_variable): Likewise.
	(varpool_first_static_initializer): Likewise.
	(varpool_next_static_initializer): Likewise.
	(varpool_first_defined_variable): Likewise.
	(varpool_next_defined_variable): Likewise.
	(cgraph_first_defined_function): Likewise.
	(cgraph_next_defined_function): Likewise.
	(cgraph_first_function): Likewise.
	(cgraph_next_function): Likewise.
	(cgraph_first_function_with_gimple_body): Likewise.
	(cgraph_next_function_with_gimple_body): Likewise.
	(symtab_alias_target): Likewise.
	(symtab_real_symbol_p): Likewise.
	(symtab_can_be_discarded): Likewise.
	* cgraphbuild.c (mark_address): Likewise.
	(mark_load): Likewise.
	(mark_store): Likewise.
	* cgraphunit.c (decide_is_symbol_needed): Likewise.
	(first): Likewise.
	(enqueue_node): Likewise.
	(referred_to_p): Likewise.
	(cgraph_process_same_body_aliases): Likewise.
	(analyze_functions): Likewise.
	(handle_alias_pairs): Likewise.
	(output_weakrefs): Likewise.
	(compile): Likewise.
	* gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise.
	* ipa-inline-analysis.c (inline_write_summary): Likewise.
	* ipa-prop.c (remove_described_reference): Likewise.
	(try_decrement_rdesc_refcount): Likewise.
	(ipa_edge_duplication_hook): Likewise.
	* ipa-ref.c (ipa_record_reference): Likewise.
	(ipa_maybe_record_reference): Likewise.
	(ipa_clone_ref): Likewise.
	(ipa_clone_references): Likewise.
	(ipa_clone_referring): Likewise.
	(ipa_find_reference): Likewise.
	(ipa_remove_stmt_references): Likewise.
	(ipa_clear_stmts_in_references): Likewise.
	* ipa-ref.h (symtab_node_base): Likewise.
	(ipa_ref): Likewise.
	(ipa_record_reference): Likewise.
	(ipa_maybe_record_reference): Likewise.
	(ipa_clone_references): Likewise.
	(ipa_clone_referring): Likewise.
	(ipa_clone_ref): Likewise.
	(ipa_find_reference): Likewise.
	(ipa_remove_stmt_references): Likewise.
	(ipa_clear_stmts_in_references): Likewise.
	* ipa-reference.c (ipa_reference_write_optimization_summary):
	Likewise.
	* ipa.c (enqueue_node): Likewise.
	(process_references): Likewise.
	(walk_polymorphic_call_targets): Likewise.
	(symtab_remove_unreachable_nodes): Likewise.
	(address_taken_from_non_vtable_p): Likewise.
	(comdat_can_be_unshared_p_1): Likewise.
	(comdat_can_be_unshared_p): Likewise.
	(can_replace_by_local_alias): Likewise.
	(function_and_variable_visibility): Likewise.
	* is-a.h: Likewise (within example in comment).
	* lto-cgraph.c (input_cgraph_opt_summary): Likewise.
	(lto_symtab_encoder_encode): Likewise.
	(lto_symtab_encoder_delete_node): Likewise.
	(lto_symtab_encoder_in_partition_p): Likewise.
	(lto_set_symtab_encoder_in_partition): Likewise.
	(output_refs): Likewise.
	(compute_ltrans_boundary): Likewise.
	(output_symtab): Likewise.
	(input_node): Likewise.
	(input_ref): Likewise.
	(input_edge): Likewise.
	(input_cgraph_1): Likewise.
	(input_refs): Likewise.
	(output_cgraph_opt_summary): Likewise.
	(input_node_opt_summary): Likewise.
	(input_cgraph_opt_section): Likewise.
	* lto-section-in.c (lto_free_function_in_decl_state_for_node):
	Likewise.
	* lto-streamer-out.c (lto_output): Likewise.
	(output_symbol_p): Likewise.
	(produce_symtab): Likewise.
	* lto-streamer.h (lto_encoder_entry): Likewise.
	(lto_free_function_in_decl_state_for_node): Likewise.
	(lto_symtab_encoder_encode): Likewise.
	(lto_symtab_encoder_delete_node): Likewise.
	(lto_symtab_encoder_in_partition_p): Likewise.
	(lto_set_symtab_encoder_in_partition): Likewise.
	(lto_symtab_encoder_lookup): Likewise.
	(lsei_node): Likewise.
	(lto_symtab_encoder_deref): Likewise.
	* symtab.c (symtab_hash): Likewise.
	(assembler_name_hash): Likewise.
	(symtab_nodes): Likewise.
	(hash_node): Likewise.
	(eq_node): Likewise.
	(hash_node_by_assembler_name): Likewise.
	(eq_assembler_name): Likewise.
	(insert_to_assembler_name_hash): Likewise.
	(unlink_from_assembler_name_hash): Likewise.
	(symtab_prevail_in_asm_name_hash): Likewise.
	(symtab_register_node): Likewise.
	(symtab_insert_node_to_hashtable): Likewise.
	(symtab_unregister_node): Likewise.
	(symtab_get_node): Likewise.
	(symtab_remove_node): Likewise.
	(symtab_initialize_asm_name_hash): Likewise.
	(symtab_node_for_asm): Likewise.
	(symtab_add_to_same_comdat_group): Likewise.
	(symtab_dissolve_same_comdat_group_list): Likewise.
	(symtab_node_asm_name): Likewise.
	(symtab_node_name): Likewise.
	(dump_symtab_base): Likewise.
	(dump_symtab_node): Likewise.
	(dump_symtab): Likewise.
	(debug_symtab_node): Likewise.
	(verify_symtab_base): Likewise.
	(verify_symtab_node): Likewise.
	(verify_symtab): Likewise.
	(symtab_used_from_object_file_p): Likewise.
	(symtab_node_availability): Likewise.
	(symtab_alias_ultimate_target): Likewise.
	(fixup_same_cpp_alias_visibility): Likewise.
	(symtab_resolve_alias): Likewise.
	(symtab_for_node_and_aliases): Likewise.
	(symtab_for_node_and_aliases): Likewise.
	(symtab_nonoverwritable_alias_1): Likewise.
	(symtab_nonoverwritable_alias): Likewise.
	(symtab_semantically_equivalent_p): Likewise.
	* value-prof.c (init_node_map): Likewise.
	* varasm.c (find_decl): Likewise.
	* varpool.c (varpool_node_for_asm): Likewise.
	(varpool_remove_unreferenced_decls): Likewise.

gcc/c-family/

	Patch autogenerated by rename_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* c-pragma.c (maybe_apply_pending_pragma_weaks): Rename
	symtab_node_base to symtab_node.

gcc/lto/

	Patch autogenerated by rename_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* lto-partition.c (add_symbol_to_partition): Rename
	symtab_node_base to symtab_node.
	(get_symbol_class): Likewise.
	(symbol_partitioned_p): Likewise.
	(add_references_to_partition): Likewise.
	(add_symbol_to_partition_1): Likewise.
	(contained_in_symbol): Likewise.
	(add_symbol_to_partition): Likewise.
	(lto_1_to_1_map): Likewise.
	(lto_max_map): Likewise.
	(lto_balanced_map): Likewise.
	(privatize_symbol_name): Likewise.
	(promote_symbol): Likewise.
	(may_need_named_section_p): Likewise.
	(rename_statics): Likewise.
	(lto_promote_statics_nonwpa): Likewise.
	* lto-symtab.c (lto_symtab_merge): Likewise.
	(lto_symtab_resolve_replaceable_p): Likewise.
	(lto_symtab_symbol_p): Likewise.
	(lto_symtab_resolve_can_prevail_p): Likewise.
	(lto_symtab_resolve_symbols): Likewise.
	(lto_symtab_merge_decls_2): Likewise.
	(lto_symtab_merge_decls_1): Likewise.
	(lto_symtab_merge_decls): Likewise.
	(lto_symtab_merge_symbols_1): Likewise.
	(lto_symtab_merge_symbols): Likewise.
	(lto_symtab_prevailing_decl): Likewise.
	* lto.c (lto_wpa_write_files): Likewise.
	(read_cgraph_and_symbols): Likewise.
	(do_whole_program_analysis): Likewise.

From-SVN: r204279
2013-10-31 21:26:14 +00:00
David Malcolm 378cd6b1e3 Split symtab_node declarations onto multiple lines
gcc/
	* cgraphunit.c (analyze_functions): Split symtab_node
	declarations onto multiple lines to make things easier
	for rename_symtab.py.

	* symtab.c (symtab_dissolve_same_comdat_group_list): Likewise.
	(symtab_semantically_equivalent_p): Likewise.

gcc/lto
	* lto-symtab.c (lto_symtab_merge_decls_2): Split symtab_node
	declarations onto multiple lines to make things easier for
	rename_symtab.py.
	(lto_symtab_merge_decls_1): Likewise.
	(lto_symtab_merge_symbols_1): Likewise.

From-SVN: r204216
2013-10-30 15:58:45 +00:00
Balaji V. Iyer 939b37da6d Added _Cilk_spawn and _Cilk_sync (2 cilk keywords) for C.
gcc/ChangeLog:
2013-10-29  Balaji V. Iyer  <balaji.v.iyer@intel.com>

	* builtins.c (is_builtin_name): Added a check for __cilkrts_detach and
	__cilkrts_pop_frame.  If matched, then return true for built-in
	function name.
	(expand_builtin): Added BUILT_IN_CILK_DETACH and
	BUILT_IN_CILK_POP_FRAME case.
	* langhooks-def.h (lhd_install_body_with_frame_cleanup): New prototype.
	(lhs_cilk_detect_spawn): Likewise.
	(LANG_HOOKS_DECLS): Added LANG_HOOKS_CILKPLUS.
	(LANG_HOOKS_CILKPLUS_DETECT_SPAWN_AND_UNWRAP): New #define.
	(LANG_HOOKS_CILKPLUS_FRAME_CLEANUP): Likewise.
	(LANG_HOOKS_CILKPLUS_GIMPLIFY_SPAWN): Likewise.
	(LANG_HOOKS_CILKPLUS): Likewise.
	* tree.h (CILK_SPAWN_FN): Likewise.
	* builtin.def (DEF_CILK_BUILTIN_STUB): Likewise.
	* Makefile.in (C_COMMON_OBJS): Added c-family/cilk.o.
	(OBJS): Added cilk-common.o.
	(CILK_H): Added a new define.
	(gimplify.o): Added CILK_H into dependency list.
	(builtins.o): Likewise.
	(ipa-inline.o): Likewise.
	(ipa-inline-analysis.o): Likewise.
	(BUILTINS_DEF): Added cilk-builtins.def.
	* langhooks.c (lhd_install_body_with_frame_cleanup): New function.
	(lhd_cilk_detect_spawn): Likewise.
	* langhooks.h (lang_hooks_for_cilkplus): New struct.
	(struct lang_hooks): Added new field called "cilkplus."
	* cilk-common.c: New file.
	* cilk.h: Likewise.
	* cilk-builtins.def: Likewise.
	* cppbuiltin.c (define_builtin_macros_for_compilation_flags): Added
	"__cilk" macro and set it to 200.
	* function.h (struct function::cilk_frame_decl): New field.
	(struct function::is_cilk_function): Likewise.
	(struct function::calls_cilk_spawn): Likewise.
	* gimplify.c (gimplify_call_expr): Added a check if the function call
	being gimplified is a spawn detach point.  If so, then add pop_frame
	and detach function calls.
	(gimplify_expr): Added a CILK_SPAWN_STMT and CILK_SYNC_STMT case
	for gimplifying _Cilk_spawn and _Cilk_sync statements.
	(gimplify_return_expr): Added a check for _Cilk_spawn usage in
	function.  If so, added a _Cilk_sync and gimplified it.
	(gimplify_modify_expr): Added a check for _Cilk_spawn in MODIFY and
	INIT_EXPRs.  If so, then call gimplify_cilk_spawn.
	* ipa-inline-analysis (initialize_inline_failed): Prevent inlining of
	spawner function.
	(can_inline_edge_p): Prevent inling of spawnee function.
	* ira.c (ira_setup_eliminable_regset): Force usage of frame pointer
	for functions that use Cilk keywords.
	* tree-inline.h (struct copy_body_data::remap_var_for_cilk): New field.
	* tree-pretty-print.c (dump_generic_node): Added CILK_SPAWN_STMT and
	CILK_SYNC_STMT cases.
	* tree.def (DEFTREECODE): Added CILK_SPAWN_STMT and CILK_SYNC_STMT
	trees.
	* generic.texi (CILK_SPAWN_STMT): Added documentation for _Cilk_spawn.
	(CILK_SYNC_STMT): Added documentation for _Cilk_sync.
	* passes.texi (Cilk Keywords): New section that describes the compiler
	code changes for handling Cilk Keywords.

gcc/c/ChangeLog:
2013-10-29  Balaji V. Iyer  <balaji.v.iyer@intel.com>

	* c-decl.c (finish_function): Added a call for insert_cilk_frame when
	a spawning function is found.
	* c-objc-common.h (LANG_HOOKS_CILKPLUS_GIMPLIFY_SPAWN): New #define.
	(LANG_HOOKS_CILKPLUS_FRAME_CLEANUP): Likewise.
	(LANG_HOOKS_CILKPLUS_DETECT_SPAWN_AND_UNWRAP): Likewise.
	* c-parser.c (c_parser_statement_after_labels): Added RID_CILK_SYNC
	case.
	(c_parser_postfix_expression): Added RID_CILK_SPAWN case.
	* c-typeck.c (build_compound_expr): Reject _Cilk_spawn in a comma
	expr.
	(c_finish_return): Added a check to reject _Cilk_spawn in return
	expression.
	(build_cilk_spawn): New function.
	(build_cilk_sync): Likewise.
	* Makefile.in (c-decl.o): Added cilk.h in dependency list.

gcc/c-family/ChangeLog
2013-10-29  Balaji V. Iyer  <balaji.v.iyer@intel.com>

	* c-common.c (c_common_reswords[]): Added _Cilk_spawn and _Cilk_sync
	fields.
	(c_define_builtins): Called cilk_init_builtins if Cilk Plus is
	enabled.
	* c-common.h (enum rid): Added RID_CILK_SPAWN and RID_CILK_SYNC.
	(insert_cilk_frame): New prototype.
	(cilk_init_builtins): Likewise.
	(gimplify_cilk_spawn): Likewise.
	(c_cilk_install_body_w_frame_cleanup): Likewise.
	(cilk_detect_spawn_and_unwrap): Likewise.
	(cilk_set_spawn_marker): Likewise.
	(build_cilk_sync): Likewise.
	(build_cilk_spawn): Likewise.
	* cilk.c: New file.

gcc/lto/ChangeLog
2013-10-29  Balaji V. Iyer  <balaji.v.iyer@intel.com>

	* Make-lang.in (lto/lto-lang.o): Added cilk.h in dependency list.
	* lto-lang.c (lto_init): Added a call to cilk_init_builtins if Cilk
	Plus is enabled.

gcc/testsuite/ChangeLog
2013-10-29  Balaji V. Iyer  <balaji.v.iyer@intel.com>

	* c-c++-common/cilk-plus/CK/compound_cilk_spawn.c: New test.
	* c-c++-common/cilk-plus/CK/concec_cilk_spawn.c: Likewise.
	* c-c++-common/cilk-plus/CK/fib.c: Likewise.
	* c-c++-common/cilk-plus/CK/no_args_error.c: Likewise.
	* c-c++-common/cilk-plus/CK/spawnee_inline.c: Likewise.
	* c-c++-common/cilk-plus/CK/spawner_inline.c: Likewise.
	* c-c++-common/cilk-plus/CK/spawning_arg.c: Likewise.
	* c-c++-common/cilk-plus/CK/steal_check.c: Likewise.
	* c-c++-common/cilk-plus/CK/test__cilk.c: Likewise.
	* c-c++-common/cilk-plus/CK/varargs_test.c: Likewise.
	* c-c++-common/cilk-plus/CK/sync_wo_spawn.c: Likewise.
	* c-c++-common/cilk-plus/CK/invalid_spawn.c: Likewise.
	* c-c++-common/cilk-plus/CK/spawn_in_return.c: Likewise.
	* c-c++-common/cilk-plus/CK/fib_init_expr_xy.c: Likewise.
	* c-c++-common/cilk-plus/CK/fib_no_sync.c: Likewise.
	* c-c++-common/cilk-plus/CK/fib_no_return.c: Likewise.
	* gcc.dg/cilk-plus/cilk-plus.exp: Added support to run Cilk Keywords
	test stored in c-c++-common.  Also, added the Cilk runtime's library
	to the ld_library_path.

From-SVN: r204172
2013-10-29 11:36:31 -07:00
David Malcolm 67348ccc9c Autogenerated fixes of "->symbol." to "->"
This is the autogenerated part of the conversion of the symtable types
to a C++ class hierarchy.

gcc/

	Patch autogenerated by refactor_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* asan.c (asan_finish_file): Update for conversion of symtab types to
	a true class hierarchy.
	* cfgexpand.c (estimated_stack_frame_size): Likewise.
	* cgraph.c (cgraph_get_body): Likewise.
	(cgraph_get_create_real_symbol_node): Likewise.
	(verify_cgraph_node): Likewise.
	(verify_edge_corresponds_to_fndecl): Likewise.
	(verify_edge_count_and_frequency): Likewise.
	(cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise.
	(cgraph_can_remove_if_no_direct_calls_p): Likewise.
	(cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise.
	(cgraph_node_cannot_return): Likewise.
	(cgraph_set_pure_flag_1): Likewise.
	(cgraph_set_const_flag_1): Likewise.
	(cgraph_set_nothrow_flag_1): Likewise.
	(cgraph_make_node_local_1): Likewise.
	(cgraph_for_node_and_aliases): Likewise.
	(cgraph_for_node_thunks_and_aliases): Likewise.
	(cgraph_node_can_be_local_p): Likewise.
	(cgraph_node_cannot_be_local_p_1): Likewise.
	(cgraph_function_body_availability): Likewise.
	(dump_cgraph_node): Likewise.
	(cgraph_rtl_info): Likewise.
	(cgraph_mark_address_taken_node): Likewise.
	(cgraph_remove_node): Likewise.
	(cgraph_release_function_body): Likewise.
	(cgraph_update_edges_for_call_stmt_node): Likewise.
	(cgraph_redirect_edge_call_stmt_to_callee): Likewise.
	(cgraph_make_edge_direct): Likewise.
	(cgraph_resolve_speculation): Likewise.
	(cgraph_speculative_call_info): Likewise.
	(cgraph_turn_edge_to_speculative): Likewise.
	(cgraph_create_edge_1): Likewise.
	(cgraph_set_call_stmt): Likewise.
	(cgraph_node_for_asm): Likewise.
	(cgraph_add_thunk): Likewise.
	(cgraph_same_body_alias): Likewise.
	(cgraph_create_function_alias): Likewise.
	(cgraph_create_node): Likewise.
	(cgraph_create_empty_node): Likewise.
	(record_function_versions): Likewise.
	(used_from_object_file_p): Likewise.
	* cgraph.h (symtab_can_be_discarded): Likewise.
	(symtab_real_symbol_p): Likewise.
	(cgraph_mark_force_output_node): Likewise.
	(cgraph_edge_recursive_p): Likewise.
	(symtab_alias_target): Likewise.
	(varpool_all_refs_explicit_p): Likewise.
	(varpool_can_remove_if_no_refs): Likewise.
	(cgraph_only_called_directly_or_aliased_p): Likewise.
	(cgraph_next_function_with_gimple_body): Likewise.
	(cgraph_first_function_with_gimple_body): Likewise.
	(cgraph_function_with_gimple_body_p): Likewise.
	(cgraph_next_function): Likewise.
	(cgraph_first_function): Likewise.
	(cgraph_next_defined_function): Likewise.
	(cgraph_first_defined_function): Likewise.
	(varpool_next_defined_variable): Likewise.
	(varpool_first_defined_variable): Likewise.
	(varpool_next_static_initializer): Likewise.
	(varpool_first_static_initializer): Likewise.
	(varpool_next_variable): Likewise.
	(varpool_first_variable): Likewise.
	(varpool_node_name): Likewise.
	(varpool): Likewise.
	(cgraph): Likewise.
	(is_a_helper <varpool_node>::test): Likewise.
	(is_a_helper <cgraph_node>::test): Likewise.
	(varpool_variable_node): Likewise.
	(cgraph_function_or_thunk_node): Likewise.
	(varpool_alias_target): Likewise.
	(cgraph_alias_target): Likewise.
	(cgraph_node_name): Likewise.
	(varpool_node_asm_name): Likewise.
	(cgraph_node_asm_name): Likewise.
	* cgraphbuild.c (remove_cgraph_callee_edges): Likewise.
	(cgraph_rebuild_references): Likewise.
	(rebuild_cgraph_edges): Likewise.
	(record_eh_tables): Likewise.
	(build_cgraph_edges): Likewise.
	(mark_store): Likewise.
	(mark_load): Likewise.
	(mark_address): Likewise.
	(record_type_list): Likewise.
	(record_reference): Likewise.
	* cgraphclones.c (cgraph_materialize_all_clones): Likewise.
	(cgraph_materialize_clone): Likewise.
	(cgraph_function_versioning): Likewise.
	(cgraph_copy_node_for_versioning): Likewise.
	(update_call_expr): Likewise.
	(cgraph_find_replacement_node): Likewise.
	(cgraph_create_virtual_clone): Likewise.
	(cgraph_clone_node): Likewise.
	* cgraphunit.c (compile): Likewise.
	(output_weakrefs): Likewise.
	(output_in_order): Likewise.
	(expand_function): Likewise.
	(assemble_thunks_and_aliases): Likewise.
	(expand_thunk): Likewise.
	(mark_functions_to_output): Likewise.
	(handle_alias_pairs): Likewise.
	(analyze_functions): Likewise.
	(walk_polymorphic_call_targets): Likewise.
	(varpool_finalize_decl): Likewise.
	(process_function_and_variable_attributes): Likewise.
	(cgraph_process_same_body_aliases): Likewise.
	(analyze_function): Likewise.
	(cgraph_add_new_function): Likewise.
	(cgraph_finalize_function): Likewise.
	(referred_to_p): Likewise.
	(cgraph_reset_node): Likewise.
	(cgraph_process_new_functions): Likewise.
	(enqueue_node): Likewise.
	(decide_is_symbol_needed): Likewise.
	* coverage.c (coverage_compute_profile_id): Likewise.
	* dbxout.c (dbxout_expand_expr): Likewise.
	* dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise.
	(reference_to_unused): Likewise.
	* gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise.
	* gimplify.c (unvisit_body): Likewise.
	(unshare_body): Likewise.
	* ipa-cp.c (ipcp_generate_summary): Likewise.
	(ipcp_decision_stage): Likewise.
	(identify_dead_nodes): Likewise.
	(decide_whether_version_node): Likewise.
	(decide_about_value): Likewise.
	(perhaps_add_new_callers): Likewise.
	(create_specialized_node): Likewise.
	(update_profiling_info): Likewise.
	(ipcp_propagate_stage): Likewise.
	(estimate_local_effects): Likewise.
	(good_cloning_opportunity_p): Likewise.
	(devirtualization_time_bonus): Likewise.
	(propagate_constants_accross_call): Likewise.
	(initialize_node_lattices): Likewise.
	(ipcp_cloning_candidate_p): Likewise.
	(determine_versionability): Likewise.
	(print_all_lattices): Likewise.
	(print_lattice): Likewise.
	(ipcp_discover_new_direct_edges): Likewise.
	* ipa-devirt.c (ipa_devirt): Likewise.
	(likely_target_p): Likewise.
	(update_type_inheritance_graph): Likewise.
	(possible_polymorphic_call_target_p): Likewise.
	(dump_possible_polymorphic_call_targets): Likewise.
	(devirt_variable_node_removal_hook): Likewise.
	(record_binfo): Likewise.
	(maybe_record_node): Likewise.
	(build_type_inheritance_graph): Likewise.
	* ipa-inline-analysis.c (inline_write_summary): Likewise.
	(inline_generate_summary): Likewise.
	(inline_analyze_function): Likewise.
	(do_estimate_growth): Likewise.
	(simple_edge_hints): Likewise.
	(estimate_node_size_and_time): Likewise.
	(estimate_edge_devirt_benefit): Likewise.
	(compute_inline_parameters): Likewise.
	(estimate_function_body_sizes): Likewise.
	(compute_bb_predicates): Likewise.
	(initialize_inline_failed): Likewise.
	(dump_inline_summary): Likewise.
	(dump_inline_edge_summary): Likewise.
	* ipa-inline-transform.c (inline_transform): Likewise.
	(preserve_function_body_p): Likewise.
	(save_inline_function_body): Likewise.
	(inline_call): Likewise.
	(clone_inlined_nodes): Likewise.
	(can_remove_node_now_p): Likewise.
	(can_remove_node_now_p_1): Likewise.
	* ipa-inline.c (early_inliner): Likewise.
	(early_inline_small_functions): Likewise.
	(inline_always_inline_functions): Likewise.
	(ipa_inline): Likewise.
	(flatten_function): Likewise.
	(inline_small_functions): Likewise.
	(speculation_useful_p): Likewise.
	(recursive_inlining): Likewise.
	(update_caller_keys): Likewise.
	(reset_edge_caches): Likewise.
	(update_edge_key): Likewise.
	(edge_badness): Likewise.
	(relative_time_benefit): Likewise.
	(want_inline_self_recursive_call_p): Likewise.
	(want_inline_small_function_p): Likewise.
	(want_early_inline_function_p): Likewise.
	(num_calls): Likewise.
	(can_early_inline_edge_p): Likewise.
	(can_inline_edge_p): Likewise.
	(report_inline_failed_reason): Likewise.
	* ipa-profile.c (ipa_profile): Likewise.
	(ipa_propagate_frequency): Likewise.
	(ipa_propagate_frequency_1): Likewise.
	(ipa_profile_generate_summary): Likewise.
	* ipa-prop.c (ipcp_transform_function): Likewise.
	(read_replacements_section): Likewise.
	(ipa_prop_read_section): Likewise.
	(ipa_modify_call_arguments): Likewise.
	(ipa_print_node_params): Likewise.
	(propagate_controlled_uses): Likewise.
	(update_indirect_edges_after_inlining): Likewise.
	(remove_described_reference): Likewise.
	(ipa_make_edge_direct_to_target): Likewise.
	(ipa_analyze_node): Likewise.
	(ipa_analyze_params_uses): Likewise.
	(ipa_compute_jump_functions): Likewise.
	(ipa_get_callee_param_type): Likewise.
	(ipa_print_node_jump_functions): Likewise.
	(ipa_initialize_node_params): Likewise.
	(ipa_populate_param_decls): Likewise.
	(ipa_func_spec_opts_forbid_analysis_p): Likewise.
	(write_agg_replacement_chain): Likewise.
	(ipa_write_node_info): Likewise.
	(ipa_edge_duplication_hook): Likewise.
	(try_decrement_rdesc_refcount): Likewise.
	* ipa-pure-const.c (propagate_nothrow): Likewise.
	(propagate_pure_const): Likewise.
	(pure_const_read_summary): Likewise.
	(pure_const_write_summary): Likewise.
	(analyze_function): Likewise.
	* ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise.
	(ipa_ref_referring_ref_list): Likewise.
	* ipa-ref.c (ipa_clear_stmts_in_references): Likewise.
	(ipa_remove_stmt_references): Likewise.
	(ipa_find_reference): Likewise.
	(ipa_dump_referring): Likewise.
	(ipa_dump_references): Likewise.
	(ipa_record_reference): Likewise.
	* ipa-reference.c (ipa_reference_read_optimization_summary): Likewise.
	(ipa_reference_write_optimization_summary): Likewise.
	(write_node_summary_p): Likewise.
	(propagate): Likewise.
	(read_write_all_from_decl): Likewise.
	(generate_summary): Likewise.
	(analyze_function): Likewise.
	(propagate_bits): Likewise.
	(ipa_reference_get_not_written_global): Likewise.
	(ipa_reference_get_not_read_global): Likewise.
	* ipa-split.c (execute_split_functions): Likewise.
	(split_function): Likewise.
	* ipa-utils.c (ipa_merge_profiles): Likewise.
	(dump_cgraph_node_set): Likewise.
	(ipa_reverse_postorder): Likewise.
	(ipa_edge_within_scc): Likewise.
	(ipa_get_nodes_in_cycle): Likewise.
	(ipa_free_postorder_info): Likewise.
	(ipa_reduced_postorder): Likewise.
	(searchc): Likewise.
	(recursive_call_p): Likewise.
	* ipa.c (ipa_cdtor_merge): Likewise.
	(record_cdtor_fn): Likewise.
	(function_and_variable_visibility): Likewise.
	(varpool_externally_visible_p): Likewise.
	(cgraph_externally_visible_p): Likewise.
	(comdat_can_be_unshared_p): Likewise.
	(comdat_can_be_unshared_p_1): Likewise.
	(address_taken_from_non_vtable_p): Likewise.
	(ipa_discover_readonly_nonaddressable_vars): Likewise.
	(symtab_remove_unreachable_nodes): Likewise.
	(walk_polymorphic_call_targets): Likewise.
	(process_references): Likewise.
	(enqueue_node): Likewise.
	(has_addr_references_p): Likewise.
	(cgraph_non_local_node_p_1): Likewise.
	* is-a.h (varpool_analyze_node): Likewise.
	* lto-cgraph.c (input_symtab): Likewise.
	(merge_profile_summaries): Likewise.
	(input_cgraph_1): Likewise.
	(input_edge): Likewise.
	(input_varpool_node): Likewise.
	(input_node): Likewise.
	(input_overwrite_node): Likewise.
	(compute_ltrans_boundary): Likewise.
	(output_refs): Likewise.
	(lto_output_varpool_node): Likewise.
	(lto_output_node): Likewise.
	(reachable_from_other_partition_p): Likewise.
	(referenced_from_other_partition_p): Likewise.
	(lto_output_edge): Likewise.
	(output_node_opt_summary): Likewise.
	(add_node_to): Likewise.
	(reachable_from_this_partition_p): Likewise.
	(lto_set_symtab_encoder_in_partition): Likewise.
	(lto_symtab_encoder_in_partition_p): Likewise.
	(lto_set_symtab_encoder_encode_initializer): Likewise.
	(lto_symtab_encoder_encode_initializer_p): Likewise.
	(lto_set_symtab_encoder_encode_body): Likewise.
	(lto_symtab_encoder_encode_body_p): Likewise.
	* lto-section-in.c (lto_free_function_in_decl_state_for_node):
	Likewise.
	* lto-streamer-in.c (lto_read_body): Likewise.
	(fixup_call_stmt_edges): Likewise.
	(fixup_call_stmt_edges_1): Likewise.
	* lto-streamer-out.c (produce_symtab): Likewise.
	(output_symbol_p): Likewise.
	(write_symbol): Likewise.
	(lto_output): Likewise.
	(copy_function): Likewise.
	(output_function): Likewise.
	* passes.c (function_called_by_processed_nodes_p): Likewise.
	(ipa_write_optimization_summaries): Likewise.
	(ipa_write_summaries): Likewise.
	(do_per_function_toporder): Likewise.
	(do_per_function): Likewise.
	(dump_passes): Likewise.
	* symtab.c (symtab_semantically_equivalent_p): Likewise.
	(symtab_nonoverwritable_alias): Likewise.
	(symtab_nonoverwritable_alias_1): Likewise.
	(symtab_for_node_and_aliases): Likewise.
	(symtab_resolve_alias): Likewise.
	(fixup_same_cpp_alias_visibility): Likewise.
	(symtab_alias_ultimate_target): Likewise.
	(symtab_used_from_object_file_p): Likewise.
	(verify_symtab_base): Likewise.
	(dump_symtab_base): Likewise.
	(symtab_node_name): Likewise.
	(symtab_node_asm_name): Likewise.
	(symtab_dissolve_same_comdat_group_list): Likewise.
	(symtab_add_to_same_comdat_group): Likewise.
	(symtab_unregister_node): Likewise.
	(symtab_insert_node_to_hashtable): Likewise.
	(symtab_register_node): Likewise.
	(unlink_from_assembler_name_hash): Likewise.
	(insert_to_assembler_name_hash): Likewise.
	(eq_assembler_name): Likewise.
	(hash_node_by_assembler_name): Likewise.
	(eq_node): Likewise.
	(hash_node): Likewise.
	* toplev.c (wrapup_global_declaration_2): Likewise.
	* trans-mem.c (ipa_tm_execute): Likewise.
	(ipa_tm_transform_clone): Likewise.
	(ipa_tm_transform_transaction): Likewise.
	(ipa_tm_transform_calls_redirect): Likewise.
	(ipa_tm_insert_gettmclone_call): Likewise.
	(ipa_tm_insert_irr_call): Likewise.
	(ipa_tm_create_version): Likewise.
	(ipa_tm_create_version_alias): Likewise.
	(ipa_tm_mark_forced_by_abi_node): Likewise.
	(ipa_tm_mark_force_output_node): Likewise.
	(ipa_tm_diagnose_tm_safe): Likewise.
	(ipa_tm_mayenterirr_function): Likewise.
	(ipa_tm_scan_irr_function): Likewise.
	(ipa_tm_note_irrevocable): Likewise.
	(ipa_tm_scan_calls_clone): Likewise.
	(get_cg_data): Likewise.
	* tree-eh.c (tree_could_trap_p): Likewise.
	* tree-emutls.c (ipa_lower_emutls): Likewise.
	(create_emultls_var): Likewise.
	(lower_emutls_function_body): Likewise.
	(gen_emutls_addr): Likewise.
	(emutls_decl): Likewise.
	(new_emutls_decl): Likewise.
	* tree-inline.c (tree_function_versioning): Likewise.
	(optimize_inline_calls): Likewise.
	(expand_call_inline): Likewise.
	(estimate_num_insns): Likewise.
	(copy_bb): Likewise.
	(delete_unreachable_blocks_update_callgraph): Likewise.
	* tree-nested.c (gimplify_all_functions): Likewise.
	(create_nesting_tree): Likewise.
	(check_for_nested_with_variably_modified): Likewise.
	* tree-pretty-print.c (dump_function_header): Likewise.
	* tree-profile.c (tree_profiling): Likewise.
	* tree-sra.c (ipa_sra_preliminary_function_checks): Likewise.
	(modify_function): Likewise.
	(convert_callers): Likewise.
	(convert_callers_for_node): Likewise.
	* tree-ssa-structalias.c (ipa_pta_execute): Likewise.
	(associate_varinfo_to_alias): Likewise.
	(create_variable_info_for): Likewise.
	(get_constraint_for_ssa_var): Likewise.
	* tree-vectorizer.c (increase_alignment): Likewise.
	* tree.c (find_decls_types_in_var): Likewise.
	(find_decls_types_in_node): Likewise.
	(free_lang_data_in_decl): Likewise.
	* value-prof.c (gimple_ic_transform): Likewise.
	(gimple_ic): Likewise.
	(check_ic_target): Likewise.
	(init_node_map): Likewise.
	* varasm.c (decl_binds_to_current_def_p): Likewise.
	(default_binds_local_p_1): Likewise.
	(dump_tm_clone_pairs): Likewise.
	(assemble_alias): Likewise.
	(find_decl): Likewise.
	(mark_decl_referenced): Likewise.
	* varpool.c (varpool_for_node_and_aliases): Likewise.
	(varpool_extra_name_alias): Likewise.
	(varpool_create_variable_alias): Likewise.
	(add_new_static_var): Likewise.
	(varpool_finalize_named_section_flags): Likewise.
	(varpool_remove_unreferenced_decls): Likewise.
	(enqueue_node): Likewise.
	(varpool_assemble_decl): Likewise.
	(assemble_aliases): Likewise.
	(varpool_analyze_node): Likewise.
	(cgraph_variable_initializer_availability): Likewise.
	(varpool_add_new_variable): Likewise.
	(ctor_for_folding): Likewise.
	(dump_varpool_node): Likewise.
	(varpool_remove_initializer): Likewise.
	(varpool_remove_node): Likewise.
	(varpool_node_for_decl): Likewise.
	(varpool_create_empty_node): Likewise.
	* config/i386/i386.c (ix86_generate_version_dispatcher_body):
	Likewise.
	(ix86_get_function_versions_dispatcher): Likewise.

gcc/ada/

	Patch autogenerated by refactor_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* gcc-interface/trans.c (finalize_nrv): Update for conversion of
	symtab types to a true class hierarchy.
	* gcc-interface/utils.c (gnat_write_global_declarations): Likewise.

gcc/c-family/

	Patch autogenerated by refactor_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* c-gimplify.c (c_genericize): Update for conversion of symtab types
	to a true class hierarchy.
	* c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise.

gcc/cp/

	Patch autogenerated by refactor_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* call.c (mark_versions_used): Update for conversion of symtab types
	to a true class hierarchy.
	* decl2.c (cp_write_global_declarations): Likewise.
	(clear_decl_external): Likewise.
	(build_java_method_aliases): Likewise.
	(collect_candidates_for_java_method_aliases): Likewise.
	(mark_needed): Likewise.
	(var_finalized_p): Likewise.
	(maybe_make_one_only): Likewise.
	(maybe_emit_vtables): Likewise.
	* lambda.c (maybe_add_lambda_conv_op): Likewise.
	* method.c (use_thunk): Likewise.
	* optimize.c (maybe_clone_body): Likewise.
	* tree.c (cp_fix_function_decl_p): Likewise.

gcc/java/

	Patch autogenerated by refactor_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* decl.c (java_mark_decl_local): Update for conversion of symtab types
	to a true class hierarchy.

gcc/lto/

	Patch autogenerated by refactor_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* lto-partition.c (lto_promote_cross_file_statics): Update for
	conversion of symtab types to a true class hierarchy.
	(rename_statics): Likewise.
	(promote_symbol): Likewise.
	(privatize_symbol_name): Likewise.
	(lto_balanced_map): Likewise.
	(varpool_node_cmp): Likewise.
	(node_cmp): Likewise.
	(lto_1_to_1_map): Likewise.
	(undo_partition): Likewise.
	(add_symbol_to_partition): Likewise.
	(contained_in_symbol): Likewise.
	(add_symbol_to_partition_1): Likewise.
	(add_references_to_partition): Likewise.
	(symbol_partitioned_p): Likewise.
	(get_symbol_class): Likewise.
	(lto_max_map): Likewise.
	* lto-symtab.c (lto_symtab_prevailing_decl): Likewise.
	(lto_symtab_merge_symbols): Likewise.
	(lto_symtab_merge_symbols_1): Likewise.
	(lto_symtab_merge_decls): Likewise.
	(lto_symtab_merge_decls_1): Likewise.
	(lto_symtab_merge_decls_2): Likewise.
	(lto_symtab_resolve_symbols): Likewise.
	(lto_symtab_resolve_can_prevail_p): Likewise.
	(lto_symtab_symbol_p): Likewise.
	(lto_symtab_resolve_replaceable_p): Likewise.
	(lto_symtab_merge): Likewise.
	(lto_varpool_replace_node): Likewise.
	(lto_cgraph_replace_node): Likewise.
	* lto.c (lto_main): Likewise.
	(do_whole_program_analysis): Likewise.
	(materialize_cgraph): Likewise.
	(read_cgraph_and_symbols): Likewise.
	(cmp_partitions_order): Likewise.
	(lto_materialize_function): Likewise.
	(has_analyzed_clone_p): Likewise.

From-SVN: r204171
2013-10-29 18:30:00 +00:00
Andrew MacLeod 8e9055ae62 tree-outof-ssa.h: Remove include files.
* tree-outof-ssa.h: Remove include files.
	* tree-outof-ssa.c: Add required include files from tree-outof-ssa.h.
	* expr.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* cfgexpand.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* ipa-prop.h: Remove gimple.h and tree-core.h from include list.
	* lto-streamer.h: Likewise.
	* cgraphbuild.c: Add gimple.h to include list.
	* data-streamer-in.c: Likewise.
	* ipa-cp.c: Likewise.
	* tree-streamer.c: Likewise.
	* lto-compress.c: Likewise.
	* ipa-reference.c: Likewise.
	* data-streamer-out.c: Likewise.
	* lto-cgraph.c: Likewise.
	* cgraphclones.c: Likewise.
	* ipa-utils.c: Likewise.
	* data-streamer.c: Likewise.
	* ipa-split.c: Likewise.
	* lto-section-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* ipa-prop.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* symtab.c: Likewise.
	* opts-global.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* rtl.h: Add tree-core.h to include list.
	* expr.h: Remove tree-core.h from include list.
	* gimple.h: Likewise.
	* ipa-utils.h: Likewise.
	* streamer-hooks.h: Likewise.
	* streamer-hooks.c: Include input.h.

	* lto/lto-object.c: Add gimple.h to include list.
	* lto/lto-partition.c: Likewise.

From-SVN: r204158
2013-10-29 12:55:50 +00:00
Gerald Pfeifer ecdbd01aa1 Fix up ChangeLog entries (name, e-mail, formatting, otherwise).
From-SVN: r203992
2013-10-23 21:30:54 +00:00
Andrew Macleod 377d979275 tree-cfg.h: Rename from tree-flow.h.
* tree-cfg.h: Rename from tree-flow.h.  Remove #includes.
	* tree-ssa.h: Relocate required #includes from tree-cfg.h.
	* tree-ssa-operands.h: Remove prototype.
	* tree-ssa-operands.c (virtual_operand_p): Move to gimple.c.
	* gimple.c (virtual_operand_p): Relocate from gimple.c.
	* gimple.h: Add prototype.
	* gimple-ssa.h: Include tree-ssa-operands.h.
	* tree-dump.c: Add tree-cfg.h to include list.
	* tree-ssa-alias.c: Add ipa-reference.h to include list.
	* config/alpha/alpha.c: Include gimple-ssa.h instead of tree-flow.h.
	* config/i386/i386.c: Don't include tree-flow.h.
	* config/rs6000/rs6000.c: Likewise.

	* lto/lto.c: Remove tree-flow.h from include list.

	* testsuite/g++.dg/plugin/header_plugin.c: Don't include tree-flow.h.

From-SVN: r203817
2013-10-18 12:39:34 +00:00
Richard Biener fffda8d7a3 lto.c (hash_canonical_type): Split out from ...
2013-10-15  Richard Biener  <rguenther@suse.de>

	lto/
	* lto.c (hash_canonical_type): Split out from ...
	(iterative_hash_canonical_type): ... here.  Register types
	we recurse to.
	(gimple_canonical_type_hash): Adjust.
	(gimple_register_canonical_type_1): Split out from ...
	(gimple_register_canonical_type): ... here.  Cache computed
	hash value.
	(lto_register_canonical_types): Split into two modes,
	clearing and computing TYPE_CANONICAL.
	(lto_read_decls): Adjust.
	(read_cgraph_and_symbols): Do two passes over global trees,
	first clearing then computing TYPE_CANONICAL.

From-SVN: r203600
2013-10-15 11:13:04 +00:00
Richard Biener 1394237ec9 lto.c (gimple_canonical_types): Move out-of GC space.
2013-10-14  Richard Biener  <rguenther@suse.de>

	lto/
	* lto.c (gimple_canonical_types): Move out-of GC space.
	(canonical_type_hash_cache): Make a pointer-map.
	(num_canonical_type_hash_entries, num_canonical_type_hash_queries):
	New counters.
	(iterative_hash_canonical_type): Adjust.
	(read_cgraph_and_symbols): Likewise.
	(print_lto_report_1): Likewise.

From-SVN: r203566
2013-10-14 14:32:24 +00:00
Richard Biener 0a387eca30 lto.c (gimple_types, [...]): Remove old merging code and statistics.
2013-10-14  Richard Biener  <rguenther@suse.de>

	lto/
	* lto.c (gimple_types, type_hash_cache, struct type_pair_d,
	type_pair_cache, lookup_type_pair, struct sccs, next_dfs_num,
	gtc_next_dfs_num, compare_type_names_p, gtc_visit,
	gimple_types_compatible_p_1, gimple_types_compatible_p,
	visit, iterative_hash_name, struct type_hash_pair,
	type_hash_pair_compare, iterative_hash_gimple_type, gimple_type_hash,
	gimple_type_eq, gimple_register_type, num_not_merged_types,
	num_not_merged_types_in_same_scc, num_not_merged_types_trees,
	num_not_merged_types_in_same_scc_trees): Remove old merging code
	and statistics.
	(lto_read_decls): Do not run old merging code in parallel.
	(read_cgraph_and_symbols): Do not init/free old merging
	data structures.
	(print_lto_report_1): Do not report differences of old vs. new
	merging code.

From-SVN: r203533
2013-10-14 12:57:11 +00:00
Richard Biener 83fd5d110e gimple.c (gimple_canonical_types, [...]): Move to lto/lto.c
2013-10-14  Richard Biener  <rguenther@suse.de>

	* gimple.c (gimple_canonical_types, canonical_type_hash_cache,
	iterative_hash_canonical_type, gimple_canonical_type_hash,
	gimple_canonical_types_compatible_p, gimple_canonical_type_eq,
	gimple_register_canonical_type, print_gimple_types_stats,
	free_gimple_type_tables): Move to lto/lto.c
	(gt-gimple.h): Do not include.
	* gimple.h (gimple_register_canonical_type,
	print_gimple_types_stats, free_gimple_type_tables): Remove.
	* Makefile.in (GTFILES): Remove gimple.c.

	lto/
	* lto-lang.c (lto_init): Do not re-init canonical types here.
	(lto_register_canonical_types): Move to ...
	* lto.c (lto_register_canonical_types): ... here.
	(gimple_canonical_types, canonical_type_hash_cache,
	iterative_hash_canonical_type, gimple_canonical_type_hash,
	gimple_canonical_types_compatible_p, gimple_canonical_type_eq,
	gimple_register_canonical_type): Add canonical type merging machinery
	moved from gimple.c.
	(read_cgraph_and_symbols): Init and free canonical type tables
	here.
	(print_lto_report_1): Report canonical type table stats here.

From-SVN: r203521
2013-10-14 12:06:38 +00:00
Jakub Jelinek acf0174b6f target.c: New file.
libgomp/
	* target.c: New file.
	* Makefile.am (libgomp_la_SOURCES): Add target.c.
	* Makefile.in: Regenerated.
	* libgomp_g.h (GOMP_task): Add depend argument.
	(GOMP_barrier_cancel, GOMP_loop_end_cancel,
	GOMP_sections_end_cancel, GOMP_target, GOMP_target_data,
	GOMP_target_end_data, GOMP_target_update, GOMP_teams,
	GOMP_parallel_loop_static, GOMP_parallel_loop_dynamic,
	GOMP_parallel_loop_guided, GOMP_parallel_loop_runtime,
	GOMP_parallel, GOMP_cancel, GOMP_cancellation_point,
	GOMP_taskgroup_start, GOMP_taskgroup_end,
	GOMP_parallel_sections): New prototypes.
	* fortran.c (omp_is_initial_device): Add ialias_redirect.
	(omp_is_initial_device_): New function.
	(ULP, STR1, STR2, ialias_redirect): Removed.
	(omp_get_cancellation_, omp_get_proc_bind_, omp_set_default_device_,
	omp_set_default_device_8_, omp_get_default_device_,
	omp_get_num_devices_, omp_get_num_teams_, omp_get_team_num_): New
	functions.
	* libgomp.map (GOMP_barrier_cancel, GOMP_loop_end_cancel,
	GOMP_sections_end_cancel, GOMP_target, GOMP_target_data,
	GOMP_target_end_data, GOMP_target_update, GOMP_teams): Export
	@@GOMP_4.0.
	(omp_is_initial_device, omp_is_initial_device_, omp_get_cancellation,
	omp_get_cancellation_, omp_get_proc_bind, omp_get_proc_bind_,
	omp_set_default_device, omp_set_default_device_,
	omp_set_default_device_8_, omp_get_default_device,
	omp_get_default_device_, omp_get_num_devices, omp_get_num_devices_,
	omp_get_num_teams, omp_get_num_teams_, omp_get_team_num,
	omp_get_team_num_): Export @@OMP_4.0.
	* team.c (struct gomp_thread_start_data): Add place field.
	(gomp_thread_start): Clear thr->thread_pool and
	thr->task before returning.  Use gomp_team_barrier_wait_final
	instead of gomp_team_barrier_wait.  Initialize thr->place.
	(gomp_new_team): Initialize work_shares_to_free, work_share_cancelled,
	team_cancelled and task_queued_count fields.
	(gomp_free_pool_helper): Clear thr->thread_pool and thr->task
	before calling pthread_exit.
	(gomp_free_thread): No longer static.  Use
	gomp_managed_threads_lock instead of gomp_remaining_threads_lock.
	(gomp_team_start): Add flags argument.  Set
	thr->thread_pool->threads_busy to nthreads immediately after creating
	new pool.  Use gomp_managed_threads_lock instead of
	gomp_remaining_threads_lock.  Handle OpenMP 4.0 affinity.
	(gomp_team_end): Use gomp_managed_threads_lock instead of
	gomp_remaining_threads_lock.  Use gomp_team_barrier_wait_final instead
	of gomp_team_barrier_wait.  If team->team_cancelled, call
	gomp_fini_worshare on ws chain starting at team->work_shares_to_free
	rather than thr->ts.work_share.
	(initialize_team): Don't call gomp_sem_init here.
	* sections.c (GOMP_parallel_sections_start): Adjust gomp_team_start
	caller.
	(GOMP_parallel_sections, GOMP_sections_end_cancel): New functions.
	* env.c (gomp_global_icv): Add default_device_var, target_data and
	bind_var initializers.
	(gomp_cpu_affinity, gomp_cpu_affinity_len): Remove.
	(gomp_bind_var_list, gomp_bind_var_list_len, gomp_places_list,
	gomp_places_list_len): New variables.
	(parse_bind_var, parse_one_place, parse_places_var): New functions.
	(parse_affinity): Rewritten to construct OMP_PLACES list with unit
	sized places.
	(gomp_cancel_var): New global variable.
	(parse_int): New function.
	(handle_omp_display_env): New function.
	(initialize_env): Use it.  Initialize default_device_var.
	Parse OMP_CANCELLATION env var.  Use parse_bind_var to parse
	OMP_PROC_BIND instead of parse_boolean.  Use parse_places_var for
	OMP_PLACES parsing.  Don't call parse_affinity if OMP_PLACES has
	been successfully parsed (and call gomp_init_affinity in that case).
	(omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
	omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
	omp_get_team_num, omp_is_initial_device): New functions.
	* libgomp.h: Include stdlib.h.
	(ialias_ulp, ialias_str1, ialias_str2, ialias_redirect, ialias_call):
	Define.
	(struct target_mem_desc): Forward declare.
	(struct gomp_task_icv): Add default_device_var, target_data, bind_var
	and thread_limit_var fields.
	(gomp_get_num_devices): New prototype.
	(gomp_cancel_var): New extern decl.
	(struct gomp_team): Add work_shares_to_free, work_share_cancelled,
	team_cancelled and task_queued_count fields.  Add comments about
	task_{,queued_,running_}count.
	(gomp_cancel_kind): New enum.
	(gomp_work_share_end_cancel): New prototype.
	(struct gomp_task): Add next_taskgroup, prev_taskgroup, taskgroup,
	copy_ctors_done, dependers, depend_hash, depend_count, num_dependees
	and depend fields.
	(struct gomp_taskgroup): New type.
	(struct gomp_task_depend_entry,
	struct gomp_dependers_vec): New types.
	(gomp_finish_task): Free depend_hash if non-NULL.
	(struct gomp_team_state): Add place_partition_off
	and place_partition_len fields.
	(gomp_bind_var_list, gomp_bind_var_list_len, gomp_places_list,
	gomp_places_list_len): New extern decls.
	(struct gomp_thread): Add place field.
	(gomp_cpu_affinity, gomp_cpu_affinity_len): Remove.
	(gomp_init_thread_affinity): Add place argument.
	(gomp_affinity_alloc, gomp_affinity_init_place, gomp_affinity_add_cpus,
	gomp_affinity_remove_cpu, gomp_affinity_copy_place,
	gomp_affinity_same_place, gomp_affinity_finalize_place_list,
	gomp_affinity_init_level, gomp_affinity_print_place): New
	prototypes.
	(gomp_team_start): Add flags argument.
	(gomp_thread_limit_var, gomp_remaining_threads_count,
	gomp_remaining_threads_lock): Remove.
	(gomp_managed_threads_lock): New variable.
	(struct gomp_thread_pool): Add threads_busy field.
	(gomp_free_thread): New prototype.
	* task.c: Include hashtab.h.
	(hash_entry_type): New typedef.
	(htab_alloc, htab_free, htab_hash, htab_eq): New inlines.
	(gomp_init_task): Clear dependers, depend_hash, depend_count,
	copy_ctors_done and taskgroup fields.
	(GOMP_task): Add depend argument, handle depend clauses.  If
	gomp_team_barrier_cancelled or if it's taskgroup has been
	cancelled, don't queue or start new tasks.  Set copy_ctors_done
	field if needed.  Initialize taskgroup field.  If copy_ctors_done
	and already cancelled, don't discard the task.  If taskgroup is
	non-NULL, enqueue the task into taskgroup queue.  Increment
	num_children field in taskgroup.  Increment task_queued_count.
	(gomp_task_run_pre, gomp_task_run_post_remove_parent,
	gomp_task_run_post_remove_taskgroup): New inline functions.
	(gomp_task_run_post_handle_depend_hash,
	gomp_task_run_post_handle_dependers,
	gomp_task_run_post_handle_depend): New functions.
	(GOMP_taskwait): Use them.  If more than one new tasks
	have been queued, wake other threads if needed.
	(gomp_barrier_handle_tasks): Likewise.  If
	gomp_team_barrier_cancelled, don't start any new tasks, just free
	all tasks.
	(GOMP_taskgroup_start, GOMP_taskgroup_end): New functions.
	* omp_lib.f90.in
	(omp_proc_bind_kind, omp_proc_bind_false,
	omp_proc_bind_true, omp_proc_bind_master, omp_proc_bind_close,
	omp_proc_bind_spread): New params.
	(omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
	omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
	omp_get_team_num, omp_is_initial_device): New interfaces.
	(omp_get_dynamic, omp_get_nested, omp_in_parallel,
	omp_get_max_threads, omp_get_num_procs, omp_get_num_threads,
	omp_get_thread_num, omp_get_thread_limit, omp_set_max_active_levels,
	omp_get_max_active_levels, omp_get_level, omp_get_ancestor_thread_num,
	omp_get_team_size, omp_get_active_level, omp_in_final): Remove
	useless use omp_lib_kinds.
	* omp.h.in (omp_proc_bind_t): New typedef.
	(omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
	omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
	omp_get_team_num, omp_is_initial_device): New prototypes.
	* loop.c (gomp_parallel_loop_start): Add flags argument, pass it
	through to gomp_team_start.
	(GOMP_parallel_loop_static_start, GOMP_parallel_loop_dynamic_start,
	GOMP_parallel_loop_guided_start, GOMP_parallel_loop_runtime_start):
	Adjust gomp_parallel_loop_start callers.
	(GOMP_parallel_loop_static, GOMP_parallel_loop_dynamic,
	GOMP_parallel_loop_guided, GOMP_parallel_loop_runtime,
	GOMP_loop_end_cancel): New functions.
	(GOMP_parallel_end): Add ialias_redirect.
	* hashtab.h: New file.
	* libgomp.texi (Environment Variables): Minor cleanup,
	update section refs to OpenMP 4.0rc2.
	(OMP_DISPLAY_ENV, GOMP_SPINCOUNT): Document these
	environment variables.
	* work.c (gomp_work_share_end, gomp_work_share_end_nowait): Set
	team->work_shares_to_free to thr->ts.work_share before calling
	free_work_share.
	(gomp_work_share_end_cancel): New function.
	* config/linux/proc.c: Include errno.h.
	(gomp_get_cpuset_size, gomp_cpuset_size, gomp_cpusetp): New variables.
	(gomp_cpuset_popcount): Add cpusetsize argument, use it instead of
	sizeof (cpu_set_t) to determine number of iterations.  Fix up check
	extern decl.  Use CPU_COUNT_S if available, or CPU_COUNT if
	gomp_cpuset_size is sizeof (cpu_set_t).
	(gomp_init_num_threads): Initialize gomp_cpuset_size,
	gomp_get_cpuset_size and gomp_cpusetp here, use gomp_cpusetp instead
	of &cpuset and pass gomp_cpuset_size instead of sizeof (cpu_set_t)
	to pthread_getaffinity_np.  Free and clear gomp_cpusetp if it didn't
	contain any logical CPUs.
	(get_num_procs): Don't call pthread_getaffinity_np if gomp_cpusetp
	is NULL.  Use gomp_cpusetp instead of &cpuset and pass
	gomp_get_cpuset_size instead of sizeof (cpu_set_t) to
	pthread_getaffinity_np.  Check gomp_places_list instead of
	gomp_cpu_affinity.  Adjust gomp_cpuset_popcount caller.
	* config/linux/bar.c (gomp_barrier_wait_end,
	gomp_barrier_wait_last): Use BAR_* defines.
	(gomp_team_barrier_wait_end): Likewise.  Clear BAR_CANCELLED
	from state where needed.  Set work_share_cancelled to 0 on last
	thread.
	(gomp_team_barrier_wait_final, gomp_team_barrier_wait_cancel_end,
	gomp_team_barrier_wait_cancel, gomp_team_barrier_cancel): New
	functions.
	* config/linux/proc.h (gomp_cpuset_popcount): Add attribute_hidden.
	Add cpusetsize argument.
	(gomp_cpuset_size, gomp_cpusetp): Declare.
	* config/linux/affinity.c: Include errno.h, stdio.h and string.h.
	(affinity_counter): Remove.
	(CPU_ISSET_S, CPU_ZERO_S, CPU_SET_S, CPU_CLR_S): Define
	if CPU_ALLOC_SIZE isn't defined.
	(gomp_init_affinity): Rewritten, if gomp_places_list is NULL, try
	silently create OMP_PLACES=threads, if it is non-NULL afterwards,
	bind current thread to the first place.
	(gomp_init_thread_affinity): Rewritten.  Add place argument, just
	pthread_setaffinity_np to gomp_places_list[place].
	(gomp_affinity_alloc, gomp_affinity_init_place, gomp_affinity_add_cpus,
	gomp_affinity_remove_cpu, gomp_affinity_copy_place,
	gomp_affinity_same_place, gomp_affinity_finalize_place_list,
	gomp_affinity_init_level, gomp_affinity_print_place): New functions.
	* config/linux/bar.h (BAR_TASK_PENDING, BAR_WAS_LAST,
	BAR_WAITING_FOR_TASK, BAR_INCR, BAR_CANCELLED): Define.
	(gomp_barrier_t): Add awaited_final field.
	(gomp_barrier_init): Initialize awaited_final field.
	(gomp_team_barrier_wait_final, gomp_team_barrier_wait_cancel,
	gomp_team_barrier_wait_cancel_end, gomp_team_barrier_cancel): New
	prototypes.
	(gomp_barrier_wait_start): Preserve BAR_CANCELLED bit.  Use BAR_*
	defines.
	(gomp_barrier_wait_cancel_start, gomp_team_barrier_wait_final_start,
	gomp_team_barrier_cancelled): New inline functions.
	(gomp_barrier_last_thread,
	gomp_team_barrier_set_task_pending,
	gomp_team_barrier_clear_task_pending,
	gomp_team_barrier_set_waiting_for_tasks,
	gomp_team_barrier_waiting_for_tasks,
	gomp_team_barrier_done): Use BAR_* defines.
	* config/posix/bar.c (gomp_barrier_init): Clear cancellable field.
	(gomp_barrier_wait_end): Use BAR_* defines.
	(gomp_team_barrier_wait_end): Clear BAR_CANCELLED from state.
	Set work_share_cancelled to 0 on last thread, use __atomic_load_n.
	Use BAR_* defines.
	(gomp_team_barrier_wait_cancel_end, gomp_team_barrier_wait_cancel,
	gomp_team_barrier_cancel): New functions.
	* config/posix/affinity.c (gomp_init_thread_affinity): Add place
	argument.
	(gomp_affinity_alloc, gomp_affinity_init_place, gomp_affinity_add_cpus,
	gomp_affinity_remove_cpu, gomp_affinity_copy_place,
	gomp_affinity_same_place, gomp_affinity_finalize_place_list,
	gomp_affinity_init_level, gomp_affinity_print_place): New stubs.
	* config/posix/bar.h (BAR_TASK_PENDING, BAR_WAS_LAST,
	BAR_WAITING_FOR_TASK, BAR_INCR, BAR_CANCELLED): Define.
	(gomp_barrier_t): Add cancellable field.
	(gomp_team_barrier_wait_cancel, gomp_team_barrier_wait_cancel_end,
	gomp_team_barrier_cancel): New prototypes.
	(gomp_barrier_wait_start): Preserve BAR_CANCELLED bit.
	(gomp_barrier_wait_cancel_start, gomp_team_barrier_wait_final,
	gomp_team_barrier_cancelled): New inline functions.
	(gomp_barrier_wait_start, gomp_barrier_last_thread,
	gomp_team_barrier_set_task_pending,
	gomp_team_barrier_clear_task_pending,
	gomp_team_barrier_set_waiting_for_tasks,
	gomp_team_barrier_waiting_for_tasks,
	gomp_team_barrier_done): Use BAR_* defines.
	* barrier.c (GOMP_barrier_cancel): New function.
	* omp_lib.h.in (omp_proc_bind_kind, omp_proc_bind_false,
	omp_proc_bind_true, omp_proc_bind_master, omp_proc_bind_close,
	omp_proc_bind_spread): New params.
	(omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
	omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
	omp_get_team_num, omp_is_initial_device): New externals.
	* parallel.c (GOMP_parallel, GOMP_cancel, GOMP_cancellation_point):
	New functions.
	(gomp_resolve_num_threads): Adjust for thread_limit now being in
	icv->thread_limit_var.  Use UINT_MAX instead of ULONG_MAX as
	infinity.  If not nested, just return minimum of max_num_threads
	and icv->thread_limit_var and if thr->thread_pool, set threads_busy
	to the returned value.  Otherwise, don't update atomically
	gomp_remaining_threads_count, but instead thr->thread_pool->threads_busy.
	(GOMP_parallel_end): Adjust for thread_limit now being in
	icv->thread_limit_var.  Use UINT_MAX instead of ULONG_MAX as
	infinity.  Adjust threads_busy in the pool rather than
	gomp_remaining_threads_count.  Remember team->nthreads and call
	gomp_team_end before adjusting threads_busy, if not nested
	afterwards, just set it to 1 non-atomically.  Add ialias.
	(GOMP_parallel_start): Adjust gomp_team_start caller.
	* testsuite/libgomp.c/atomic-14.c: Add parens to make it valid.
	* testsuite/libgomp.c/affinity-1.c: New test.
	* testsuite/libgomp.c/atomic-15.c: New test.
	* testsuite/libgomp.c/atomic-16.c: New test.
	* testsuite/libgomp.c/atomic-17.c: New test.
	* testsuite/libgomp.c/cancel-for-1.c: New test.
	* testsuite/libgomp.c/cancel-for-2.c: New test.
	* testsuite/libgomp.c/cancel-parallel-1.c: New test.
	* testsuite/libgomp.c/cancel-parallel-2.c: New test.
	* testsuite/libgomp.c/cancel-parallel-3.c: New test.
	* testsuite/libgomp.c/cancel-sections-1.c: New test.
	* testsuite/libgomp.c/cancel-taskgroup-1.c: New test.
	* testsuite/libgomp.c/cancel-taskgroup-2.c: New test.
	* testsuite/libgomp.c/depend-1.c: New test.
	* testsuite/libgomp.c/depend-2.c: New test.
	* testsuite/libgomp.c/depend-3.c: New test.
	* testsuite/libgomp.c/depend-4.c: New test.
	* testsuite/libgomp.c/for-1.c: New test.
	* testsuite/libgomp.c/for-1.h: New file.
	* testsuite/libgomp.c/for-2.c: New test.
	* testsuite/libgomp.c/for-2.h: New file.
	* testsuite/libgomp.c/for-3.c: New test.
	* testsuite/libgomp.c/pr58392.c: New test.
	* testsuite/libgomp.c/simd-1.c: New test.
	* testsuite/libgomp.c/simd-2.c: New test.
	* testsuite/libgomp.c/simd-3.c: New test.
	* testsuite/libgomp.c/simd-4.c: New test.
	* testsuite/libgomp.c/simd-5.c: New test.
	* testsuite/libgomp.c/simd-6.c: New test.
	* testsuite/libgomp.c/target-1.c: New test.
	* testsuite/libgomp.c/target-2.c: New test.
	* testsuite/libgomp.c/target-3.c: New test.
	* testsuite/libgomp.c/target-4.c: New test.
	* testsuite/libgomp.c/target-5.c: New test.
	* testsuite/libgomp.c/target-6.c: New test.
	* testsuite/libgomp.c/target-7.c: New test.
	* testsuite/libgomp.c/taskgroup-1.c: New test.
	* testsuite/libgomp.c/thread-limit-1.c: New test.
	* testsuite/libgomp.c/thread-limit-2.c: New test.
	* testsuite/libgomp.c/thread-limit-3.c: New test.
	* testsuite/libgomp.c/udr-1.c: New test.
	* testsuite/libgomp.c/udr-2.c: New test.
	* testsuite/libgomp.c/udr-3.c: New test.
	* testsuite/libgomp.c++/affinity-1.C: New test.
	* testsuite/libgomp.c++/atomic-10.C: New test.
	* testsuite/libgomp.c++/atomic-11.C: New test.
	* testsuite/libgomp.c++/atomic-12.C: New test.
	* testsuite/libgomp.c++/atomic-13.C: New test.
	* testsuite/libgomp.c++/atomic-14.C: New test.
	* testsuite/libgomp.c++/atomic-15.C: New test.
	* testsuite/libgomp.c++/cancel-for-1.C: New test.
	* testsuite/libgomp.c++/cancel-for-2.C: New test.
	* testsuite/libgomp.c++/cancel-parallel-1.C: New test.
	* testsuite/libgomp.c++/cancel-parallel-2.C: New test.
	* testsuite/libgomp.c++/cancel-parallel-3.C: New test.
	* testsuite/libgomp.c++/cancel-sections-1.C: New test.
	* testsuite/libgomp.c++/cancel-taskgroup-1.C: New test.
	* testsuite/libgomp.c++/cancel-taskgroup-2.C: New test.
	* testsuite/libgomp.c++/cancel-taskgroup-3.C: New test.
	* testsuite/libgomp.c++/cancel-test.h: New file.
	* testsuite/libgomp.c++/for-9.C: New test.
	* testsuite/libgomp.c++/for-10.C: New test.
	* testsuite/libgomp.c++/for-11.C: New test.
	* testsuite/libgomp.c++/simd-1.C: New test.
	* testsuite/libgomp.c++/simd-2.C: New test.
	* testsuite/libgomp.c++/simd-3.C: New test.
	* testsuite/libgomp.c++/simd-4.C: New test.
	* testsuite/libgomp.c++/simd-5.C: New test.
	* testsuite/libgomp.c++/simd-6.C: New test.
	* testsuite/libgomp.c++/simd-7.C: New test.
	* testsuite/libgomp.c++/simd-8.C: New test.
	* testsuite/libgomp.c++/target-1.C: New test.
	* testsuite/libgomp.c++/target-2.C: New test.
	* testsuite/libgomp.c++/target-2-aux.cc: New file.
	* testsuite/libgomp.c++/target-3.C: New test.
	* testsuite/libgomp.c++/taskgroup-1.C: New test.
	* testsuite/libgomp.c++/udr-1.C: New test.
	* testsuite/libgomp.c++/udr-2.C: New test.
	* testsuite/libgomp.c++/udr-3.C: New test.
	* testsuite/libgomp.c++/udr-4.C: New test.
	* testsuite/libgomp.c++/udr-5.C: New test.
	* testsuite/libgomp.c++/udr-6.C: New test.
	* testsuite/libgomp.c++/udr-7.C: New test.
	* testsuite/libgomp.c++/udr-8.C: New test.
	* testsuite/libgomp.c++/udr-9.C: New test.
gcc/
	* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__LOOPTEMP_
	and new OpenMP 4.0 clauses, handle UDR OMP_CLAUSE_REDUCTION,
	formatting fixes, use pp_colon instead of pp_character (..., ':'),
	similarly pp_right_paren.
	(dump_generic_node): Handle OMP_DISTRIBUTE, OMP_TEAMS,
	OMP_TARGET_DATA, OMP_TARGET, OMP_TARGET_UPDATE, OMP_TASKGROUP,
	allow OMP_FOR_INIT to be NULL, handle OMP_ATOMIC_SEQ_CST.
	* tree.c (omp_clause_num_ops, omp_clause_code_name): Add OpenMP 4.0
	clauses.
	(omp_declare_simd_clauses_equal,
	omp_remove_redundant_declare_simd_attrs): New functions.
	(attribute_value_equal): Use omp_declare_simd_clauses_equal.
	(walk_tree_1): Handle new OpenMP 4.0 clauses.
	* tree.h (OMP_LOOP_CHECK): Define.
	(OMP_FOR_BODY, OMP_FOR_CLAUSES, OMP_FOR_INIT, OMP_FOR_COND,
	OMP_FOR_INCR, OMP_FOR_PRE_BODY): Use it.
	(OMP_TASKGROUP_BODY, OMP_TEAMS_BODY, OMP_TEAMS_CLAUSES,
	OMP_TARGET_DATA_BODY, OMP_TARGET_DATA_CLAUSES, OMP_TARGET_BODY,
	OMP_TARGET_CLAUSES, OMP_TARGET_UPDATE_CLAUSES, OMP_CLAUSE_SIZE,
	OMP_ATOMIC_SEQ_CST, OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
	OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION, OMP_CLAUSE_PROC_BIND_KIND,
	OMP_CLAUSE_REDUCTION_OMP_ORIG_REF, OMP_CLAUSE_ALIGNED_ALIGNMENT,
	OMP_CLAUSE_NUM_TEAMS_EXPR, OMP_CLAUSE_THREAD_LIMIT_EXPR,
	OMP_CLAUSE_DEVICE_ID, OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR,
	OMP_CLAUSE_SIMDLEN_EXPR): Define.
	(OMP_CLAUSE_DECL): Change range up to OMP_CLAUSE__LOOPTEMP_.
	(omp_remove_redundant_declare_simd_attrs): New prototype.
	* gimple.def (GIMPLE_OMP_TASKGROUP, GIMPLE_OMP_TARGET,
	GIMPLE_OMP_TEAMS): New codes.
	(GIMPLE_OMP_RETURN): Use GSS_OMP_ATOMIC_STORE instead of GSS_BASE.
	* omp-low.c (struct omp_context): Add cancel_label and cancellable
	fields.
	(target_nesting_level): New variable.
	(extract_omp_for_data): Handle GF_OMP_FOR_KIND_DISTRIBUTE and
	OMP_CLAUSE_DIST_SCHEDULE.  Don't fallback to library implementation
	for collapse > 1 static schedule unless ordered.
	(get_ws_args_for): Add par_stmt argument.  Handle combined loops.
	(determine_parallel_type): Adjust get_ws_args_for caller.
	(install_var_field): Handle mask & 4 for double indirection.
	(scan_sharing_clauses): Ignore shared clause on teams construct.
	Handle OMP_CLAUSE__LOOPTEMP_ and new OpenMP 4.0 clauses.
	(create_omp_child_function): If inside target or declare target
	constructs, set "omp declare target" attribute on the child
	function.
	(find_combined_for): New function.
	(scan_omp_parallel): Handle combined loops.
	(scan_omp_target, scan_omp_teams): New functions.
	(check_omp_nesting_restrictions): Check new OpenMP 4.0 nesting
	restrictions and set ctx->cancellable for cancellable constructs.
	(scan_omp_1_stmt): Call check_omp_nesting_restrictions also on
	selected builtin calls.  Handle GIMPLE_OMP_TASKGROUP,
	GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS.
	(build_omp_barrier): Add lhs argument, return gimple rather than
	tree.
	(omp_clause_aligned_alignment): New function.
	(lower_rec_simd_input_clauses): Only call SET_DECL_VALUE_EXPR
	on decls.
	(lower_rec_input_clauses): Add FD argument.  Ignore shared clauses
	on teams constructs.  Handle user defined reductions and new
	OpenMP 4.0 clauses.
	(lower_reduction_clauses): Don't set placeholder to address of ref
	if it has already the right type.
	(lower_send_clauses): Handle OMP_CLAUSE__LOOPTEMP_.
	(expand_parallel_call): Use the new non-_start suffixed builtins,
	handle OMP_CLAUSE_PROC_BIND, don't call the outlined function
	and GOMP_parallel_end after the call.
	(expand_task_call): Handle OMP_CLAUSE_DEPEND.
	(expand_omp_for_init_counts): Handle combined loops.
	(expand_omp_for_init_vars): Add inner_stmt argument, handle combined
	loops.
	(expand_omp_for_generic): Likewise.  Use GOMP_loop_end_cancel at the
	end of cancellable loops.
	(expand_omp_for_static_nochunk, expand_omp_for_static_chunk):
	Likewise.  Handle collapse > 1 loops.
	(expand_omp_simd): Handle combined loops.
	(expand_omp_for): Add inner_stmt argument, adjust callers of
	expand_omp_for* functions, use expand_omp_for_static*chunk even
	for collapse > 1 unless ordered.
	(expand_omp_sections): Use GOMP_sections_end_cancel at the end
	of cancellable sections.
	(expand_omp_single): Remove need_barrier variable, just rely on
	gimple_omp_return_nowait_p.  Adjust build_omp_barrier caller.
	(expand_omp_synch): Allow GIMPLE_OMP_TASKGROUP and GIMPLE_OMP_TEAMS.
	(expand_omp_atomic_load, expand_omp_atomic_store,
	expand_omp_atomic_fetch_op): Handle gimple_omp_atomic_seq_cst_p.
	(expand_omp_target): New function.
	(expand_omp): Handle combined loops.  Handle GIMPLE_OMP_TASKGROUP,
	GIMPLE_OMP_TEAMS, GIMPLE_OMP_TARGET.
	(build_omp_regions_1): Immediately close region for
	GF_OMP_TARGET_KIND_UPDATE.
	(maybe_add_implicit_barrier_cancel): New function.
	(lower_omp_sections): Adjust lower_rec_input_clauses caller.  Handle
	cancellation.
	(lower_omp_single): Likewise.  Add clobber after the barrier.
	(lower_omp_taskgroup): New function.
	(lower_omp_for): Handle combined loops.  Adjust
	lower_rec_input_clauses caller.  Handle cancellation.
	(lower_depend_clauses): New function.
	(lower_omp_taskreg): Lower depend clauses.  Adjust
	lower_rec_input_clauses caller.  Add clobber after the call.  Handle
	cancellation.
	(lower_omp_target, lower_omp_teams): New functions.
	(lower_omp_1): Handle cancellation.  Handle GIMPLE_OMP_TASKGROUP,
	GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS and GOMP_barrier, GOMP_cancel
	and GOMP_cancellation_point calls.
	(lower_omp): Fold stmts inside of target region.
	(diagnose_sb_1, diagnose_sb_2): Handle GIMPLE_OMP_TASKGROUP,
	GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
	* builtin-types.def (DEF_FUNCTION_TYPE_8): Document.
	(BT_FN_VOID_OMPFN_PTR_UINT,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): Remove.
	(BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
	BT_FN_BOOL_INT, BT_FN_BOOL_INT_BOOL, BT_FN_VOID_UINT_UINT,
	BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR,
	BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): New.
	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
	call_may_clobber_ref_p_1): Handle BUILT_IN_GOMP_BARRIER_CANCEL,
	BUILT_IN_GOMP_TASKGROUP_END, BUILT_IN_GOMP_LOOP_END_CANCEL,
	BUILT_IN_GOMP_SECTIONS_END_CANCEL.  Don't handle
	BUILT_IN_GOMP_PARALLEL_END.
	* gimple-low.c (lower_stmt): Handle GIMPLE_OMP_TASKGROUP,
	GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
	* gimple-pretty-print.c (dump_gimple_omp_for): Handle
	GF_OMP_FOR_KIND_DISTRIBUTE.
	(dump_gimple_omp_target, dump_gimple_omp_teams): New functions.
	(dump_gimple_omp_block): Handle GIMPLE_OMP_TASKGROUP.
	(dump_gimple_omp_return): Print lhs if it has any.
	(dump_gimple_omp_atomic_load, dump_gimple_omp_atomic_store): Handle
	gimple_omp_atomic_seq_cst_p.
	(pp_gimple_stmt_1): Handle GIMPLE_OMP_TASKGROUP, GIMPLE_OMP_TARGET
	and GIMPLE_OMP_TEAMS.
	* langhooks.c (lhd_omp_mappable_type): New function.
	* tree-vectorizer.c (struct simd_array_to_simduid): Fix up comment.
	* langhooks.h (struct lang_hooks_for_types): Add omp_mappable_type
	hook.
	* gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP,
	GOVD_ALIGNED and GOVD_MAP_TO_ONLY.
	(enum omp_region_type): Add ORT_TEAMS, ORT_TARGET_DATA and
	ORT_TARGET.
	(struct gimplify_omp_ctx): Add combined_loop field.
	(gimplify_call_expr, gimplify_modify_expr): Don't call fold_stmt
	on stmts inside of target region.
	(is_gimple_stmt): Return true for OMP_DISTRIBUTE and OMP_TASKGROUP.
	(omp_firstprivatize_variable): Handle GOVD_MAP, GOVD_ALIGNED,
	ORT_TARGET and ORT_TARGET_DATA.
	(omp_add_variable): Avoid checks on readding var for GOVD_ALIGNED.
	Handle GOVD_MAP.
	(omp_notice_threadprivate_variable): Complain about threadprivate
	variables in target region.
	(omp_notice_variable): Complain about vars with non-mappable type
	in target region.  Handle ORT_TEAMS, ORT_TARGET and ORT_TARGET_DATA.
	(omp_check_private): Ignore ORT_TARGET* regions.
	(gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1,
	gimplify_adjust_omp_clauses): Handle new OpenMP 4.0 clauses.
	(find_combined_omp_for): New function.
	(gimplify_omp_for): Handle gimplification of combined loops.
	(gimplify_omp_workshare): Gimplify also OMP_TARGET, OMP_TARGET_DATA,
	OMP_TEAMS.
	(gimplify_omp_target_update): New function.
	(gimplify_omp_atomic): Handle OMP_ATOMIC_SEQ_CST.
	(gimplify_expr): Handle OMP_DISTRIBUTE, OMP_TARGET, OMP_TARGET_DATA,
	OMP_TARGET_UPDATE, OMP_TEAMS, OMP_TASKGROUP.
	(gimplify_body): If fndecl has "omp declare target" attribute, add
	implicit ORT_TARGET context around it.
	* tree.def (OMP_DISTRIBUTE, OMP_TEAMS, OMP_TARGET_DATA, OMP_TARGET,
	OMP_TASKGROUP, OMP_TARGET_UPDATE): New tree codes.
	* tree-nested.c (convert_nonlocal_reference_stmt,
	convert_local_reference_stmt, convert_gimple_call): Handle
	GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
	* omp-builtins.def (BUILT_IN_GOMP_TASK): Use
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR
	instead of BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT.
	(BUILT_IN_GOMP_TARGET, BUILT_IN_GOMP_TARGET_DATA,
	BUILT_IN_GOMP_TARGET_END_DATA, BUILT_IN_GOMP_TARGET_UPDATE,
	BUILT_IN_GOMP_TEAMS, BUILT_IN_BARRIER_CANCEL,
	BUILT_IN_GOMP_LOOP_END_CANCEL,
	BUILT_IN_GOMP_SECTIONS_END_CANCEL, BUILT_IN_OMP_GET_TEAM_NUM,
	BUILT_IN_OMP_GET_NUM_TEAMS, BUILT_IN_GOMP_TASKGROUP_START,
	BUILT_IN_GOMP_TASKGROUP_END, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC,
	BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC,
	BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED,
	BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME, BUILT_IN_GOMP_PARALLEL,
	BUILT_IN_GOMP_PARALLEL_SECTIONS, BUILT_IN_GOMP_CANCEL,
	BUILT_IN_GOMP_CANCELLATION_POINT): New built-ins.
	(BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START,
	BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START,
	BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START,
	BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START,
	BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END,
	BUILT_IN_GOMP_PARALLEL_SECTIONS_START): Remove.
	* tree-inline.c (remap_gimple_stmt, estimate_num_insns):
	Handle GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
	* gimple.c (gimple_build_omp_taskgroup, gimple_build_omp_target,
	gimple_build_omp_teams): New functions.
	(walk_gimple_op): Handle GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS and
	GIMPLE_OMP_TASKGROUP.  Walk optional lhs on GIMPLE_OMP_RETURN.
	(walk_gimple_stmt, gimple_copy): Handle GIMPLE_OMP_TARGET,
	GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
	* gimple.h (enum gf_mask): GF_OMP_FOR_KIND_DISTRIBUTE,
	GF_OMP_FOR_COMBINED, GF_OMP_FOR_COMBINED_INTO,
	GF_OMP_TARGET_KIND_MASK, GF_OMP_TARGET_KIND_REGION,
	GF_OMP_TARGET_KIND_DATA, GF_OMP_TARGET_KIND_UPDATE,
	GF_OMP_ATOMIC_SEQ_CST): New.
	(gimple_build_omp_taskgroup, gimple_build_omp_target,
	gimple_build_omp_teams): New prototypes.
	(gimple_has_substatements): Handle GIMPLE_OMP_TARGET,
	GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
	(gimple_omp_subcode): Use GIMPLE_OMP_TEAMS instead of
	GIMPLE_OMP_SINGLE as end of range.
	(gimple_omp_return_set_lhs, gimple_omp_return_lhs,
	gimple_omp_return_lhs_ptr, gimple_omp_atomic_seq_cst_p,
	gimple_omp_atomic_set_seq_cst, gimple_omp_for_combined_p,
	gimple_omp_for_set_combined_p, gimple_omp_for_combined_into_p,
	gimple_omp_for_set_combined_into_p, gimple_omp_target_clauses,
	gimple_omp_target_clauses_ptr, gimple_omp_target_set_clauses,
	gimple_omp_target_kind, gimple_omp_target_set_kind,
	gimple_omp_target_child_fn, gimple_omp_target_child_fn_ptr,
	gimple_omp_target_set_child_fn, gimple_omp_target_data_arg,
	gimple_omp_target_data_arg_ptr, gimple_omp_target_set_data_arg,
	gimple_omp_teams_clauses, gimple_omp_teams_clauses_ptr,
	gimple_omp_teams_set_clauses): New inlines.
	(CASE_GIMPLE_OMP): Add GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS
	and GIMPLE_OMP_TASKGROUP.
	* tree-core.h (enum omp_clause_code): Add new OpenMP 4.0 clause
	codes.
	(enum omp_clause_depend_kind, enum omp_clause_map_kind,
	enum omp_clause_proc_bind_kind): New.
	(union omp_clause_subcode): Add depend_kind, map_kind and
	proc_bind_kind fields.
	* tree-cfg.c (make_edges): Handle GIMPLE_OMP_TARGET,
	GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
	* langhooks-def.h (lhd_omp_mappable_type): New prototype.
	(LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add it.
gcc/c-family/
	* c-cppbuiltin.c (c_cpp_builtins): Predefine _OPENMP to
	201307 instead of 201107.
	* c-common.c (DEF_FUNCTION_TYPE_8): Define.
	(c_common_attribute_table): Add "omp declare target" and
	"omp declare simd" attributes.
	(handle_omp_declare_target_attribute,
	handle_omp_declare_simd_attribute): New functions.
	* c-omp.c: Include c-pragma.h.
	(c_finish_omp_taskgroup): New function.
	(c_finish_omp_atomic): Add swapped argument, if true,
	build the operation first with rhs, lhs arguments and use NOP_EXPR
	build_modify_expr.
	(c_finish_omp_for): Add code argument, pass it down to make_code.
	(c_omp_split_clauses): New function.
	(c_split_parallel_clauses): Removed.
	(c_omp_declare_simd_clause_cmp, c_omp_declare_simd_clauses_to_numbers,
	c_omp_declare_simd_clauses_to_decls): New functions.
	* c-common.h (omp_clause_mask): New type.
	(OMP_CLAUSE_MASK_1): Define.
	(omp_clause_mask::omp_clause_mask, omp_clause_mask::operator &=,
	omp_clause_mask::operator |=, omp_clause_mask::operator ~,
	omp_clause_mask::operator |, omp_clause_mask::operator &,
	omp_clause_mask::operator <<, omp_clause_mask::operator >>,
	omp_clause_mask::operator ==): New methods.
	(enum c_omp_clause_split): New.
	(c_finish_omp_taskgroup): New prototype.
	(c_finish_omp_atomic): Add swapped argument.
	(c_finish_omp_for): Add code argument.
	(c_omp_split_clauses): New prototype.
	(c_split_parallel_clauses): Removed.
	(c_omp_declare_simd_clauses_to_numbers,
	c_omp_declare_simd_clauses_to_decls): New prototypes.
	* c-pragma.c (omp_pragmas): Add new OpenMP 4.0 constructs.
	* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_CANCEL,
	PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_DECLARE_REDUCTION,
	PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_END_DECLARE_TARGET, PRAGMA_OMP_SIMD,
	PRAGMA_OMP_TARGET, PRAGMA_OMP_TASKGROUP and PRAGMA_OMP_TEAMS.
	Remove PRAGMA_OMP_PARALLEL_FOR and PRAGMA_OMP_PARALLEL_SECTIONS.
	(enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_ALIGNED,
	PRAGMA_OMP_CLAUSE_DEPEND, PRAGMA_OMP_CLAUSE_DEVICE,
	PRAGMA_OMP_CLAUSE_DIST_SCHEDULE, PRAGMA_OMP_CLAUSE_FOR,
	PRAGMA_OMP_CLAUSE_FROM, PRAGMA_OMP_CLAUSE_INBRANCH,
	PRAGMA_OMP_CLAUSE_LINEAR, PRAGMA_OMP_CLAUSE_MAP,
	PRAGMA_OMP_CLAUSE_NOTINBRANCH, PRAGMA_OMP_CLAUSE_NUM_TEAMS,
	PRAGMA_OMP_CLAUSE_PARALLEL, PRAGMA_OMP_CLAUSE_PROC_BIND,
	PRAGMA_OMP_CLAUSE_SAFELEN, PRAGMA_OMP_CLAUSE_SECTIONS,
	PRAGMA_OMP_CLAUSE_SIMDLEN, PRAGMA_OMP_CLAUSE_TASKGROUP,
	PRAGMA_OMP_CLAUSE_THREAD_LIMIT, PRAGMA_OMP_CLAUSE_TO and
	PRAGMA_OMP_CLAUSE_UNIFORM.
gcc/ada/
	* gcc-interface/utils.c (DEF_FUNCTION_TYPE_8): Define.
gcc/fortran/
	* trans-openmp.c (gfc_omp_clause_default_ctor,
	gfc_omp_clause_dtor): Return NULL for OMP_CLAUSE_REDUCTION.
	* f95-lang.c (ATTR_NULL, DEF_FUNCTION_TYPE_8): Define.
	* types.def (DEF_FUNCTION_TYPE_8): Document.
	(BT_FN_VOID_OMPFN_PTR_UINT,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): Remove.
	(BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
	BT_FN_BOOL_INT, BT_FN_BOOL_INT_BOOL, BT_FN_VOID_UINT_UINT,
	BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR,
	BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): New.
gcc/lto/
	* lto-lang.c (DEF_FUNCTION_TYPE_8): Define.
gcc/c/
	* c-lang.h (current_omp_declare_target_attribute): New extern
	decl.
	* c-parser.c: Include c-lang.h.
	(struct c_parser): Change tokens to c_token *.
	Add tokens_buf field.  Change tokens_avail type to unsigned int.
	(c_parser_consume_token): If parser->tokens isn't
	&parser->tokens_buf[0], increment parser->tokens.
	(c_parser_consume_pragma): Likewise.
	(enum pragma_context): Add pragma_struct and pragma_param.
	(c_parser_external_declaration): Adjust
	c_parser_declaration_or_fndef caller.
	(c_parser_declaration_or_fndef): Add omp_declare_simd_clauses
	argument, if it is non-vNULL vector, call c_finish_omp_declare_simd.
	Adjust recursive call.
	(c_parser_struct_or_union_specifier): Use pragma_struct instead
	of pragma_external.
	(c_parser_parameter_declaration): Use pragma_param instead of
	pragma_external.
	(c_parser_compound_statement_nostart, c_parser_label,
	c_parser_for_statement): Adjust
	c_parser_declaration_or_fndef callers.
	(c_parser_expr_no_commas): Add omp_atomic_lhs argument, pass
	it through to c_parser_conditional_expression.
	(c_parser_conditional_expression): Add omp_atomic_lhs argument,
	pass it through to c_parser_binary_expression.  Adjust recursive
	call.
	(c_parser_binary_expression): Remove prec argument, add
	omp_atomic_lhs argument instead.  Always start from PREC_NONE, if
	omp_atomic_lhs is non-NULL and one of the arguments of toplevel
	binop matches it, use build2 instead of parser_build_binary_op.
	(c_parser_pragma): Handle PRAGMA_OMP_CANCEL,
	PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_TARGET,
	PRAGMA_OMP_END_DECLARE_TARGET, PRAGMA_OMP_DECLARE_REDUCTION.
	Handle pragma_struct and pragma_param the same as pragma_external.
	(c_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
	(c_parser_omp_variable_list): Parse array sections for
	OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses.
	(c_parser_omp_clause_collapse): Fully fold collapse expression.
	(c_parser_omp_clause_reduction): Handle user defined reductions.
	(c_parser_omp_clause_branch, c_parser_omp_clause_cancelkind,
	c_parser_omp_clause_num_teams, c_parser_omp_clause_thread_limit,
	c_parser_omp_clause_aligned, c_parser_omp_clause_linear,
	c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen,
	c_parser_omp_clause_depend, c_parser_omp_clause_map,
	c_parser_omp_clause_device, c_parser_omp_clause_dist_schedule,
	c_parser_omp_clause_proc_bind, c_parser_omp_clause_to,
	c_parser_omp_clause_from, c_parser_omp_clause_uniform): New functions.
	(c_parser_omp_all_clauses): Add finish_p argument.  Don't call
	c_finish_omp_clauses if it is false.  Handle new OpenMP 4.0 clauses.
	(c_parser_omp_atomic): Parse seq_cst clause, pass true if it is
	present to c_finish_omp_atomic.  Handle OpenMP 4.0 atomic forms.
	(c_parser_omp_for_loop): Add CODE argument, pass it through
	to c_finish_omp_for.  Change last argument to cclauses,
	and adjust uses to grab parallel clauses from the array of all
	the split clauses.  Adjust c_parser_binary_expression,
	c_parser_declaration_or_fndef and c_finish_omp_for callers.
	(omp_split_clauses): New function.
	(c_parser_omp_simd): New function.
	(c_parser_omp_for): Add p_name, mask and cclauses arguments.
	Allow the function to be called also when parsing combined constructs,
	and call c_parser_omp_simd when parsing for simd.
	(c_parser_omp_sections_scope): If section-sequence doesn't start with
	#pragma omp section, require exactly one structured-block instead of
	sequence of statements.
	(c_parser_omp_sections): Add p_name, mask and cclauses arguments.
	Allow the function to be called also when parsing combined constructs.
	(c_parser_omp_parallel): Add p_name, mask and cclauses arguments.
	Allow the function to be called also when parsing combined
	constructs.
	(c_parser_omp_taskgroup, c_parser_omp_cancel,
	c_parser_omp_cancellation_point, c_parser_omp_distribute,
	c_parser_omp_teams, c_parser_omp_target_data,
	c_parser_omp_target_update, c_parser_omp_target,
	c_parser_omp_declare_simd, c_finish_omp_declare_simd,
	c_parser_omp_declare_target, c_parser_omp_end_declare_target,
	c_parser_omp_declare_reduction, c_parser_omp_declare): New functions.
	(c_parser_omp_construct): Add p_name and mask vars.  Handle
	PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
	PRAGMA_OMP_TEAMS.  Adjust c_parser_omp_for, c_parser_omp_parallel
	and c_parser_omp_sections callers.
	(c_parse_file): Initialize tparser.tokens and the_parser->tokens here.
	(OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
	OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
	(OMP_PARALLEL_CLAUSE_MASK): Likewise.  Add OMP_CLAUSE_PROC_BIND.
	(OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.  Add
	OMP_CLAUSE_DEPEND.
	(OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
	OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
	OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
	OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
	OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
	* c-typeck.c: Include tree-inline.h.
	(c_finish_omp_cancel, c_finish_omp_cancellation_point,
	handle_omp_array_sections_1, handle_omp_array_sections,
	c_clone_omp_udr, c_find_omp_placeholder_r): New functions.
	(c_finish_omp_clauses): Handle new OpenMP 4.0 clauses and
	user defined reductions.
	(c_tree_equal): New function.
	* c-tree.h (temp_store_parm_decls, temp_pop_parm_decls,
	c_finish_omp_cancel, c_finish_omp_cancellation_point, c_tree_equal,
	c_omp_reduction_id, c_omp_reduction_decl, c_omp_reduction_lookup,
	c_check_omp_declare_reduction_r): New prototypes.
	* c-decl.c (current_omp_declare_target_attribute): New variable.
	(c_decl_attributes): New function.
	(start_decl, start_function): Use it instead of decl_attributes.
	(temp_store_parm_decls, temp_pop_parm_decls, c_omp_reduction_id,
	c_omp_reduction_decl, c_omp_reduction_lookup,
	c_check_omp_declare_reduction_r): New functions.
gcc/cp/
	* decl.c (duplicate_decls): Error out for redeclaration of UDRs.
	(declare_simd_adjust_this): New function.
	(grokfndecl): If "omp declare simd" attribute is present,
	call declare_simd_adjust_this if needed and
	c_omp_declare_simd_clauses_to_numbers.
	* cp-array-notation.c (expand_array_notation_exprs): Handle
	OMP_TASKGROUP.
	* cp-gimplify.c (cp_gimplify_expr): Handle OMP_SIMD and
	OMP_DISTRIBUTE.  Handle is_invisiref_parm decls in
	OMP_CLAUSE_REDUCTION.
	(cp_genericize_r): Handle OMP_SIMD and OMP_DISTRIBUTE like
	OMP_FOR.
	(cxx_omp_privatize_by_reference): Return true for
	is_invisiref_parm decls.
	(cxx_omp_finish_clause): Adjust cxx_omp_create_clause_info
	caller.
	* pt.c (apply_late_template_attributes): For "omp declare simd"
	attribute call tsubst_omp_clauses,
	c_omp_declare_simd_clauses_to_decls, finish_omp_clauses
	and c_omp_declare_simd_clauses_to_numbers.
	(instantiate_class_template_1): Call cp_check_omp_declare_reduction
	for UDRs.
	(tsubst_decl): Handle UDRs.
	(tsubst_omp_clauses): Add declare_simd argument, if true don't
	call finish_omp_clauses.  Handle new OpenMP 4.0 clauses.
	Handle non-NULL OMP_CLAUSE_REDUCTION_PLACEHOLDER on
	OMP_CLAUSE_REDUCTION.
	(tsubst_expr): For UDRs call pushdecl and
	cp_check_omp_declare_reduction.  Adjust tsubst_omp_clauses
	callers.  Handle OMP_SIMD, OMP_DISTRIBUTE, OMP_TEAMS,
	OMP_TARGET_DATA, OMP_TARGET_UPDATE, OMP_TARGET, OMP_TASKGROUP.
	Adjust finish_omp_atomic caller.
	(tsubst_omp_udr): New function.
	(instantiate_decl): For UDRs at block scope, don't call
	start_preparsed_function/finish_function.  Call tsubst_omp_udr.
	* semantics.c (cxx_omp_create_clause_info): Add need_dtor argument,
	use it instead of need_default_ctor || need_copy_ctor.
	(struct cp_check_omp_declare_reduction_data): New type.
	(handle_omp_array_sections_1, handle_omp_array_sections,
	omp_reduction_id, omp_reduction_lookup,
	cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction_r,
	cp_check_omp_declare_reduction, clone_omp_udr,
	find_omp_placeholder_r, finish_omp_reduction_clause): New functions.
	(finish_omp_clauses): Handle new OpenMP 4.0 clauses and user defined
	reductions.
	(finish_omp_for): Add CODE argument, use it instead of hardcoded
	OMP_FOR.  Adjust c_finish_omp_for caller.
	(finish_omp_atomic): Add seq_cst argument, adjust
	c_finish_omp_atomic callers, handle seq_cst and new OpenMP 4.0
	atomic variants.
	(finish_omp_cancel, finish_omp_cancellation_point): New functions.
	* decl2.c (mark_used): Force immediate instantiation of
	DECL_OMP_DECLARE_REDUCTION_P decls.
	(is_late_template_attribute): Return true for "omp declare simd"
	attribute.
	(cp_omp_mappable_type): New function.
	(cplus_decl_attributes): Add implicit "omp declare target" attribute
	if requested.
	* parser.c (cp_debug_parser): Print
	parser->colon_doesnt_start_class_def_p.
	(cp_ensure_no_omp_declare_simd, cp_finalize_omp_declare_simd): New
	functions.
	(enum pragma_context): Add pragma_member and pragma_objc_icode.
	(cp_parser_binary_expression): Handle no_toplevel_fold_p
	even for binary operations other than comparison.
	(cp_parser_linkage_specification): Call
	cp_ensure_no_omp_declare_simd if needed.
	(cp_parser_namespace_definition): Likewise.
	(cp_parser_init_declarator): Call cp_finalize_omp_declare_simd.
	(cp_parser_direct_declarator): Pass declarator to
	cp_parser_late_return_type_opt.
	(cp_parser_late_return_type_opt): Add declarator argument,
	call cp_parser_late_parsing_omp_declare_simd for declare simd.
	(cp_parser_class_specifier_1): Call cp_ensure_no_omp_declare_simd.
	Parse UDRs before all other methods.
	(cp_parser_member_specification_opt): Use pragma_member instead of
	pragma_external.
	(cp_parser_member_declaration): Call cp_finalize_omp_declare_simd.
	(cp_parser_function_definition_from_specifiers_and_declarator,
	cp_parser_save_member_function_body): Likewise.
	(cp_parser_late_parsing_for_member): Handle UDRs specially.
	(cp_parser_next_token_starts_class_definition_p): Don't allow
	CPP_COLON if colon_doesnt_start_class_def_p flag is true.
	(cp_parser_objc_interstitial_code): Use pragma_objc_icode
	instead of pragma_external.
	(cp_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
	(cp_parser_omp_var_list_no_open): Parse array sections for
	OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses.  Add COLON argument,
	if non-NULL, allow parsing to end with a colon rather than close
	paren.
	(cp_parser_omp_var_list): Adjust cp_parser_omp_var_list_no_open
	caller.
	(cp_parser_omp_clause_reduction): Handle user defined reductions.
	(cp_parser_omp_clause_branch, cp_parser_omp_clause_cancelkind,
	cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
	cp_parser_omp_clause_aligned, cp_parser_omp_clause_linear,
	cp_parser_omp_clause_safelen, cp_parser_omp_clause_simdlen,
	cp_parser_omp_clause_depend, cp_parser_omp_clause_map,
	cp_parser_omp_clause_device, cp_parser_omp_clause_dist_schedule,
	cp_parser_omp_clause_proc_bind, cp_parser_omp_clause_to,
	cp_parser_omp_clause_from, cp_parser_omp_clause_uniform): New
	functions.
	(cp_parser_omp_all_clauses): Add finish_p argument.  Don't call
	finish_omp_clauses if it is false.  Handle new OpenMP 4.0 clauses.
	(cp_parser_omp_atomic): Parse seq_cst clause, pass
	true if it is present to finish_omp_atomic.  Handle new OpenMP 4.0
	atomic forms.
	(cp_parser_omp_for_loop): Add CODE argument, pass it through
	to finish_omp_for.  Change last argument to cclauses,
	and adjust uses to grab parallel clauses from the array of all
	the split clauses.
	(cp_omp_split_clauses): New function.
	(cp_parser_omp_simd): New function.
	(cp_parser_omp_for): Add p_name, mask and cclauses arguments.
	Allow the function to be called also when parsing combined constructs,
	and call c_parser_omp_simd when parsing for simd.
	(cp_parser_omp_sections_scope): If section-sequence doesn't start with
	#pragma omp section, require exactly one structured-block instead of
	sequence of statements.
	(cp_parser_omp_sections): Add p_name, mask and cclauses arguments.
	Allow the function to be called also when parsing combined constructs.
	(cp_parser_omp_parallel): Add p_name, mask and cclauses arguments.
	Allow the function to be called also when parsing combined
	constructs.
	(cp_parser_omp_taskgroup, cp_parser_omp_cancel,
	cp_parser_omp_cancellation_point, cp_parser_omp_distribute,
	cp_parser_omp_teams, cp_parser_omp_target_data,
	cp_parser_omp_target_update, cp_parser_omp_target,
	cp_parser_omp_declare_simd, cp_parser_late_parsing_omp_declare_simd,
	cp_parser_omp_declare_target, cp_parser_omp_end_declare_target,
	cp_parser_omp_declare_reduction_exprs, cp_parser_omp_declare_reduction,
	cp_parser_omp_declare): New functions.
	(cp_parser_omp_construct): Add p_name and mask vars.  Handle
	PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
	PRAGMA_OMP_TEAMS.  Adjust cp_parser_omp_for, cp_parser_omp_parallel
	and cp_parser_omp_sections callers.
	(cp_parser_pragma): Handle PRAGMA_OMP_CANCEL,
	PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_DECLARE_REDUCTION,
	PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
	PRAGMA_OMP_TEAMS, PRAGMA_OMP_TARGET, PRAGMA_OMP_END_DECLARE_TARGET.
	Handle pragma_member and pragma_objc_icode like pragma_external.
	(OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
	OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
	(OMP_PARALLEL_CLAUSE_MASK): Likewise.  Add OMP_CLAUSE_PROC_BIND.
	(OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.  Add
	OMP_CLAUSE_DEPEND.
	(OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
	OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
	OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
	OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
	OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
	* parser.h (struct cp_omp_declare_simd_data): New type.
	(struct cp_parser): Add colon_doesnt_start_class_def_p and
	omp_declare_simd fields.
	* cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
	* cp-tree.h (struct lang_decl_fn): Add omp_declare_reduction_p
	bit.
	(DECL_OMP_DECLARE_REDUCTION_P): Define.
	(OMP_FOR_GIMPLIFYING_P): Use OMP_LOOP_CHECK macro.
	(struct saved_scope): Add omp_declare_target_attribute field.
	(cp_omp_mappable_type, omp_reduction_id,
	cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction,
	finish_omp_cancel, finish_omp_cancellation_point): New prototypes.
	(finish_omp_for): Add CODE argument.
	(finish_omp_atomic): Add seq_cst argument.
	(cxx_omp_create_clause_info): Add need_dtor argument.
gcc/testsuite/
	* c-c++-common/gomp/atomic-15.c: Adjust for C diagnostics.
	Remove error test that is now valid in OpenMP 4.0.
	* c-c++-common/gomp/atomic-16.c: New test.
	* c-c++-common/gomp/cancel-1.c: New test.
	* c-c++-common/gomp/depend-1.c: New test.
	* c-c++-common/gomp/depend-2.c: New test.
	* c-c++-common/gomp/map-1.c: New test.
	* c-c++-common/gomp/pr58472.c: New test.
	* c-c++-common/gomp/sections1.c: New test.
	* c-c++-common/gomp/simd1.c: New test.
	* c-c++-common/gomp/simd2.c: New test.
	* c-c++-common/gomp/simd3.c: New test.
	* c-c++-common/gomp/simd4.c: New test.
	* c-c++-common/gomp/simd5.c: New test.
	* c-c++-common/gomp/single1.c: New test.
	* g++.dg/gomp/block-0.C: Adjust for stricter #pragma omp sections
	parser.
	* g++.dg/gomp/block-3.C: Likewise.
	* g++.dg/gomp/clause-3.C: Adjust error messages.
	* g++.dg/gomp/declare-simd-1.C: New test.
	* g++.dg/gomp/declare-simd-2.C: New test.
	* g++.dg/gomp/depend-1.C: New test.
	* g++.dg/gomp/depend-2.C: New test.
	* g++.dg/gomp/target-1.C: New test.
	* g++.dg/gomp/target-2.C: New test.
	* g++.dg/gomp/taskgroup-1.C: New test.
	* g++.dg/gomp/teams-1.C: New test.
	* g++.dg/gomp/udr-1.C: New test.
	* g++.dg/gomp/udr-2.C: New test.
	* g++.dg/gomp/udr-3.C: New test.
	* g++.dg/gomp/udr-4.C: New test.
	* g++.dg/gomp/udr-5.C: New test.
	* g++.dg/gomp/udr-6.C: New test.
	* gcc.dg/autopar/outer-1.c: Expect 4 instead of 5 loopfn matches.
	* gcc.dg/autopar/outer-2.c: Likewise.
	* gcc.dg/autopar/outer-3.c: Likewise.
	* gcc.dg/autopar/outer-4.c: Likewise.
	* gcc.dg/autopar/outer-5.c: Likewise.
	* gcc.dg/autopar/outer-6.c: Likewise.
	* gcc.dg/autopar/parallelization-1.c: Likewise.
	* gcc.dg/gomp/block-3.c: Adjust for stricter #pragma omp sections
	parser.
	* gcc.dg/gomp/clause-1.c: Adjust error messages.
	* gcc.dg/gomp/combined-1.c: Look for GOMP_parallel_loop_runtime
	instead of GOMP_parallel_loop_runtime_start.
	* gcc.dg/gomp/declare-simd-1.c: New test.
	* gcc.dg/gomp/declare-simd-2.c: New test.
	* gcc.dg/gomp/nesting-1.c: Adjust for stricter #pragma omp sections
	parser.  Add further #pragma omp sections nesting tests.
	* gcc.dg/gomp/target-1.c: New test.
	* gcc.dg/gomp/target-2.c: New test.
	* gcc.dg/gomp/taskgroup-1.c: New test.
	* gcc.dg/gomp/teams-1.c: New test.
	* gcc.dg/gomp/udr-1.c: New test.
	* gcc.dg/gomp/udr-2.c: New test.
	* gcc.dg/gomp/udr-3.c: New test.
	* gcc.dg/gomp/udr-4.c: New test.
	* gfortran.dg/gomp/appendix-a/a.35.5.f90: Add dg-error.

Co-Authored-By: Richard Henderson <rth@redhat.com>
Co-Authored-By: Tobias Burnus <burnus@net-b.de>

From-SVN: r203408
2013-10-11 11:26:50 +02:00
Tom Tromey 7c6fedd2ff * Make-lang.in (LTO_H, LINKER_PLUGIN_API_H, LTO_TREE_H)
(lto/lto-lang.o, lto/lto.o, lto/lto-partition.o)
	(lto/lto-object.o): Remove.

From-SVN: r202906
2013-09-25 16:28:35 +00:00
Richard Biener 35f32ad4a7 lto-streamer.h (lto_global_var_decls): Remove.
2013-09-06  Richard Biener  <rguenther@suse.de>

	* lto-streamer.h (lto_global_var_decls): Remove.
	* Makefile.in (OBJS): Remove lto-symtab.o.
	(lto-symtab.o): Remove.
	(GTFILES): Remove lto-symtab.c
	* lto-symtab.c: Move to lto/

	lto/
	* lto-symtab.c: Move from gcc/
	* lto.h: Include vec.h.
	(lto_global_var_decls): Declare.
	* lto.c (lto_global_var_decls): Move definition here.
	* Make-lang.in (LTO_OBJS): Add lto-symtab.o.
	(lto-symtab.o): Add.
	* config-lang.in (gtfiles): Add lto.h.

From-SVN: r202313
2013-09-06 09:06:25 +00:00
Jan Hubicka 49322b127d lto.c (mentions_vars_p_field_decl, [...]): DECL_FIELD_OFFSET can contain an reference to variable.
* lto.c (mentions_vars_p_field_decl, lto_fixup_prevailing_decls): 
	DECL_FIELD_OFFSET can contain an reference to variable.

From-SVN: r202174
2013-09-02 14:45:06 +00:00
Jan Hubicka 31f1f73b3e lto.c (tree_with_vars): Turn into vector.
* lto.c (tree_with_vars): Turn into vector.
	(MAYBE_REMEMBER_WITH_VARS): Change to...
	(CHECK_VAR): ... this one.
	(CHECK_NO_VAR): New macro.
	(maybe_remember_with_vars_typed): Turn to ...
	(mentions_vars_p_typed): ... this one.
	(maybe_remember_with_vars_common): Turn to ...
	(mentions_vars_p_comon): ... this one.
	(maybe_remember_with_vars_decl_minimal): Turn to ...
	(mentions_vars_p_decl_minmal): ... this one.
	(maybe_remember_with_vars_decl_common): Turn to ...
	(mentions_vars_p_decl_common): ... this one.
	(maybe_remember_with_vars_decl_with_vis): Turn to ...
	(mentions_vars_p_decl_with_vis): ... this one.
	(maybe_remember_with_vars_decl_non_common): Turn to ...
	(mentions_vars_p_decl_non_common): ... this one.
	(maybe_remember_with_vars_function): Turn to ...
	(mentions_vars_p_function): ... this one.
	(maybe_remember_with_vars_field_decl): Turn to ...
	(mentions_vars_p_field_decl): ... this one.
	(maybe_remember_with_vars_type): Turn to ...
	(mentions_vars_p_type): ... this one.
	(maybe_remember_with_vars_binfo): Turn to ...
	(mentions_vars_p_binfo): ... this one.
	(maybe_remember_with_vars_constructor): Turn to ...
	(mentions_vars_p_constructor): ... this one.
	(maybe_remember_with_vars_expr): Turn to ...
	(mentions_vars_p_expr): ... this one.
	(maybe_remember_with_vars): Turn to ...
	(mentions_vars_p): ... this one.
	(lto_read_decls): Update.
	(LTO_SET_PREVAIL): Do not call function for internal decls.
	(lto_fixup_prevailing_decls): Update to match mentions_vars_p;
	check that something was updated.
	(lto_fixup_state): Do not care about internal decls.
	(lto_fixup_decls): Update.
	(read_cgraph_and_symbols): Update.

From-SVN: r202143
2013-09-01 12:00:35 +00:00
Jan Hubicka 256eefa9a9 lto-symtab.c (lto_cgraph_replace_node): Free decl_in_state.
* lto-symtab.c (lto_cgraph_replace_node): Free decl_in_state.
	* cgraph.c (cgraph_release_function_body): Free decl_in_state.
	* lto-section-in.c (lto_free_function_in_decl_state): New function.
	(lto_free_function_in_decl_state_for_node): New function.

	* lto.c (read_cgraph_and_symbols): Remove ggc_collect;
	clear section node; add comment why we do not collect.

From-SVN: r202093
2013-08-30 07:33:06 +00:00
Jan Hubicka 0170f33ca0 lto.c (compare_tree_sccs_1): Compare DECL_FINAL_P...
* lto.c (compare_tree_sccs_1): Compare  DECL_FINAL_P,
	DECL_CXX_CONSTRUCTOR_P, DECL_CXX_DESTRUCTOR_P and
	TYPE_FINAL_P.

	* lto-streamer-out.c (hash_tree): Stream DECL_FINAL_P.
	DECL_CXX_CONSTRUCTOR_P. DECL_CXX_DESTRUCTOR_P.
	TYPE_FINAL_P.
	* lto-streamer-in.c (unpack_ts_decl_with_vis_value_fields):
	DECL_FINAL_P. DECL_CXX_CONSTRUCTOR_P and DECL_CXX_DESTRUCTOR_P.
	(unpack_ts_type_common_value_fields): Stream TYPE_FINAL_P.
	* tree-streamer-out.c (pack_ts_decl_with_vis_value_fields):
	Add DECL_FINAL_P, DECL_CXX_CONSTRUCTOR_P, DECL_CXX_DESTRUCTOR_P
	(pack_ts_type_common_value_fields): Add TYPE_FINAL_P.

From-SVN: r202079
2013-08-29 16:23:40 +00:00
Jan Hubicka c01c111b6f lto.c (compare_tree_sccs_1): Drop DECL_ERROR_ISSUED, DECL_DEFER_OUTPUT and DECL_IN_TEXT_SECTION.
* lto.c (compare_tree_sccs_1): Drop DECL_ERROR_ISSUED,
	DECL_DEFER_OUTPUT and DECL_IN_TEXT_SECTION.
	(unify_scc): Do checking assert.

	* lto-streamer-out.c (DFS_write_tree_body): Drop
	BINFO_INHERITANCE_CHAIN, BINFO_SUBVTT_INDEX and BINFO_VPTR_INDEX.
	(hash_tree): Do not hash DECL_DEFER_OUTPUT, BINFO_INHERITANCE_CHAIN,
	BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, DECL_IN_TEXT_SECTION.
	* tree-streamer-in.c (unpack_ts_decl_common_value_fields):
	Do not read DECL_ERROR_ISSUED.
	(unpack_ts_decl_with_vis_value_fields): Do not read
	DECL_DEFER_OUTPUT.
	(lto_input_ts_binfo_tree_pointers): Do not read BINFO_INHERITANCE_CHAIN,
        BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX
	* tree-streamer-out.c (pack_ts_decl_common_value_fields): Do not
	write DECL_ERROR_ISSUED..
	(pack_ts_decl_with_vis_value_fields): Do not write
	DECL_DEFER_OUTPUT.
	(write_ts_binfo_tree_pointers): Do not read BINFO_INHERITANCE_CHAIN,
        BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX
	* print-tree.c (print_node): Do not print DECL_ERROR_ISSUED.
	* tree.h (tree_decl_common): Update comment.
	(DECL_ERROR_ISSUED): Remove.

From-SVN: r202052
2013-08-28 15:03:43 +00:00
Jan Hubicka 6a49f3c94c lto-partition.c (lto_balanced_map): Always base order on source file order.
* lto-partition.c (lto_balanced_map): Always base order on 
	source file order.

Co-Authored-By: Martin Liska <marxin.liska@gmail.com>

From-SVN: r202041
2013-08-28 06:51:27 +00:00
Jan Hubicka a2e2a66815 cgraph.c (cgraph_get_body): New function based on lto.c implementation.
* cgraph.c (cgraph_get_body): New function based on lto.c
	implementation.
	* cgraph.h (cgraph_get_body): Declare.
	* cgraphclones.c (cgraph_create_virtual_clone): Commonize WPA and LTO paths.
	* cgraphunit.c (expand_function): Get body prior expanding.
	* ipa.c (function_and_variable_visibility): Use gimple_has_body_p test.
	* lto-cgraph.c (lto_output_node): Do not stream bodies we don't really need.
	* passes.c (do_per_function_toporder): Get body.
	* tree-inline.c (expand_call_inline): Get body prior inlining it.
	* tree-ssa-structalias.c (ipa_pta_execute): Get body; skip clones.

	* lto.c (lto_materialize_function): Do not read body anymore.

From-SVN: r201537
2013-08-06 16:59:49 +00:00
Jan Hubicka 815effe155 lto-cgraph.c (compute_ltrans_boundary): Add abstract origins into boundaries.
* lto-cgraph.c (compute_ltrans_boundary): Add abstract origins into
	boundaries.
	* lto-streamer-out.c (tree_is_indexable): Results decls and
	parm decls are not indexable.
	(DFS_write_tree_body): Do not follow args and results.
	(hash_tree): Likewise.
	(output_functions): Rearrange so struct function is needed
	only when real body is output; be able to also ouptut abstract
	functions; output DECL_ARGUMENTS and DECL_RESULT.
	(lto_output): When not in WPA, ale store abstract functions.
	(write_symbol): Do not care about RESULT_DECL.
	(output_symbol_p): Handle correctly sbtract decls.
	* lto-streamer-in.c (input_function): Rearrange so struct
	function can be NULL at entry; allow streaming of
	functions w/o body; store DECL_ARGUMENTS and DECL_RESULT.
	* ipa.c (symtab_remove_unreachable_nodes): Silence confused
	sanity check during LTO.
	* tree-streamer-out.c (write_ts_decl_non_common_tree_pointers): Skip
	RESULT_DECl and DECL_ARGUMENTS.
	* tree-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers):
	Likewise.

	* lto.c (lto_materialize_function): Do not push struct function.
	* lto-partition.c (get_symbol_class): Handle abstracts correctly.
	(may_need_named_section_p): Even abstract origins may need
	named section.

From-SVN: r201468
2013-08-03 19:54:18 +00:00
David Malcolm 315f8c0e21 Introduce beginnings of a pass_manager class.
This patch introduces a gcc::pass_manager class and moves various non-GTY
globals relating to pass management into it.  The gcc::context gains its
first field: a pointer to the gcc::pass_manager instance.

gcc/
	* Makefile.in (PASS_MANAGER_H): New.
	(lto-cgraph.o): Depend on CONTEXT_H and PASS_MANAGER_H.
	(passes.o): Likewise.
	(statistics.o): Likewise.
	(cgraphunit.o): Likewise.
	(context.o): Depend on PASS_MANAGER_H.

	* pass_manager.h: New.

	* cgraphunit.c (cgraph_add_new_function): Update for moves
	of globals to fields of pass_manager.
	(analyze_function): Likewise.
	(expand_function): Likewise.
	(ipa_passes): Likewise.
	(compile): Likewise.

	* context.c (context::context): New.
	* context.h  (context::context): New.
	(context::get_passes): New.
	(context::passes_): New.

	* lto-cgraph.c (input_node): Update for moves of globals to
	fields of pass_manager.

	* passes.c (all_passes): Remove, in favor of a field of the
	same name within the new class pass_manager.
	(all_small_ipa_passes): Likewise.
	(all_lowering_passes): Likewise.
	(all_regular_ipa_passes): Likewise.
	(all_late_ipa_passes): Likewise.
	(all_lto_gen_passes): Likewise.
	(passes_by_id): Likewise.
	(passes_by_id_size): Likewise.
	(gcc_pass_lists): Remove, in favor of "pass_lists" field within
	the new class pass_manager.
	(set_pass_for_id): Convert to...
	(pass_manager::set_pass_for_id): ...method.
	(get_pass_for_id): Convert to...
	(pass_manager::get_pass_for_id): ...method.
	(register_one_dump_file): Move body of implementation into...
	(pass_manager::register_one_dump_file): ...here.
	(register_dump_files_1): Convert to...
	(pass_manager::register_dump_files_1): ...method.
	(register_dump_files): Convert to...
	(pass_manager::register_dump_files): ...method.
	(create_pass_tab): Update for moves of globals to fields of
	pass_manager.
	(dump_passes): Move body of implementation into...
	(pass_manager::dump_passes): ...here.
	(register_pass): Move body of implementation into...
	(pass_manager::register_pass): ...here.
	(init_optimization_passes): Convert into...
	(pass_manager::pass_manager): ...constructor for new
	pass_manager class, and initialize the pass_lists array.
	(check_profile_consistency): Update for moves of globals to
	fields of pass_manager.
	(dump_profile_report): Move body of implementation into...
	(pass_manager::dump_profile_report): ...here.
	(ipa_write_summaries_1): Update for moves of pass lists from
	being globals to fields of pass_manager.
	(ipa_write_optimization_summaries): Likewise.
	(ipa_read_summaries):  Likewise.
	(ipa_read_optimization_summaries): Likewise.
	(execute_all_ipa_stmt_fixups): Likewise.

	* statistics.c (statistics_fini): Update for moves of globals to
	fields of pass_manager.

	* toplev.c (general_init): Replace call to
	init_optimization_passes with construction of the pass_manager
	instance.

	* tree-pass.h (all_passes): Remove, in favor of a field of the
	same name within the new class pass_manager.
	(all_small_ipa_passes): Likewise.
	(all_lowering_passes): Likewise.
	(all_regular_ipa_passes): Likewise.
	(all_lto_gen_passes): Likewise.
	(all_late_ipa_passes): Likewise.
	(passes_by_id): Likewise.
	(passes_by_id_size): Likewise.
	(gcc_pass_lists): Remove, in favor of "pass_lists" field within
	the new class pass_manager.
	(get_pass_for_id): Remove.

gcc/lto/

	* Make-lang.in (lto/lto.o:): Depend on CONTEXT_H and
	PASS_MANAGER_H.

	* lto.c (do_whole_program_analysis): Update for move of
	all_regular_ipa_passes from a global to a field of class
	pass_manager.

From-SVN: r201351
2013-07-30 18:52:03 +00:00
Ondřej Bílka 1aa95df742 Fix typos.
From-SVN: r201109
2013-07-21 18:18:04 +00:00
Jan Hubicka c525ba9a3f lto-partition.c (lto_balanced_map): Fix -fno-toplevel-reorder partitioning of variables.
* lto-partition.c (lto_balanced_map): Fix -fno-toplevel-reorder
	partitioning of variables.

From-SVN: r201065
2013-07-19 18:19:48 +00:00
Jan Hubicka 7a89ad0008 lto-cgraph.c (input_symtab): Do not set cgraph state.
* lto-cgraph.c (input_symtab): Do not set cgraph state.
	* lto.c (read_cgraph_and_symbols): Set cgraph state.

From-SVN: r200247
2013-06-20 14:23:15 +00:00
Jan Hubicka 6a6dac5293 cgraph.h (const_value_known_p): Replace by ...
* cgraph.h (const_value_known_p): Replace by ...
	(ctor_for_folding): .. this one.
	* cgraphunit.c (process_function_and_variable_attributes): Use it.
	* lto-cgraph.c (compute_ltrans_boundary): Use ctor_for_folding.
	* expr.c (expand_expr_real_1): Likewise.
	(string_constant): Likewise.
	* tree-ssa-loop-ivcanon.c (constant_after_peeling): Likewise.
	* ipa.c (process_references): Likewise.
	(symtab_remove_unreachable_nodes): Likewise.
	* ipa-inline-analysis.c (param_change_prob): Likewise.
	* gimple-fold.c (canonicalize_constructor_val): Likewise.
	(get_base_constructor): Likwise.
	* varpool.c (varpool_remove_node): Likewise.
	(varpool_remove_initializer): LIkewise.
	(dump_varpool_node): LIkwise.
	(const_value_known_p): Rewrite to ...
	(ctor_for_folding): ... this one.

	* lto-partition.c (add_references_to_partition): Use
	ctor_for_folding.

	* gcc.dg/tree-ssa/attr-alias-2.c: New testcase.

From-SVN: r200211
2013-06-19 18:06:12 +00:00
Richard Biener ac0511f233 tree-streamer.h (streamer_tree_cache_create): Adjust prototype.
2013-06-18  Richard Biener  <rguenther@suse.de>

	* tree-streamer.h (streamer_tree_cache_create): Adjust prototype.
	* tree-streamer.c (streamer_tree_cache_create): Make maintaining
	the map from cache entry to cache index optional.
	(streamer_tree_cache_replace_tree): Adjust accordingly.
	(streamer_tree_cache_append): Likewise.
	(streamer_tree_cache_delete): Likewise.
	* lto-streamer-in.c (lto_data_in_create): Do not maintain the
	streamer cache map from cache entry to cache index.
	* lto-streamer-out.c (create_output_block): Adjust.

	lto/
	* lto.c (lto_register_var_decl_in_symtab): Pass in cache index
	and use it.
	(lto_register_function_decl_in_symtab): Likewise.
	(cmp_tree): New function.
	(unify_scc): Instead of using the streamer cache map from entry
	to cache index match up the two maps we have by sorting them.
	Adjust calls to lto_register_var_decl_in_symtab and
	lto_register_function_decl_in_symtab.

From-SVN: r200168
2013-06-18 12:56:42 +00:00
Richard Biener ee03e71d47 lto-streamer.h (enum LTO_tags): Add LTO_tree_scc.
2013-06-17  Richard Biener  <rguenther@suse.de>

	* lto-streamer.h (enum LTO_tags): Add LTO_tree_scc.
	(lto_input_scc): Declare.
	(lto_input_tree_1): Likewise.
	(struct lto_stats_d): Add num_tree_bodies_output and
	num_pickle_refs_output.
	* lto-streamer-in.c (lto_read_body): Use streamer_tree_cache_get_tree.
	(lto_read_tree_1): Split out from ...
	(lto_read_tree): ... this.
	(lto_input_scc): New function.
	(lto_input_tree_1): Split out from ...
	(lto_input_tree): ... this.  Handle LTO_tree_scc.
	(lto_data_in_create): Create the streamer cache without hashes.
	* lto-streamer-out.c (create_output_block): Create the streamer
	cache with hashes when not doing WPA.
	(lto_write_tree_1): Split out from ...
	(lto_write_tree): ... this.
	(get_symbol_initial_value): New function.
	(lto_output_tree_1): Split out from ...
	(lto_output_tree): ... this.  Write trees as series of SCCs
	using a DFS walk via DFS_write_tree.
	(struct sccs, struct scc_entry): New types.
	(next_dfs_num, sccstack, sccstate, sccstate_obstack): New globals.
	(DFS_write_tree_body): New function.
	(DFS_write_tree): Likewise.
	(hash_tree): Likewise.
	(scc_entry_compare): Likewise.
	(hash_scc): Likewise.
	(tree_is_indexable): DEBUG_EXPR_DECLs are local entities.
	* tree-streamer-in.c (lto_input_ts_list_tree_pointers): Stream
	TREE_CHAIN as regular reference.
	(streamer_read_integer_cst): Remove.
	(streamer_get_pickled_tree): Adjust.
	* tree-streamer-out.c (streamer_write_chain): Disable streaming
	of DECL_EXTERNALs in BLOCK_VARS for now.
	(write_ts_list_tree_pointers): Stream TREE_CHAIN as regular
	reference.
	* tree-streamer.c (streamer_tree_cache_add_to_node_array):
	Add hash value argument and record that if hashes are recorded
	in the cache.
	(streamer_tree_cache_insert_1): Adjust.
	(streamer_tree_cache_insert): Likewise.
	(streamer_tree_cache_insert_at): Rename to ...
	(streamer_tree_cache_replace_tree): ... this and adjust.
	(streamer_tree_cache_append): Adjust.
	(record_common_node): Likewise.
	(streamer_tree_cache_create): Add argument whether to
	record hash values together with trees.
	(streamer_tree_cache_delete): Adjust.
	* tree-streamer.h (struct streamer_tree_cache_d): Add
	vector of hashes.
	(streamer_read_integer_cst): Remove.
	(streamer_tree_cache_insert): Adjust.
	(streamer_tree_cache_append): Likewise.
	(streamer_tree_cache_insert_at): Rename to ...
	(streamer_tree_cache_replace_tree): ... this and adjust.
	(streamer_tree_cache_create): Add argument whether to record hashes.
	(streamer_tree_cache_get): Rename to ...
	(streamer_tree_cache_get_tree): ... this.
	(streamer_tree_cache_get_hash): New function.
	* tree.c (cache_integer_cst): New function.
	* tree.h (cache_integer_cst): Declare.
	(ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move here from cp/cp-tree.h.
	* lto-symtab.c (lto_varpool_replace_node): Only release
	DECL_INITIAL of non-prevailing decls.
	* varpool.c (varpool_remove_initializer): Do not release
	DECL_INITIAL when we are still in CGRAPH_LTO_STREAMING.

	cp/
	* cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.

	lto/
	* Make-lang.in (lto.o): Add $(DATA_STREAMER_H) dependency.
	* lto.c: Include data-streamer.h.
	(lto_read_in_decl_state): Use streamer_tree_cache_get_tree.
	(gimple_type_leader_entry_s, gimple_type_leader,
	gimple_lookup_type_leader): Remove.
	(gtc_visit): Simplify.
	(gimple_types_compatible_p): Likewise.
	(gimple_register_type_1): Likewise.  Merge into ...
	(gimple_register_type): ... this.  Keep it as legacy for
	statistics purposes for now.
	(fixup_integer_cst): Remove.
	(LTO_FIXUP_TREE, lto_fixup_types, lto_ft_*): Simplify and
	rename to ...
	(MAYBE_REMEMBER_WITH_VARS, maybe_remember_with_vars,
	maybe_remember_with_vars_*): ... these.
	(uniquify_nodes): Remove.
	(lto_fixup_prevailing_type): New function.
	(struct tree_scc, struct tree_scc_hasher): New type and hasher.
	(tree_scc_hash, tree_scc_hash_obstack): New globals.
	(num_merged_types, num_prevailing_types, num_not_merged_types,
	num_not_merged_types_in_same_scc, total_scc_size, num_sccs_read,
	total_scc_size_merged, num_sccs_merged, num_scc_compares,
	num_scc_compare_collisions): New global counters.
	(compare_tree_sccs_1): New function.
	(compare_tree_sccs): Likewise.
	(unify_scc): Likewise.
	(lto_read_decls): Stream in tree SCCs and unify them on the
	way in.  Finalize prevailing SCC tree members.
	(read_cgraph_and_symbols): Do not initialize or free gimple_type_leader.
	Allocate and free tree_scc_hash_obstack and tree_scc_hash, do not bother
	to ggc-collect during merging.
	(print_lto_report_1): Adjust for new merging code.

From-SVN: r200151
2013-06-17 15:08:24 +00:00
Jan Hubicka ca0f62a888 cgraph.c (verify_edge_corresponds_to_fndecl): Be lax about decl has when in streaming stage.
* cgraph.c (verify_edge_corresponds_to_fndecl): Be lax about
	decl has when in streaming stage.
	* lto-symtab.c (lto_symtab_merge_symbols): Likewise.
	* cgraph.h (cgraph_state): Add CGRAPH_LTO_STREAMING.

	* lto.c (read_cgraph_and_symbols): Set cgraph into streaming state.

From-SVN: r200018
2013-06-12 14:41:12 +00:00
Jan Hubicka bbf9ad070d lto-symtab.c (lto_symtab_merge_symbols): Populate symtab hashtable.
* lto-symtab.c (lto_symtab_merge_symbols): Populate symtab hashtable.
	* cgraph.h (varpool_create_empty_node): Declare.
	* lto-cgraph.c (input_node, input_varpool_node): Forcingly create
	duplicated nodes.
	* symtab.c (symtab_unregister_node): Be lax about missin entries
	in node hash.
	(symtab_get_node): Update comment.
	* varpool.c (varpool_create_empty_node): Break out from ...
	(varpool_node_for_decl): ... here.
	* lto-streamer.h (lto_file_decl_data): Add RESOLUTION_MAP.

	* lto.c (register_resolution): Take lto_file_data argument.
	(lto_register_var_decl_in_symtab,
	lto_register_function_decl_in_symtab): Update.
	(read_cgraph_and_symbols): Update resolution_map handling.

From-SVN: r199990
2013-06-12 09:12:47 +00:00
Jan Hubicka 08346abd19 c-common.c (handle_alias_ifunc_attribute): Do not set DECL_EXTERNAL for weakref variables.
* c-family/c-common.c (handle_alias_ifunc_attribute): Do not set
	DECL_EXTERNAL for weakref variables.
	* c-family/c-pragma.c (handle_pragma_weak): Make sure aliases
	are not declared as external.
	* cgraph.c (cgraph_create_function_alias): Set weakref flag.
	* cgraph.h (symtab_node_base): Add weakref flag.
	* cgraphunit.c (cgraph_reset_node): Clear weakref flag.
	(handle_alias_pairs): Set weakref flag, do not set DECL_EXTERNAL.
	(output_weakrefs): Use weakref flag.
	* fold-const.c (simple_operand_p): Handle WEAK.
	* gimple-fold.c (can_refer_decl_in_current_unit_p): Drop weakref.
	* ipa.c (varpool_externally_visible_p): Drop weakref.
	(function_and_variable_visibility): Update comment; fix weakref
	sanity checks; do not clear DECL_WEAK on them.
	* lto-cgraph.c (lto_output_node): update.
	(lto_output_varpool_node): Update.
	(input_overwrite_node): Update.
	(input_node): Update.
	(input_varpool_node): Update.
	* lto-symtab.c (lto_symtab_symbol_p): Do not special case weakrefs.
	(lto_symtab_merge_symbols): Add sanity check.
	(lto_symtab_prevailing_decl): Do not special case weakrefs.
	* passes.c (rest_of_decl_compilation): Set static flag, too.
	* symtab.c (dump_symtab_base): Dump weakref.
	(verify_symtab_base): Sanity check weakrefs.
	(symtab_make_decl_local): Remove duplicated code.
	(symtab_alias_ultimate_target): Simplify.
	* varpool.c (varpool_create_variable_alias): Set weakref flag.

	* lto-partition.c (get_symbol_class): Simplify weakref handling.
	(add_symbol_to_partition_1): Likewise.
	(contained_in_symbol): Likewise.
	(lto_balanced_map): Likewise.
	(rename_statics): Drop weakref.

From-SVN: r199971
2013-06-11 22:41:54 +00:00
Richard Biener a367df532e tree-streamer.c (streamer_tree_cache_insert_1): Update the index associated with the tree we are supposed to replace.
2013-06-05  Richard Biener  <rguenther@suse.de>

	* tree-streamer.c (streamer_tree_cache_insert_1): Update the
	index associated with the tree we are supposed to replace.
	* tree-streamer-out.c (pack_ts_base_value_fields): Output
	TREE_ASM_WRITTEN as zero for everything but SSA names.

	lto/
	* lto.c (num_merged_types): New global variable.
	(uniquify_nodes): Increase num_merged_types when merging a type.
	(print_lto_report_1): Output the number of merged types.

From-SVN: r199683
2013-06-05 08:21:02 +00:00
Jan Hubicka 40a7fe1e38 lto-symtab.c (lto_symtab_merge_cgraph_nodes_1): Rename to ...
* lto-symtab.c (lto_symtab_merge_cgraph_nodes_1): Rename to ...
	(lto_symtab_merge_symbols_1): ... this one.
	(lto_symtab_merge_cgraph_nodes): Rename to ...
	(lto_symtab_merge_symbols): ... this one; simplify.
	* cgraph.c (same_body_aliases_done): Rename to ...
	(cpp_implicit_aliases_done): ... this one.
	(cgraph_create_function_alias): Update.
	(cgraph_same_body_alias): Update.
	(dump_cgraph_node): Remove alias dumping; simplify
	thunk dumping.
	(verify_edge_corresponds_to_fndecl): Simplify.
	* cgraph.h (symtab_node_base): Add cpp_implicit_alias,
	alias_target.
	(cgraph_node): Remove same_body_alias.
	(varpool_node): Remove alias_of and extra_name_alias.
	(same_body_aliases_done): Rename to ..
	(cpp_implicit_aliases_done): ... this one.
	(symtab_alias_ultimate_target): Add default parameter.
	(symtab_resolve_alias): New function.
	(fixup_same_cpp_alias_visibility): Declare.
	(cgraph_function_node): Add default parameter.
	(cgraph_node_asm_name): Likewise.
	(cgraph_function_or_thunk_node): Add default parameter; do
	not ICE when it is NULL.
	(varpool_variable_node): Likewise.
	* tree-emutls.c (create_emultls_var): Update.
	(ipa_lower_emutls): Update.
	* cgraphunit.c (cgraph_decide_is_function_needed): Update.
	(cgraph_reset_node): Reset alias info.
	(cgraph_finalize_function): Update.
	(fixup_same_cpp_alias_visibility): Move to symtab.c.
	(analyze_function): Simplify.
	(cgraph_process_same_body_aliases): Simplify.
	(analyze_functions): Fixup same body aliases.
	(handle_alias_pairs): Simplify.
	(assemble_thunk): Update.
	(assemble_thunks_and_aliases): Update.
	(output_weakrefs): Rewrite.
	* lto-cgraph.c (lto_output_node): Rewrite alias handling.
	(lto_output_varpool_node): Likewise.
	(compute_ltrans_boundary): Remve assert.
	(get_alias_symbol): New functoin.
	(input_node): Rewrite alias handling.
	(input_varpool_node): Likewise.
	* ipa-pure-const.c (propagate_pure_const): Fix formating.
	* ipa.c (process_references): Handle weakrefs correctly.
	(symtab_remove_unreachable_nodes): Likewise.
	* trans-mem.c (get_cg_data): Update.
	(ipa_tm_create_version_alias): Update.
	(ipa_tm_execute): Update.
	* symtab.c (dump_symtab_base): Dump aliases.
	(verify_symtab_base): Verify aliases.
	(symtab_node_availability): New function.
	(symtab_alias_ultimate_target): Simplify.
	(fixup_same_cpp_alias_visibility): Move here from cgraphunit.c;
	handle all the fixup cases.
	(symtab_resolve_alias): New function.
	* passes.c (ipa_write_summaries): Handle weakrefs.
	* varpool.c (varpool_analyze_node): Simplify.
	(assemble_aliases): Update.
	(varpool_create_variable_alias): Simplify.
	(varpool_extra_name_alias): Simplify.
	* lto-streamer.h (lto_symtab_merge_cgraph_nodes): Rename to...
	(lto_symtab_merge_symbols): ... this one.

	* decl2.c (cp_write_global_declarations): Replace same_body_alias
	by symbol.cpp_implicit_alias.

	* lto.c (read_cgraph_and_symbols): Simplify dumping; Replace
	lto_symtab_merge_cgraph_nodes by lto_symtab_merge_symbols.
	(do_whole_program_analysis): Update dumping.

From-SVN: r199577
2013-06-01 13:08:53 +00:00
Jan Hubicka e70670cf4d cgraph.h (symtab_node_base): Add definition, alias and analyzed flags...
* cgraph.h (symtab_node_base): Add definition, alias and analyzed
	flags; reorder rest of fields in more consistent way.
	(varpool_node): Remove analyzed, finalized and alias.
	(cgraph_ndoe): Likewise.
	(symtab_alias_ultimate_target): New function.
	(cgraph_function_node): Move offline.
	(cgraph_reset_node): Declare.
	(cgraph_comdat_can_be_unshared_p): Remove.
	(varpool_remove_initializer): Declare.
	(varpool_first_defined_variable, varpool_next_defined_variable
	cgraph_first_defined_function, cgraph_next_defined_function): Update.
	(cgraph_function_with_gimple_body_p): Update.
	(varpool_all_refs_explicit_p): Update.
	(symtab_alias_target): New function.
	(cgraph_alias_aliased_node, varpool_alias_aliased_node): Rename to ...
	(cgraph_alias_target, varpool_alias_target): .. this one; simplify.
	(cgraph_function_or_thunk_node): Simplify using symtab_alias_ultimate_target.
	(varpool_variable_node): Likewise.
	* cgraph.c (cgraph_create_function_alias): Update.
	(cgraph_add_thunk): Update.
	(cgraph_remove_node): Update.
	(dump_cgraph_node): Do not dump removed flags.
	(cgraph_function_body_availability): Update.
	(cgraph_propagate_frequency): Update.
	(verify_cgraph_node): Check sanity of local flag.
	(cgraph_function_node): Move here from cgraph.h; revamp for
	cgraph_function_or_thunk_node.
	* lto-symtab.c (lto_varpool_replace_node): Update.
	(lto_symtab_resolve_can_prevail_p): Update.
	(lto_symtab_merge_cgraph_nodes): Update.
	* ipa-cp.c (determine_versionability, initialize_node_lattices,
	propagate_constants_accross_call, devirtualization_time_bonus,
	ipcp_propagate_stage): Update.
	* tree-emutls.c (create_emultls_var, ipa_lower_emutls): Update.
	* ipa-inline-transform.c (clone_inlined_nodes, preserve_function_body_p): Update.
	* ipa-reference.c (propagate): Update.
	(write_node_summary_p): Update.
	* toplev.c (wrapup_global_declaration_2): Update.
	* cgraphunit.c (cgraph_analyze_function): Rename to ...
	(analyze_function) ... this one.
	(cgraph_process_new_functions): Update.
	(cgraph_reset_node): Export.
	(cgraph_finalize_function): Update.
	(cgraph_add_new_function): Update.
	(process_function_and_variable_attributes): Update.
	(varpool_finalize_decl): Update.
	(symbol_finalized): Remove.
	(symbol_finalized_and_needed): Rename to ...
	(symbol_defined_and_needed): ... update.
	(cgraph_analyze_functions): Update.
	(handle_alias_pairs): Update.
	(mark_functions_to_output): Update.
	(assemble_thunk): Update.
	(output_in_order): Update.
	(output_weakrefs): Update.
	(finalize_compilation_unit): Update.
	* lto-cgraph.c (reachable_from_other_partition_p, lto_output_node,
	lto_output_varpool_node, compute_ltrans_boundary, input_overwrite_node,
	input_node, input_varpool_node): Update.
	* dbxout.c (dbxout_expand_expr): Update.
	* cgraphclones.c (cgraph_clone_node): Update.
	(cgraph_copy_node_for_versioning): Update.
	(cgraph_materialize_clone): Update.
	(cgraph_materialize_all_clones): Update.
	* ipa-pure-const.c (analyze_function, pure_const_write_summary,
	propagate_pure_const, propagate_nothrow): Update.
	* lto-streamer-out.c (lto_output, write_symbol): Update.
	* ipa-utils.c (ipa_reverse_postorder): Update.
	* ipa-inline.c (can_inline_edge_p): Update.
	(update_caller_keys, ipa_inline): Update.
	* dwarf2out.c (reference_to_unused,
	premark_types_used_by_global_vars_helper): Update.
	* tree-eh.c (tree_could_trap_p): Update.
	* ipa-split.c (consider_split, execute_split_functions): Update.
	* ipa.c (cgraph_non_local_node_p_1, cgraph_local_node_p,
	 has_addr_references_p): Update;
	move ahead in file for better readability.
	(process_references): Simplify.
	(symtab_remove_unreachable_nodes): Update; cleanup way function/var
	bodies are removed.
	(cgraph_comdat_can_be_unshared_p): Make static.
	(cgraph_externally_visible_p): Update.
	(varpool_externally_visible_p): Update.
	(function_and_variable_visibility): Update.
	* trans-mem.c (get_cg_data, ipa_tm_mayenterirr_function,
	ipa_tm_mark_force_output_node): Update.
	* ipa-inline-analysis.c (dump_inline_summary, initialize_inline_failed,
	estimate_edge_devirt_benefit, inline_generate_summary,
	inline_write_summary): Update.
	* gimple-fold.c (can_refer_decl_in_current_unit_p): Update.
	* ipa-prop.c (ipa_compute_jump_functions): Update.
	(ipa_print_node_params, ipa_prop_read_section, ipa_update_after_lto_read,
	read_replacements_section): Update.
	* varasm.c (mark_decl_referenced): Update.
	(assemble_alias, dump_tm_clone_pairs): Update.
	* tree-inline.c (copy_bb): Update.
	(estimate_num_insns, optimize_inline_calls, tree_function_versioning):
	Update.
	* symtab.c (dump_symtab_base): Print new flags.
	(verify_symtab_base): Verify new flags.
	(symtab_alias_ultimate_target): New function.
	* tree-ssa-structalias.c (get_constraint_for_ssa_var,
	create_variable_info_for, associate_varinfo_to_alias, ipa_pta_execute):
	Update.
	* passes.c (ipa_write_summaries, ipa_write_optimization_summaries): Update.
	* i386.c (ix86_get_function_versions_dispatcher,
	ix86_generate_version_dispatcher_body): Update.
	(fold_builtin_cpu): Use varpool_add_new_variable.
	* varpool.c (varpool_remove_initializer): Break out from ...
	(varpool_remove_node): ... this one.
	(dump_varpool_node, varpool_node_for_asm,
	cgraph_variable_initializer_availability, varpool_analyze_node,
	varpool_assemble_decl, varpool_remove_unreferenced_decls,
	varpool_finalize_named_section_flags, varpool_create_variable_alias): Update

	* decl.c (java_mark_decl_local): Update for new symtab flags.

	* tree.c (cp_fix_function_decl_p): Update for new symtab flags.
	* decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.

	* lto.c (has_analyzed_clone_p, lto_materialize_function): Update for new symtab
	flags.
	* lto-partition.c (get_symbol_class, lto_balanced_map): Likewise.

From-SVN: r199422
2013-05-29 20:42:50 +00:00
Jan Hubicka 8ee0505114 lto-partition.c (privatize_symbol_name): Return true when privatizing happened.
* lto-partition.c (privatize_symbol_name): Return true when
	privatizing happened.
	(rename_statics): Do not go into infinite loop when privatizing
	is not needed.

From-SVN: r199040
2013-05-17 22:15:47 +00:00
Jason Merrill 427b248dd0 Makefile.in (LLINKER): New variable.
* Makefile.in (LLINKER): New variable.
	(mostlyclean): Remove link mutex.
	* configure.ac: Handle --enable-link-mutex.
	* lock-and-run.sh: New script.

From-SVN: r198977
2013-05-16 11:09:31 -04:00
Martin Jambor 9de04252a0 ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header...
2013-05-15  Martin Jambor  <mjambor@suse.cz>

	* ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in
	header, print symbol order instead of node uid, print more information
	about indirect edge targets.
	(ipa_make_edge_direct_to_target): Print symbol order instead of node
	uids.
	(ipa_make_edge_direct_to_target): Likewise.
	(remove_described_reference): Likewise.
	(propagate_controlled_uses): Likewise.
	(ipa_print_node_params): Also print symbol order.
	(ipcp_transform_function): Print symbol order instead of node uids.
	* cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Likewise.
	(cgraph_get_create_real_symbol_node): Likewise.
	* ipa-cp.c (print_lattice): Likewise.
	(print_all_lattices): Likewise.
	(determine_versionability): Likewise.
	(initialize_node_lattices): Likewise.
	(estimate_local_effects): Likewise.
	(update_profiling_info): Likewise.
	(create_specialized_node): Likewise.
	(perhaps_add_new_callers): Likewise.
	(decide_about_value): Likewise.
	(decide_whether_version_node): Likewise.
	(identify_dead_nodes): Likewise.
	* ipa-inline-analysis.c (dump_inline_edge_summary): Likewise.
	(dump_inline_summary): Likewise.
	(estimate_node_size_and_time): Likewise.
	(inline_analyze_function): Likewise.
	* ipa-inline.c (report_inline_failed_reason): Likewise.
	(want_early_inline_function_p): Likewise.
	(edge_badness): Likewise.
	(update_edge_key): Likewise.
	(inline_small_functions): Likewise.  Add dumping of order to two other
	dumps.
	* ipa-pure-const.c (pure_const_read_summary): Print symbol order
	instead of node uids.
	(propagate_pure_const): Likewise.
	(propagate_pure_const): Likewise.
	* ipa-utils.c (dump_cgraph_node_set): Likewise.
	* lto-cgraph.c (input_node): Explicitly specify we dump uid.
	* lto-symtab.c (lto_cgraph_replace_node): Print symbol order instead
	of node uids.
	* tree-pretty-print.c (dump_function_header): Likewise.
	* tree-sra.c (convert_callers_for_node): Dump in traditional format.
	Print symbol order instead of node uids.

lto/
	* lto-partition.c (lto_balanced_map): Print symbol order instead
	of node uids.

From-SVN: r198925
2013-05-15 12:35:59 +02:00
Jan Hubicka 2d6e460353 re PR c++/57038 (Latest libreoffice compilation fails with enabled LTO)
PR lto/57038
	PR lto/47375
	* lto-symtab.c (lto_symtab_symbol_p): Add external symbol; weakrefs are
	not external.
	(lto_symtab_merge_decls): Fix thinko when dealing with non-lto_symtab decls.
	(lto_symtab_merge_cgraph_nodes): Use lto_symtab_symbol_p.
	(lto_symtab_prevailing_decl): Get int sync with lto_symtab_symbol_p.
	* varpool.c (dump_varpool_node): Dump more flags.

	* lto-partition.c (get_symbol_class): Fix weakrefs.
	(lto_balanced_map): Fix weakrefs.
	(privatize_symbol_name): Remove unnecesary label.
	(rename_statics): Handle weakrefs as statics.

	* gcc.dg/lto/attr-weakref-1_0.c: New testcase.
	* gcc.dg/lto/attr-weakref-1_1.c: New testcase.
	* gcc.dg/lto/attr-weakref-1_2.c: New testcase.

From-SVN: r198917
2013-05-15 08:09:26 +00:00
Jan Hubicka 64cfa6c0db Jan Hubicka <jh@suse.cz>
Richard Biener  <rguenther@suse.de>

	PR lto/54095
	* symtab.c (symtab_make_decl_local): Do not add private names.

	* lto.c (lto_register_var_decl_in_symtab): Don't do renaming.
	(lto_register_var_decl_in_symtab): Likewise.
	(lto_main): Promote statics.
	* lto-partition.c (privatize_symbol_name): New function.
	(promote_symbol): Use it.
	(may_need_named_section_p): New predicate.
	(rename_statics): New functions.
	(lto_promote_cross_file_statics): Simplify; do renaming.
	(lto_promote_statics_nonwpa): New function.
	* lto-partition.h (lto_promote_statics_nonwpa): New function.

Co-Authored-By: Richard Biener <rguenther@suse.de>

From-SVN: r198741
2013-05-09 15:37:12 +00:00
Richard Biener e45cde9826 re PR middle-end/56231 (warning traces have bogus line information when using LTO)
2013-02-08  Richard Biener  <rguenther@suse.de>

	PR lto/56231
	* lto-streamer.h (struct data_in): Remove current_file, current_line
	and current_col members.
	* lto-streamer-out.c (lto_output_location): Stream changed bits
	en-block for efficiency.
	* lto-streamer-in.c (clear_line_info): Remove.
	(lto_input_location): Cache current file, line and column
	globally via local statics.  Read changed bits en-block.
	(input_function): Do not call clear_line_info.
	(lto_read_body): Likewise.
	(lto_input_toplevel_asms): Likewise.

	lto/
	* lto-lang.c (lto_init): Do not enter a dummy file.

From-SVN: r195884
2013-02-08 12:55:13 +00:00
Uros Bizjak 6edc3e32a4 re PR bootstrap/56227 (Bootstrap failure on MinGW building ggc-page.c)
PR bootstrap/56227
	* ggc-page.c (ggc_print_statistics): Use HOST_LONG_LONG_FORMAT
	instead of "ll".
	* config/i386/i386.c (ix86_print_operand): Ditto.

lto/ChangeLog:

	PR bootstrap/56227
	* lto.c (lto_resolution_ready): Use %wx instead of
	HOST_WIDE_INT_PRINT_HEX_PURE in the argument to internal_error.

From-SVN: r195860
2013-02-07 19:01:40 +01:00
Richard Guenther ed73881ea9 re PR lto/56168 (GCC seems to disregard -fno-builtin when compiling with LTO)
2013-02-04  Richard Guenther  <rguenther@suse.de>

	PR lto/56168
	* lto-symtab.c (lto_symtab_merge_decls_1): Make non-builtin
	node prevail as last resort.
	(lto_symtab_merge_decls): Remove guard on LTRANS here.
	(lto_symtab_prevailing_decl): Builtins are their own prevailing
	decl.

	lto/
	* lto.c (read_cgraph_and_symbols): Do not call lto_symtab_merge_decls
	or lto_fixup_decls at LTRANS time.

	* gcc.dg/lto/pr56168_0.c: New testcase.
	* gcc.dg/lto/pr56168_1.c: Likewise.

From-SVN: r195709
2013-02-04 12:19:25 +00:00
Jan Hubicka a19b143257 re PR lto/45375 ([meta-bug] Issues with building Mozilla (i.e. Firefox) with LTO)
PR lto/45375
	* ipa-inline.c (ipa_inline): Remove extern inlines and virtual functions.
	* cgraphclones.c (cgraph_clone_node): Cpoy also LTO file data.
	* lto.c (do_whole_program_analysis): Remove unreachable nodes after IPA.

From-SVN: r195066
2013-01-09 21:22:26 +00:00
H.J. Lu 49c01f87ba Fix ChangeLog entry for PR lto/55466
From-SVN: r194861
2013-01-03 08:53:54 -08:00
Diego Novillo 6e1aa84836 Introduce vNULL to use as a nil initializer for vec<>.
This patch implements Jakub's idea of adding an empty struct with
a typecast operator that returns nil vectors.  This is useful to
shorten all the initializers when declaring vec instances or passing
nil vectors as function arguments.

2012-11-20  Diego Novillo  <dnovillo@google.com>
	    Jakub Jelinek  <jakub@redhat.com>

ChangeLog
	* vec.h (struct vnull): Declare.
	(vNULL): Declare.
	* vec.c (vNULL): Define.
	* bb-reorder.c: Replace all vec<T, A>() initializers with vNULL.
	* cfgexpand.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cgraph.c: Likewise.
	* config/c6x/c6x.c: Likewise.
	* config/i386/i386.c: Likewise.
	* df-core.c: Likewise.
	* dominance.c: Likewise.
	* dwarf2out.c: Likewise.
	* except.c: Likewise.
	* function.c: Likewise.
	* gcse.c: Likewise.
	* genautomata.c: Likewise.
	* graphds.c: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite.c: Likewise.
	* haifa-sched.c: Likewise.
	* ifcvt.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* ira-build.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-symtab.c: Likewise.
	* opts-global.c: Likewise.
	* passes.c: Likewise.
	* ree.c: Likewise.
	* sched-deps.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched-ir.h: Likewise.
	* sel-sched.c: Likewise.
	* stor-layout.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* value-prof.c: Likewise.
	* varasm.c: Likewise.

ada/ChangeLog
	* gcc-interface/decl.c: Replace all vec<T,A>()
	initializers with vNULL.

cp/ChangeLog
	* name-lookup.c: Replace all vec<T, A>() initializers
	with vNULL.
	* semantics.c: Likewise.

fortran/ChangeLog
	* trans-openmp.c: Replace all vec<T, A>() initializers
	with vNULL.

lto/ChangeLog
	* lto.c: Replace all vec<T, A>() initializers with vNULL.

objc/ChangeLog
	* objc-act.c: Replace all vec<T, A>() initializers with vNULL.

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

From-SVN: r193677
2012-11-20 16:21:30 -05:00
Diego Novillo 9771b26396 This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'.
This patch rewrites the old VEC macro-based interface into a new one
based on the template class 'vec'.  The user-visible changes are
described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec.

I have tested the patch pretty extensively:

- Regular bootstraps on x86_64, ppc, ia64, sparc and hppa.
- Bootstraps with --enable-checking=release
- Bootstraps with --enable-checking=gc,gcac
- Basic builds on all targets (using contrib/config-list.mk).

We no longer access the vectors via VEC_* macros.  The pattern is
"VEC_operation (T, A, V, args)" becomes "V.operation (args)".

The only thing I could not do is create proper ctors and dtors for the
vec class.  Since these vectors are stored in unions, we
have to keep them as PODs (C++03 does not allow non-PODs in unions).

This means that creation and destruction must be explicit.  There is a
new method vec<type, allocation, layout>::create() and another vec<type,
allocation, layout>::destroy() to allocate the internal vector.

For vectors that must be pointers, there is a family of free functions
that implement the operations that need to tolerate NULL vectors.
These functions all start with the prefix 'vec_safe_'.  See the wiki
page for details.

The gengtype change removes the special handling for VEC() that used
to exist in gengtype. Additionally, it allows gengtype to recognize
templates of more than one argument and introduces the concept of an
undefined type (useful for template arguments that may or may not be
types).

When a TYPE_UNDEFINED is reached, gengtype will ignore it if it
happens inside a type marked with GTY((user)).  Otherwise, it will
emit an error.

Finally, gengtype rejects root types marked GTY((user)) that are not
first class pointers.

2012-11-16  Diego Novillo  <dnovillo@google.com>

	VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)

	* vec.c (register_overhead): Convert it into
	member function of vec_prefix.
	(release_overhead): Likewise.
	(calculate_allocation): Likewise.
	(vec_heap_free): Remove.
	(vec_gc_o_reserve_1): Remove.
	(vec_heap_o_reserve_1): Remove.
	(vec_stack_o_reserve_1): Remove.
	(vec_stack_o_reserve_exact): Remove.
	(register_stack_vec): New.
	(stack_vec_register_index): New.
	(unregister_stack_vec): New.
	(vec_assert_fail): Remove.
	* vec.h: Conditionally include ggc.h.  Document conditional
	hackery.
	Update top-level documentation.
	(ALONE_VEC_CHECK_INFO): Remove.
	(VEC_CHECK_INFO): Remove.
	(ALONE_VEC_CHECK_DECL): Remove.
	(VEC_CHECK_DECL): Remove.
	(ALONE_VEC_CHECK_PASS): Remove.
	(VEC_CHECK_PASS): Remove.
	(VEC_ASSERT): Remove.
	(vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and
	va_stack.
	Mark fields alloc_ and num_ as protected.
	(struct vec_t): Remove.  Remove all function members.
	(struct vl_embed): Declare.
	(struct vl_ptr): Declare.
	(free): Remove.
	(reserve_exact): Remove.
	(reserve): Remove.
	(safe_splice): Remove.
	(safe_push): Remove.
	(safe_grow): Remove.
	(safe_grow_cleared): Remove.
	(safe_insert): Remove.
	(DEF_VEC_I): Remove.
	(DEF_VEC_ALLOC_I): Remove.
	(DEF_VEC_P): Remove.
	(DEF_VEC_ALLOC_P): Remove.
	(DEF_VEC_O): Remove.
	(DEF_VEC_ALLOC_O): Remove.
	(DEF_VEC_ALLOC_P_STACK): Remove.
	(DEF_VEC_ALLOC_O_STACK): Remove.
	(DEF_VEC_ALLOC_I_STACK): Remove.
	(DEF_VEC_A): Remove.
	(DEF_VEC_ALLOC_A): Remove.
	(vec_stack_p_reserve_exact_1): Remove.
	(vec_stack_o_reserve): Remove.
	(vec_stack_o_reserve_exact): Remove.
	(VEC_length): Remove.
	(VEC_empty): Remove.
	(VEC_address): Remove.
	(vec_address): Remove.
	(VEC_last): Remove.
	(VEC_index): Remove.
	(VEC_iterate): Remove.
	(VEC_embedded_size): Remove.
	(VEC_embedded_init): Remove.
	(VEC_free): Remove.
	(VEC_copy): Remove.
	(VEC_space): Remove.
	(VEC_reserve): Remove.
	(VEC_reserve_exact): Remove.
	(VEC_splice): Remove.
	(VEC_safe_splice): Remove.
	(VEC_quick_push): Remove.
	(VEC_safe_push): Remove.
	(VEC_pop): Remove.
	(VEC_truncate): Remove.
	(VEC_safe_grow): Remove.
	(VEC_replace): Remove.
	(VEC_quick_insert): Remove.
	(VEC_safe_insert): Remove.
	(VEC_ordered_remove): Remove.
	(VEC_unordered_remove): Remove.
	(VEC_block_remove): Remove.
	(VEC_lower_bound): Remove.
	(VEC_alloc): Remove.
	(VEC_qsort): Remove.

	(va_heap): Declare.
	(va_heap::default_layout): New typedef to vl_ptr.
	(va_heap::reserve): New.
	(va_heap::release): New.
	(va_gc): Declare.
	(va_gc::default_layout): New typedef to vl_embed.
	(va_gc::reserve): New.
	(va_gc::release): New.
	(va_gc_atomic): Declare.  Inherit from va_gc.
	(va_stack): Declare.
	(va_stack::default_layout): New typedef to vl_ptr.
	(va_stack::alloc): New.
	(va_stack::reserve): New.
	(va_stack::release): New.
	(register_stack_vec): Declare.
	(stack_vec_register_index): Declare.
	(unregister_stack_vec): Declare.

	(vec<T, A = va_heap, L = typename A::default_layout>): Declare
	empty vec template.
	(vec<T, A, vl_embed>): Partial specialization for embedded
	layout.
	(vec<T, A, vl_embed>::allocated): New.
	(vec<T, A, vl_embed>::length): New.
	(vec<T, A, vl_embed>::is_empty): New.
	(vec<T, A, vl_embed>::address): New.
	(vec<T, A, vl_embed>::operator[]): New.
	(vec<T, A, vl_embed>::last New.
	(vec<T, A, vl_embed>::space): New.
	(vec<T, A, vl_embed>::iterate): New.
	(vec<T, A, vl_embed>::iterate): New.
	(vec<T, A, vl_embed>::copy): New.
	(vec<T, A, vl_embed>::splice): New.
	(vec<T, A, vl_embed>::quick_push New.
	(vec<T, A, vl_embed>::pop New.
	(vec<T, A, vl_embed>::truncate): New.
	(vec<T, A, vl_embed>::quick_insert): New.
	(vec<T, A, vl_embed>::ordered_remove): New.
	(vec<T, A, vl_embed>::unordered_remove): New.
	(vec<T, A, vl_embed>::block_remove): New.
	(vec<T, A, vl_embed>::qsort): New.
	(vec<T, A, vl_embed>::lower_bound): New.
	(vec<T, A, vl_embed>::embedded_size): New.
	(vec<T, A, vl_embed>::embedded_init): New.
	(vec<T, A, vl_embed>::quick_grow): New.
	(vec<T, A, vl_embed>::quick_grow_cleared): New.
	(vec_safe_space): New.
	(vec_safe_length): New.
	(vec_safe_address): New.
	(vec_safe_is_empty): New.
	(vec_safe_reserve): New.
	(vec_safe_reserve_exact): New.
	(vec_alloc): New.
	(vec_free): New.
	(vec_safe_grow): New.
	(vec_safe_grow_cleared): New.
	(vec_safe_iterate): New.
	(vec_safe_push): New.
	(vec_safe_insert): New.
	(vec_safe_truncate): New.
	(vec_safe_copy): New.
	(vec_safe_splice): New.

	(vec<T, A, vl_ptr>): New partial specialization for the space
	efficient layout.
	(vec<T, A, vl_ptr>::exists): New.
	(vec<T, A, vl_ptr>::is_empty): New.
	(vec<T, A, vl_ptr>::length): New.
	(vec<T, A, vl_ptr>::address): New.
	(vec<T, A, vl_ptr>::operator[]): New.
	(vec<T, A, vl_ptr>::operator!=): New.
	(vec<T, A, vl_ptr>::operator==): New.
	(vec<T, A, vl_ptr>::last): New.
	(vec<T, A, vl_ptr>::space): New.
	(vec<T, A, vl_ptr>::iterate): New.
	(vec<T, A, vl_ptr>::copy): New.
	(vec<T, A, vl_ptr>::reserve): New.
	(vec<T, A, vl_ptr>::reserve_exact): New.
	(vec<T, A, vl_ptr>::splice): New.
	(vec<T, A, vl_ptr>::safe_splice): New.
	(vec<T, A, vl_ptr>::quick_push): New.
	(vec<T, A, vl_ptr>::safe_push): New.
	(vec<T, A, vl_ptr>::pop): New.
	(vec<T, A, vl_ptr>::truncate): New.
	(vec<T, A, vl_ptr>::safe_grow): New.
	(vec<T, A, vl_ptr>::safe_grow_cleared): New.
	(vec<T, A, vl_ptr>::quick_grow): New.
	(vec<T, A, vl_ptr>::quick_grow_cleared): New.
	(vec<T, A, vl_ptr>::quick_insert): New.
	(vec<T, A, vl_ptr>::safe_insert): New.
	(vec<T, A, vl_ptr>::ordered_remove): New.
	(vec<T, A, vl_ptr>::unordered_remove): New.
	(vec<T, A, vl_ptr>::block_remove): New.
	(vec<T, A, vl_ptr>::qsort): New.
	(vec<T, A, vl_ptr>::lower_bound): New.
	(vec_stack_alloc): Define.
	(FOR_EACH_VEC_SAFE_ELT): Define.
	* vecir.h: Remove.  Update all users.
	* vecprim.h: Remove.  Update all users.
	Move uchar to coretypes.h.

	* Makefile.in (VEC_H): Add $(GGC_H).
	Remove vecir.h and vecprim.h dependencies everywhere.

2012-11-16  Diego Novillo  <dnovillo@google.com>

	* gengtype-lex.l (VEC): Remove.
	Add characters in the set [\!\>\.-].
	* gengtype-parse.c (token_names): Remove "VEC".
	(require_template_declaration): Remove handling of VEC_TOKEN.
	(type): Likewise.
	Call create_user_defined_type when parsing GTY((user)).
	* gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED.
	(write_state_undefined_type): New.
	(write_state_type): Call write_state_undefined_type for
	TYPE_UNDEFINED.
	(read_state_type): Call read_state_undefined_type for
	TYPE_UNDEFINED.
	* gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED.
	(create_user_defined_type): Make extern.
	(type_for_name): Factor out of resolve_typedef.
	(create_undefined_type): New
	(resolve_typedef): Call it when we cannot find a previous
	typedef and the type is not a template.
	(find_structure): Accept TYPE_UNDEFINED.
	(set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES,
	default to false.
	Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or
	ALLOWED_UNDEFINED_TYPES is set.
	Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT.
	(filter_type_name): Accept templates with more than one
	argument.
	(output_mangled_typename): Handle TYPE_UNDEFINED
	(walk_type): Likewise.
	(write_types_process_field): Likewise.
	(write_func_for_structure): If CHAIN_NEXT is set, ORIG_S
	should not be a user-defined type.
	(write_types_local_user_process_field): Handle TYPE_ARRAY,
	TYPE_NONE and TYPE_UNDEFINED.
	(write_types_local_process_field): Likewise.
	(contains_scalar_p): Return 0 for TYPE_USER_STRUCT.
	(write_root): Reject user-defined types that are not pointers.
	Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT
	and TYPE_PARAM_STRUCT.
	(output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and
	TYPE_ARRAY.
	(dump_typekind): Handle TYPE_UNDEFINED.
	* gengtype.h (enum typekind): Add TYPE_UNDEFINED.
	(create_user_defined_type): Declare.
	(enum gty_token): Remove VEC_TOKEN.

2012-11-16  Diego Novillo  <dnovillo@google.com>

	Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)

	* coretypes.h (uchar): Define.
	* alias.c: Use new vec API in vec.h.
	* asan.c: Likewise.
	* attribs.c: Likewise.
	* basic-block.h: Likewise.
	* bb-reorder.c: Likewise.
	* builtins.c: Likewise.
	* calls.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfghooks.h: Likewise.
	* cfgloop.c: Likewise.
	* cfgloop.h: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* combine.c: Likewise.
	* compare-elim.c: Likewise.
	* coverage.c: Likewise.
	* cprop.c: Likewise.
	* data-streamer.h: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* dominance.c: Likewise.
	* domwalk.c: Likewise.
	* domwalk.h: Likewise.
	* dse.c: Likewise.
	* dwarf2cfi.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarf2out.h: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* final.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* function.h: Likewise.
	* fwprop.c: Likewise.
	* gcc.c: Likewise.
	* gcse.c: Likewise.
	* genattr.c: Likewise.
	* genattrtab.c: Likewise.
	* genautomata.c: Likewise.
	* genextract.c: Likewise.
	* genopinit.c: Likewise
	* ggc-common.c: Likewise.
	* ggc.h: Likewise.
	* gimple-low.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple.c: Likewise.
	* gimple.h: Likewise.
	* gimplify.c: Likewise.
	* graph.c: Likewise.
	* graphds.c: Likewise.
	* graphds.h: 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-poly.h: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-scop-detection.h: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* godump.c: Likewise.
	* haifa-sched.c: Likewise.
	* hw-doloop.c: Likewise.
	* hw-doloop.h: Likewise.
	* ifcvt.c: Likewise.
	* insn-addr.h: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-inline.h: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-prop.h: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-ref-inline.h: Likewise.
	* ipa-ref.c: Likewise.
	* ipa-ref.h: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-utils.h: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-int.h: Likewise.
	* ira.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-lives.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.h: Likewise.
	* lto-symtab.c: Likewise.
	* mcf.c: Likewise.
	* modulo-sched.c: Likewise.
	* omp-low.c: Likewise.
	* opts-common.c: Likewise.
	* opts-global.c: Likewise.
	* opts.c: Likewise.
	* opts.h: Likewise.
	* passes.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* profile.h: Likewise.
	* read-rtl.c: Likewise.
	* ree.c: Likewise.
	* reg-stack.c: Likewise.
	* regrename.c: Likewise.
	* regrename.h: Likewise.
	* reload.c: Likewise.
	* reload.h: Likewise.
	* reload1.c: Likewise.
	* rtl.h: Likewise.
	* sched-deps.c: Likewise.
	* sched-int.h: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched-ir.h: Likewise.
	* sel-sched.c: Likewise.
	* sese.c: Likewise.
	* sese.h: Likewise.
	* statistics.h: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* tlink.c: Likewise.
	* toplev.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-browser.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-chrec.h: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-data-ref.h: Likewise.
	* tree-dfa.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-flow.h: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-inline.h: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-iterator.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-mudflap.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-live.h: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-sccvn.h: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree-streamer.c: Likewise.
	* tree-streamer.h: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vectorizer.h: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.
	* value-prof.c: Likewise.
	* value-prof.h: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vmsdbgout.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/c6x/c6x.c: Likewise.
	* config/darwin.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/mep/mep.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/pa/pa.c: Likewise.
	* config/rs6000/rs6000-c.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/rx/rx.c: Likewise.
	* config/spu/spu-c.c: Likewise.
	* config/vms/vms.c: Likewise.
	* config/vxworks.c: Likewise.
	* config/epiphany/resolve-sw-modes.c: Likewise.

From-SVN: r193595
2012-11-17 21:54:30 -05:00
Lawrence Crowl 24551b9cec Update ChangeLog files as requested for cgraph change to checked down cast.
Index: gcc/cp/ChangeLog

2012-10-31  Lawrence Crowl  <crowl@google.com>

	* decl2.c (var_finalized_p): Rename varpool_node to
	varpool_node_for_decl.
	(maybe_emit_vtables): Likewise.

Index: gcc/ada/ChangeLog

2012-10-31  Lawrence Crowl  <crowl@google.com>

	* gcc-interface/utils.c (gnat_write_global_declarations):
	Rename varpool_node to varpool_node_for_decl.

Index: gcc/lto/ChangeLog

2012-10-31  Lawrence Crowl  <crowl@google.com>

	* lto.c (lto_wpa_write_files): Change symtab checking to a checked
	down-cast via dyn_cast.
	* lto-partition.c (add_symbol_to_partition_1): Likewise.
	(undo_partition): Likewise.
	(lto_balanced_map): Likewise.
	(get_symbol_class): Likewise and via is_a.
	(lto_balanced_map): Change symtab checking to is_a.

From-SVN: r193106
2012-11-02 20:01:02 +00:00
Richard Biener aec06f6fa8 re PR lto/54898 (ICE in uniquify_nodes, at lto/lto.c:1898)
2012-10-12  Richard Biener  <rguenther@suse.de>

	PR lto/54898
	* lto.c (gimple_types_compatible_p_1): Also compare
	TYPE_MAIN_VARIANT.
	(iterative_hash_gimple_type): Also hash TYPE_MAIN_VARIANT.

From-SVN: r192397
2012-10-12 12:14:03 +00:00
Tobias Burnus 0b8c30f9aa lto-cgraph.c (input_node_opt_summary): Remove unused code.
gcc/
2012-10-08  Tobias Burnus  <burnus@net-b.de>

	* lto-cgraph.c (input_node_opt_summary): Remove unused code.
	* lto-opts.c (append_to_collect_gcc_options): Fix condition.
	* lto-symtab.c (lto_cgraph_replace_node): Don't xstrdup string
	which is passed to fprintf.

gcc/lto/
2012-10-08  Tobias Burnus  <burnus@net-b.de>

	* lto-lang.c (lto_register_builtin_type): Avoid useless
	decl creation.
	* lto-object.c (lto_obj_file_open, lto_obj_file_open): Free memory.

From-SVN: r192250
2012-10-09 13:46:25 +02:00
Tobias Burnus da3202a857 lto.c (lto_wpa_write_files, [...]): Free lto_file struct after closing the file.
2012-10-08  Tobias Burnus  <burnus@net-b.de>

        * lto.c (lto_wpa_write_files, read_cgraph_and_symbols):
        Free lto_file struct after closing the file.

From-SVN: r192216
2012-10-08 18:51:10 +02:00
Jan Hubicka 2512a443d6 lto.c (remember_with_vars): Also fixup INTEGER_CST.
* lto/lto.c (remember_with_vars): Also fixup INTEGER_CST.
	(fixup_integer_cst): New functoin.
	(lto_ft_type): Fixup BASETYPE of methods and offsets.

From-SVN: r192214
2012-10-08 16:04:31 +00:00
Jan Hubicka e75f8f79f0 lto-cgraph.c (lto_symtab_encoder_new): New parameter FOR_INPUT.
* lto-cgraph.c (lto_symtab_encoder_new): New parameter FOR_INPUT.
	(lto_symtab_encoder_delete): Update.
	(lto_symtab_encoder_encode): Update.
	(compute_ltrans_boundary): Update.
	(input_symtab): Update.
 	* lto-streamer.h (lto_symtab_encoder_new): Update.
	
	* lto.c (read_cgraph_and_symbols): Release type merging hash early;
	release input encoders.
	* lto-partition.c (new_partition): Update for new lto_symtab_encoder_new.

From-SVN: r192184
2012-10-07 17:16:02 +00:00
Jan Hubicka 46591697e1 re PR lto/54790 (Missing optimization with LTO)
PR lto/54790 
	* lto.c (resolution_map): New static var.
	(register_resolution): New function.
	(lto_register_var_decl_in_symtab): Use it.
	(read_cgraph_and_symbols): Copy resolutions into the symtab.
	* lto-streamer.h (lto_symtab_register_decl, lto_symtab_get_resolution,
	lto_mark_nothrow_fndecl, lto_fixup_nothrow_decls): Remove.
	* lto-symtab.c (lto_symtab_register_decl): Remove.

From-SVN: r192159
2012-10-06 13:59:55 +00:00
Martin Jambor af16bc762a function.c (push_cfun): Check old current_function_decl matches old cfun...
2012-09-20  Martin Jambor  <mjambor@suse.cz>

	* function.c (push_cfun): Check old current_function_decl matches
	old cfun, set new current_function_decl to the decl of the new
	cfun.
	(push_struct_function): Likewise.
	(pop_cfun): Likewise.
	(allocate_struct_function): Move call to
	invoke_set_current_function_hook to the end of the function.
	* cfgexpand.c (estimated_stack_frame_size): Do not set and restore
	current_function_decl.
	* cgraph.c (cgraph_release_function_body): Likewise.
	* cgraphunit.c (cgraph_process_new_functions): Likewise.
	(cgraph_add_new_function): Likewise.
	(cgraph_analyze_function): Likewise.
	(assemble_thunk): Set cfun to NULL at the end.
	(expand_function): Move call to set_cfun downwards.
	* gimple-low.c (record_vars_into): Only check current_function_decl
	before possibly doing push_cfun.
	* gimplify.c (gimplify_function_tree): Do not set and restore
	current_function_decl.
	* ipa-inline-analysis.c (compute_inline_parameters): Likewise.
	(inline_analyze_function): Likewise.
	* ipa-prop.c (ipa_analyze_node): Likewise.
	* ipa-pure-const.c (analyze_function): Likewise.
	* lto-streamer-in.c (lto_input_function_body): Do not set
	current_function_decl.
	* lto-streamer-out.c (output_function): Do not set and restore
	current_function_decl.
	* omp-low.c (finalize_task_copyfn): Likewise.
	(expand_omp_taskreg): Likewise.
	(create_task_copyfn): Likewise, move push_cfun up quite a bit.
	* passes.c (dump_passes): Do not set and restore current_function_decl.
	(do_per_function): Likewise.
	(do_per_function_toporder): Likewise.
	* trans-mem.c (ipa_tm_scan_irr_function): Likewise.
	(ipa_tm_transform_transaction): Likewise.
	(ipa_tm_transform_clone): Likewise.
	(ipa_tm_execute): Likewise.
	* tree-emutls.c (lower_emutls_function_body): Likewise.
	* tree-inline.c (initialize_cfun): Do not call pop_cfun.
	(tree_function_versioning): Do not call push_cfun, do not set and
	restore current_function_decl.  Remove assert checking consistency of
	cfun and current_function_decl.
	* tree-profile.c (tree_profiling): Do not set and restore
	current_function_decl.
	* tree-sra.c (convert_callers_for_node): Do not set
	current_function_decl.
	(convert_callers): Do not restore current_function_decl.
	(modify_function): Do not set current_function_decl.
	* tree-ssa-structalias.c (ipa_pta_execute): Do not set and restore
	current_function_decl.

fortran/
	* trans-decl.c (gfc_get_extern_function_decl): Push NULL cfun.  Do not
	set and restore current_function_decl.
	(gfc_init_coarray_decl): Do not set and restore current_function_decl.

lto/
	* lto.c (lto_materialize_function): Call push_struct_function and
	pop_cfun.

From-SVN: r191577
2012-09-20 18:35:40 +02:00
Dehao Chen 5368224f42 Integrate lexical block into source_location.
gcc:
	2012-09-19  Dehao Chen  <dehao@google.com>

	* toplev.c (general_init): Init block_locations.
	* tree.c (tree_set_block): New.
	(tree_block): Change to use LOCATION_BLOCK.
	* tree.h (TREE_SET_BLOCK): New.
	* final.c (reemit_insn_block_notes): Change to use LOCATION_BLOCK.
	(final_start_function): Likewise.
	* input.c (expand_location_1): Likewise.
	* input.h (LOCATION_LOCUS): New.
	(LOCATION_BLOCK): New.
	(IS_UNKNOWN_LOCATION): New.
	* fold-const.c (expr_location_or): Change to use new location.
	* reorg.c (emit_delay_sequence): Likewise.
	(try_merge_delay_insns): Likewise.
	* modulo-sched.c (dump_insn_location): Likewise.
	* lto-streamer-out.c (lto_output_location_bitpack): Likewise.
	* lto-cgraph.c (output_node_opt_summary): Likewise.
	* jump.c (rtx_renumbered_equal_p): Likewise.
	* ifcvt.c (noce_try_move): Likewise.
	(noce_try_store_flag): Likewise.
	(noce_try_store_flag_constants): Likewise.
	(noce_try_addcc): Likewise.
	(noce_try_store_flag_mask): Likewise.
	(noce_try_cmove): Likewise.
	(noce_try_cmove_arith): Likewise.
	(noce_try_minmax): Likewise.
	(noce_try_abs): Likewise.
	(noce_try_sign_mask): Likewise.
	(noce_try_bitop): Likewise.
	(noce_process_if_block): Likewise.
	(cond_move_process_if_block): Likewise.
	(find_cond_trap): Likewise.
	* ipa-prop.c (ipa_set_jf_constant): Likewise.
	(ipa_write_jump_function): Likewise.
	* dwarf2out.c (add_src_coords_attributes): Likewise.
	* expr.c (expand_expr_real): Likewise.
	* tree-parloops.c (create_loop_fn): Likewise.
	* recog.c (peep2_attempt): Likewise.
	* function.c (free_after_compilation): Likewise.
	(expand_function_end): Likewise.
	(set_insn_locations): Likewise.
	(thread_prologue_and_epilogue_insns): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* profile.c (branch_prob): Likewise.
	* trans-mem.c (ipa_tm_scan_irr_block): Likewise.
	* gimplify.c (gimplify_call_expr): Likewise.
	* except.c (duplicate_eh_regions_1): Likewise.
	* emit-rtl.c (try_split): Likewise.
	(make_insn_raw): Likewise.
	(make_debug_insn_raw): Likewise.
	(make_jump_insn_raw): Likewise.
	(make_call_insn_raw): Likewise.
	(emit_pattern_after_setloc): Likewise.
	(emit_pattern_after): Likewise.
	(emit_debug_insn_after): Likewise.
	(emit_pattern_before): Likewise.
	(emit_insn_before_setloc): Likewise.
	(emit_jump_insn_before): Likewise.
	(emit_call_insn_before_setloc): Likewise.
	(emit_call_insn_before): Likeise.
	(emit_debug_insn_before_setloc): Likewise.
	(emit_copy_of_insn_after): Likewise.
	(insn_locators_alloc): Remove.
	(insn_locators_finalize): Remove.
	(insn_locators_free): Remove.
	(set_curr_insn_source_location): Remove.
	(get_curr_insn_source_location): Remove.
	(set_curr_insn_block): Remove.
	(get_curr_insn_block): Remove.
	(locator_scope): Remove.
	(insn_scope): Change to use new location.
	(locator_location): Remove.
	(insn_line): Change to use new location.
	(locator_file): Remove.
	(insn_file): Change to use new location.
	(locator_eq): Remove.
	(insn_locations_init): New.
	(insn_locations_finalize): New.
	(set_curr_insn_location): New.
	(curr_insn_location): New.
	* cfgexpand.c (gimple_assign_rhs_to_tree): Change to use new location.
	(expand_gimple_cond): Likewise.
	(expand_call_stmt): Likewise.
	(expand_gimple_stmt_1): Likewise.
	(expand_gimple_basic_block): Likewise.
	(construct_exit_block): Likewise.
	(gimple_expand_cfg): Likewise.
	* cfgcleanup.c (try_forward_edges): Likewise.
	* tree-ssa-live.c (remove_unused_scope_block_p): Likewise.
	(dump_scope_block): Likewise.
	(remove_unused_locals): Likewise.
	* rtl.c (rtx_equal_p_cb): Likewise.
	(rtx_equal_p): Likewise.
	* rtl.h (XUINT): New.
	(INSN_LOCATOR): Remove.
	(CURR_INSN_LOCATION): Remove.
	(INSN_LOCATION): New.
	(INSN_HAS_LOCATION): New.
	* tree-inline.c (remap_gimple_op_r): Change to use new location.
	(copy_tree_body_r): Likewise.
	(copy_phis_for_bb): Likewise.
	(expand_call_inline): Likewise.
	* tree-streamer-in.c (lto_input_ts_exp_tree_pointers): Likewise.
	* tree-streamer-out.c (write_ts_decl_minimal_tree_pointers): Likewise.
	* gimple-streamer-out.c (output_gimple_stmt): Likewise.
	* combine.c (try_combine): Likewise.
	* tree-outof-ssa.c (set_location_for_edge): Likewise.
	(insert_partition_copy_on_edge): Likewise.
	(insert_value_copy_on_edge): Likewise.
	(insert_rtx_to_part_on_edge): Likewise.
	(insert_part_to_rtx_on_edge): Likewise.
	* basic-block.h (edge_def): Remove field.
	* gimple.h (gimple_statement_base): Remove field.
	(gimple_bb): Change to use new location.
	(gimple_set_block): Likewise.
	(gimple_has_location): Likewise.
	* tree-cfg.c (make_cond_expr_edges): Likewise.
	(make_goto_expr_edges): Likewise.
	(gimple_can_merge_blocks_p): Likewise.
	(move_stmt_op): Likewise.
	(move_block_to_fn): Likewise.
	* config/alpha/alpha.c (alpha_output_mi_thunk_osf): Likewise.
	* config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
	* config/i386/i386.c (x86_output_mi_thunk): Likewise.
	* config/tilegx/tilegx.c (tilegx_output_mi_thunk): Likewise.
	* config/sh/sh.c (sh_output_mi_thunk): Likewise.
	* config/ia64/ia64.c (ia64_output_mi_thunk): Likewise.
	* config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
	* config/score/score.c (score_output_mi_thunk): Likewise.
	* config/tilepro/tilepro.c (tilepro_asm_output_mi_thunk): Likewise.
	* config/mips/mips.c (mips_output_mi_thunk): Likewise.
	* cfgrtl.c (unique_locus_on_edge_between_p): Likewise.
	(unique_locus_on_edge_between_p): Likewise.
	(emit_nop_for_unique_locus_between): Likewise.
	(force_nonfallthru_and_redirect): Likewise.
	(fixup_reorder_chain): Likewise.
	(cfg_layout_merge_blocks): Likewise.
	* stmt.c (emit_case_nodes): Likewise.

gcc/lto:
	2012-09-19  Dehao Chen  <dehao@google.com>

	* lto/lto.c (lto_fixup_prevailing_decls): Remove tree.exp.block field.

libcpp:
	2012-09-19  Dehao Chen  <dehao@google.com>

	* include/line-map.h (MAX_SOURCE_LOCATION): New value.
	(location_adhoc_data_fini): New.
	(get_combined_adhoc_loc): New.
	(get_data_from_adhoc_loc): New.
	(get_location_from_adhoc_loc): New.
	(location_adhoc_data_map): New.
	(COMBINE_LOCATION_DATA): New.
	(IS_ADHOC_LOC): New.
	(expanded_location): New field.
	(line_maps): New field.
	* line-map.c (location_adhoc_data): New.
	(location_adhoc_data_hash): New.
	(location_adhoc_data_eq): New.
	(location_adhoc_data_update): New.
	(get_combined_adhoc_loc): New.
	(get_data_from_adhoc_loc): New.
	(get_location_from_adhoc_loc): New.
	(location_adhoc_data_init): New.
	(location_adhoc_data_fini): New.
	(linemap_init): Initialize location_adhoc_data.
	(linemap_lookup): Change to use new location.
	(linemap_ordinary_map_lookup): Likewise.
	(linemap_macro_map_lookup): Likewise.
	(linemap_macro_map_loc_to_def_point): Likewise.
	(linemap_macro_map_loc_unwind_toward_spel): Likewise.
	(linemap_get_expansion_line): Likewise.
	(linemap_get_expansion_filename): Likewise.
	(linemap_location_in_system_header_p): Likewise.
	(linemap_location_from_macro_expansion_p): Likewise.
	(linemap_macro_loc_to_spelling_point): Likewise.
	(linemap_macro_loc_to_def_point): Likewise.
	(linemap_macro_loc_to_exp_point): Likewise.
	(linemap_resolve_location): Likewise.
	(linemap_unwind_toward_expansion): Likewise.
	(linemap_unwind_to_first_non_reserved_loc): Likewise.
	(linemap_expand_location): Likewise.
	(linemap_dump_location): Likewise.
	(linemap_line_start): Likewise.

From-SVN: r191494
2012-09-19 19:56:42 +00:00
Jan Hubicka b5493fb2fa symtab.c (insert_to_assembler_name_hash): Do not insert register vars.
* symtab.c (insert_to_assembler_name_hash): Do not insert
	register vars.
	(unlink_from_assembler_name_hash): NULL out pointers of unlinked
	var.
	(symtab_prevail_in_asm_name_hash): New.
	(symtab_initialize_asm_name_hash): Break out from ...
	(symtab_node_for_asm): ... here.
	(dump_symtab_base): Dump LTO file data.
	(verify_symtab_base): Register vars are not in symtab.
	* cgraph.h (symtab_initialize_asm_name_hash,
	symtab_prevail_in_asm_name_hash): New functions.
	(symtab_real_symbol_p): New inline.
	* lto-symtab.c: Do not include gt-lto-symtab.h.
	(lto_symtab_entry_def): Remove.
	(lto_symtab_entry_t): Remove.
	(lto_symtab_identifiers): Remove.
	(lto_symtab_free): Remove.
	(lto_symtab_entry_hash): Remove.
	(lto_symtab_entry_eq): Remove.
	(lto_symtab_entry_marked_p): Remove.
	(lto_symtab_maybe_init_hash_table): Remove.
	(resolution_guessed_p, set_resolution_guessed): New functions.
	(lto_symtab_register_decl): Only set resolution info.
	(lto_symtab_get, lto_symtab_get_resolution): Remove.
	(lto_symtab_merge): Reorg to work across symtab; do nothing if decls
	are same.
	(lto_symtab_resolve_replaceable_p): Reorg to work on symtab.
	(lto_symtab_resolve_can_prevail_p): Likewise; only real symbols can
	prevail.
	(lto_symtab_resolve_symbols): Reorg to work on symtab.
	(lto_symtab_merge_decls_2): Likewise.
	(lto_symtab_merge_decls_1): Likewise; add debug dumps.
	(lto_symtab_merge_decls): Likewise; do not merge at ltrans stage.
	(lto_symtab_merge_cgraph_nodes_1): Reorg to work on symtab.
	(lto_symtab_merge_cgraph_nodes): Likewise; do not merge at ltrans stage.
	(lto_symtab_prevailing_decl): Rewrite to lookup into symtab.
	* lto-streaer.h (lto_symtab_free): Remove.
	* lto-cgraph.c (add_references): Cleanup.
	* varpool.c (varpool_assemble_decl): Skip hard regs.

	* lto.c (lto_materialize_function): Update confused comment.
	(read_cgraph_and_symbols): Do not free symtab.

From-SVN: r191466
2012-09-19 10:01:56 +00:00
Jan Hubicka c3c445e1cf common.opt (flto-partition): Add "max".
* common.opt (flto-partition): Add "max".
	* invoke.texi (flto-partition): Document "max"

	* lto.c (do_whole_program_analysis): Care timevars, statistics and
	AUX pointer cleaning. Add max partitioning.
	* lto-partition.c (enum symbol_class): New.
	(get_symbol_class): New function.
	(symbol_partitioned_p): New function.
	(add_references_to_partition): Remove.
	(add_aliases_to_partition): Remove.
	(add_cgraph_node_to_partition_1): Remove.
	(add_cgraph_node_to_partition): Remove.
	(add_symbol_to_partition): New function.
	(add_symbol_to_partition_1): New function.
	(contained_in_symbol): New function.
	(partition_cgraph_node_p): Remove.
	(partition_varpool_node_p): Remove.
	(partition_symbol_p): Remove.
	(lto_1_to_1_map): Cleanup.
	(lto_max_map): New.
	(lto_balanced_map): Update.
	(lto_promote_cross_file_statics): Update.
	* lto-partition.h (lto_max_map): Declare.
	* timevar.def (TV_WHOPR_PARTITIONING): New timevar.

From-SVN: r191229
2012-09-12 17:55:13 +00:00
Jan Hubicka b5c7cdfb0a re PR lto/54312 (uniquify_nodes takes 12% of Mozilla LTO build)
PR lto/54312
	* lto.c (uniquify_nodes): Remove quadratic loop checking if the
	type is variant leader.

From-SVN: r191228
2012-09-12 16:26:19 +00:00
Richard Guenther b29402f047 lto.c (enum gtc_mode): Remove.
2012-09-11  Richard Guenther  <rguenther@suse.de>

	* lto.c (enum gtc_mode): Remove.
	(struct type_pair_d): Adjust.
	(lookup_type_pair): Likewise.
	(gimple_type_leader): Do not mark as deletable.
	(gimple_lookup_type_leader): Adjust.
	(gtc_visit): Likewise.
	(gimple_types_compatible_p_1): Likewise.
	(gimple_types_compatible_p): Likewise.
	(gimple_type_hash): Likewise.
	(gimple_register_type): Likewise.
	(read_cgraph_and_symbols): Manage lifetime of tables
	here.

From-SVN: r191184
2012-09-11 13:39:11 +00:00
Richard Guenther b8f4e58fbc gimple.h (gimple_register_type): Remove.
2012-09-11  Richard Guenther  <rguenther@suse.de>

	* gimple.h (gimple_register_type): Remove.
	(print_gimple_types_stats): Adjust prototype.
	* lto-streamer.h (print_lto_report): Likewise.
	* lto-streamer.c (print_lto_report): Adjust.
	* gimple.c (gimple_types, type_hash_cache, enum gtc_mode,
	struct type_pair_d, lookup_type_pair, struct sccs,
	next_dfs_num, gtc_next_dfs_num, struct gimple_type_leader_entry_s,
	gimple_type_leader, gimple_lookup_type_leader, compare_type_names_p,
	gtc_visit, gimple_types_compatible_p_1, gimple_types_compatible_p,
	visit, iterative_hash_name, struct type_hash_pair,
	type_hash_pair_compare, iterative_hash_gimple_type, gimple_type_hash,
	gimple_type_eq, gimple_register_type_1, gimple_register_type):
	Move to lto/lto.c.
	(print_gimple_types_stats): Adjust.
	(free_gimple_type_tables): Likewise.

	lto/
	* lto.c (gimple_types, type_hash_cache, enum gtc_mode,
	struct type_pair_d, lookup_type_pair, struct sccs,
	next_dfs_num, gtc_next_dfs_num, struct gimple_type_leader_entry_s,
	gimple_type_leader, gimple_lookup_type_leader, compare_type_names_p,
	gtc_visit, gimple_types_compatible_p_1, gimple_types_compatible_p,
	visit, iterative_hash_name, struct type_hash_pair,
	type_hash_pair_compare, iterative_hash_gimple_type, gimple_type_hash,
	gimple_type_eq, gimple_register_type_1, gimple_register_type):
	Move here from gimple.c
	(read_cgraph_and_symbols): Free hash tables here.
	(print_lto_report_1): New function wrapping print_lto_report.
	(do_whole_program_analysis): Call it.
	(lto_main): Likewise.

From-SVN: r191177
2012-09-11 11:39:27 +00:00
Jan Hubicka 1cdbb3f92e lto-cgraph.c (compute_ltrans_boundary): Do not care about aliases.
* lto-cgraph.c (compute_ltrans_boundary): Do not care about aliases.
	* lto-partition.c (partition_symbol_p): Forward declare.
	(add_references_to_partition): Reimplement using partition_symbol_p.
	(add_aliases_to_partition): Break out from add_references_to_partition;
	reimplement using partition_symbol_p.
	(add_cgraph_node_to_partition_1): Handle callees using partition_symbol_p;
	add sanity checks.
	(add_varpool_node_to_partition): Use add_aliases_to_partition.
	(partition_varpool_node_p): Do not special case aliases.

From-SVN: r191129
2012-09-10 08:32:36 +00:00
Jan Hubicka b4661bfe21 passes.c (ipa_write_summaries_1): Set state; do not call compute_ltrans_boundary.
* passes.c (ipa_write_summaries_1): Set state;
	do not call compute_ltrans_boundary.
	(ipa_write_optimization_summaries): Likewise.
	(ipa_write_summaries): compute_ltrans_boundary here.
	* lto-streamer.h (lto_symtab_encoder_d): NODES are allocated in heap.
	(compute_ltrans_boundary): Update prototype.

	* lto.c (lto_wpa_write_files): Do not delete partition encoder;
	it is deleted after streaming.
	* lto-partition.c (partition_symbol_p): New function.
	(promote_var, promote_fn): Remove.
	(promote_symbol): New function.
	(lto_promote_cross_file_statics): First compute boundaries; rewrite
	to lookup the actual boundaries instead of computing them ad-hoc.

From-SVN: r191113
2012-09-09 17:29:21 +00:00