* cgraphbuild.c (cgraph_rebuild_references): Rebuild only non-speculative
	refs.
	* cgraph.c (cgraph_update_edge_in_call_site_hash): New function.
	(cgraph_add_edge_to_call_site_hash): Deal with speculative calls.
	(cgraph_set_call_stmt): Likewise.
	(cgraph_create_edge_1): Fix release checking compilatoin;
	clear lto_stmt_uid.
	(cgraph_free_edge): Free indirect info.
	(cgraph_turn_edge_to_speculative): New function.
	(cgraph_speculative_call_info): New function.
	(cgraph_make_edge_direct): Return direct edge; handle speculation.
	(cgraph_redirect_edge_call_stmt_to_callee): Expand speculative
	edges.
	(dump_cgraph_node): Dump speculation.
	(verify_edge_count_and_frequency): Accept speculative edges.
	(verify_edge_corresponds_to_fndecl): Handle partitioned cgraph.
	(verify_cgraph_node): Handle speculation.
	* cgraph.h (cgraph_edge): Add SPECULATIVE flag.
	(cgraph_set_call_stmt): Update prototype.
	(cgraph_make_edge_direct): Update prototype.
	(cgraph_speculative_call_info): Declare.
	* ipa-cp.c (ipcp_discover_new_direct_edges): Be ready for edge
	to change; update call of ipa_find_references.
	* ipa-ref.c (ipa_record_reference): Fix return value; clear
	lto_stmt_uid and speculative flags.
	(ipa_dump_references): Dump speculation.
	(ipa_clone_references): Clone speculative flag.
	(ipa_clone_referring): Likewise.
	(ipa_clone_ref): New function.
	(ipa_find_reference): Look into lto_stmt_uids
	(ipa_clear_stmts_in_references): Do not clear speculative calls.
	* ipa-ref.h (ipa_ref): Add lto_stmt_uid and speculative flags.
	(ipa_find_reference): Update declaration.
	(ipa_clone_ref): Declare.
	* lto-cgraph.c (lto_output_edge): Make lto_stmt_uids start from 0;
	stream speculative flag.
	(lto_output_ref): Stream statements uids and speculation.
	(input_ref): Likewise.
	(input_edge): Stream speuclation.
	* cgraphclones.c (cgraph_clone_edge): Clone speculation.
	(cgraph_set_call_stmt_including_clones): Handle speculation.
	* ipa-inline.c (heap_edge_removal_hook): New function.
	(inline_small_functions): Register it.
	* lto-streamer-in.c (fixup_call_stmt_edges_1): Bounds checking;
	also initialize refs.
	* ipa-prop.c (ipa_make_edge_direct_to_target): Be ready for
	edge to change.
	(try_make_edge_direct_simple_call): Likewise.
	(try_make_edge_direct_simple_call): Likewise.
	(update_indirect_edges_after_inlining): Likewise.
	(remove_described_reference): Look proper lto_stmt_uid.
	(propagate_controlled_uses): Likewise.
	(propagate_controlled_uses): Liekwise.
	* tree-inline.c (copy_bb): Copy speculative edges.
	(redirect_all_calls): New function.
	(copy_cfg_body): Do redirection after loop info
	is updated.
	(delete_unreachable_blocks_update_callgraph): Updadte
	speculation.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201632 138bc75d-0d04-0410-961f-82ee72b054a4
2013-08-09  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/58058
	* trans-intrinsic.c (gfc_conv_intrinsic_transfer): Free the temporary
	string, if necessary.

2013-08-09  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/58058
	* gfortran.dg/transfer_intrinsic_6.f90: New.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201633 138bc75d-0d04-0410-961f-82ee72b054a4
	* cgraph.h (cgraph_node): Add profile_id.
	* value-prof.c (cgraph_node_map): Turn into pointer_map.
	(init_node_map): Rewrite to handle hashes increas of incremental
	IDs.
	(del_node_map): Update.
	(find_func_by_funcdef_no): Replace by ...
	(find_func_by_profile_id): ... this one.
	(gimple_ic_transform): Do not remove useful histograms when
	speculation is not done; dump info when indirect call removal
	can happen at LTO.
	* value-prof.h (find_func_by_profile_id, gimple_ic): Declare.
	* gcov-io.h (__gcov_indirect_call_profiler): Replace by ...
	(__gcov_indirect_call_profiler_v2): .. this one.
	* profile.h (init_node_map): Update.
	* coverage.c (coverage_compute_profile_id): New function.
	* coverage.h (coverage_compute_profile_id): Declare.
	* tree-profile.c (init_ic_make_global_vars): Make
	__gcov_indirect_call_callee and  __gcov_indirect_call_counters global.
	(gimple_init_edge_profiler): Update prototype of
	__gcov_indirect_call_profiler.
	(gimple_gen_ic_func_profiler): Simplify.
	(tree_profiling): Use init_node_map


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201634 138bc75d-0d04-0410-961f-82ee72b054a4
2013-08-09  Janus Weil  <janus@gcc.gnu.org>

	* gfortran.h (gfc_get_code): Modified prototype.
	* class.c (finalize_component, finalization_scalarizer,
	finalization_get_offset, finalizer_insert_packed_call,
	generate_finalization_wrapper, gfc_find_derived_vtab,
	gfc_find_intrinsic_vtab): Use 'gfc_get_code'.
	* io.c (match_io_iterator, match_io_element, terminate_io, get_io_list,
	gfc_match_inquire): Call 'gfc_get_code' with argument.
	* match.c (match_simple_forall, gfc_match_forall, gfc_match_goto,
	gfc_match_nullify, gfc_match_call, match_simple_where, gfc_match_where):
	Ditto.
	* parse.c (new_level): Ditto.
	(add_statement): Use XCNEW.
	* resolve.c (resolve_entries, resolve_allocate_expr,
	resolve_select_type, build_assignment, build_init_assign): Call
	'gfc_get_code' with argument.
	* st.c (gfc_get_code): Add argument 'op'.
	* trans-expr.c (gfc_trans_class_array_init_assign): Call 'gfc_get_code'
	with argument.
	* trans-stmt.c (gfc_trans_allocate): Ditto.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201635 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/testsuite/

	* gcc.dg/lower-subreg-1.c: Skip aarch64*-*-*.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201636 138bc75d-0d04-0410-961f-82ee72b054a4
net: give C.getaddrinfo a hint that we only want SOCK_STREAM answers

This should be more efficient everywhere, and appears to be
required on Solaris.

Copied from master repository.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201637 138bc75d-0d04-0410-961f-82ee72b054a4
	* cgraph.c (cgraph_resolve_speculation): Cut frequency to
	CGRAPH_FREQ_MAX.
	(dump_cgraph_node): Dump profile-id.
	* cgraph.h (cgraph_indirect_call_info): Add common_target_id
	and common_target_probability.
	* lto-cgraph.c (lto_output_edge): Stream common targets.
	(lto_output_node): Stream profile ids.
	(input_node): Stream profile ids.
	(input_edge): Stream common targets.
	* lto-streamer-in.c (fixup_call_stmt_edges_1): Fix formatting.
	* ipa.c: Include value-prof.h
	(ipa_profile_generate_summary): Turn indirect call statement histograms
	into common targets.
	(ipa_profile): Turn common targets into speculative edges.

	* gcc.dg/tree-prof/crossmodule-indircall-1.c: New testcase.
	* gcc.dg/tree-prof/crossmodule-indircall-1a.c: New testcase.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201639 138bc75d-0d04-0410-961f-82ee72b054a4
	 * ipa-ref.c (ipa_clear_stmts_in_references): Clear lto_stmt_uid, too.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201640 138bc75d-0d04-0410-961f-82ee72b054a4