Commit Graph

110 Commits

Author SHA1 Message Date
Steven Bosscher 7ee2468b92 system.h (dump_file): Do not define.
gcc/
	* system.h (dump_file): Do not define.
	* tree-pass.h: Include dumpfile.h, which is a new file containing...
	(enum tree_dump_index, TDF_*, get_dump_file_name, dump_enabled_p,
	dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p,
	dump_flag_name, dump_file, dump_flags, dump_file_name,
	get_dump_file_info, struct dump_file_info): all of this, moved to...
	* dumpfile.h: Here, new file.
	* tree-dump.h: Include dumpfile.h, but not tree-pass.h.
	(dump_stmt): Remove prototype for C++ specific function.
	(dump_enumerated_decls): Move prototype from here...
	* tree-flow.h (dump_enumerated_decls): ... to here.
	(get_ref_base_and_extent) Move prototype from here ...
	* tree.h (get_ref_base_and_extent) ... to here.
	* tree-ssa-live.c: Do not inclde tree-pretty-print.h, because
	gimple-pretty-print.h is enough.  Do not include tree-dump.h,
	include timevar.h and dumpfile.h instead.
	(struct numbered_tree_d, compare_decls_by_uid,
	dump_enumerated_decls_push, dump_enumerated_decls): Move from here ...
	* tree-dfa.c:(struct numbered_tree_d, compare_decls_by_uid,
	dump_enumerated_decls_push, dump_enumerated_decls):... to here.
	Do not include timevar.h.
	* tree.c: Do not include timevar.h.
	* tree-cfg.c: Do not include langhooks.h, tree-pretty-print.h, and
	timevar.h.
	(dump_cfg_stats): Use current_function_name.
	(gimple_cfg2vcg): Likewise.
	(dump_function_to_file): Likewise.
	* df-scan.c: Do not include tree-pass.h and timevar.h.
	Include dumpfile.h.
	(df_entry_block_bitmap_verify, df_exit_block_bitmap_verify): Do not
	use print_current_pass.
	* df-problems.c: Include dumpfile.h.
	Always define REG_DEAD_DEBUGGING, avoid #ifdef code, because it
	leads to errors in the code not selected.
	(df_note_compute): Do not print_rtl_with_bb here.  Fix compilation
	bug if REG_DEAD_DEBUGGING is not 0, get_insns is not available here.
	* lcm.c: Include dumpfile.h.
	Remove obsolete include of insn-attr.h.
	* dojump.c (do_compare_rtx_and_jump): Remove failure printing for
	missing probability notes.
	* stmt.c: Include dumpfile.h.
	(emit_case_decision_tree): Re-enable printing expand details only
	if TDF_DETAILS.
	* alias.c, auto-inc-dec.c, bb-reorder.c, caller-save.c, cfg.c, 
	cfgcleanup.c, cfgexpand.c, cfgloop.c, cfgloopmanip.c, cgraph.c, 
	cgraphclones.c, cgraphunit.c, combine.c, combine-stack-adj.c, 
	coverage.c, cprop.c, cse.c, cselib.c, dbgcnt.c, dce.c, df-core.c, 
	dse.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, final.c, 
	function.c, fwprop.c, gcse.c, gimple-fold.c, 
	gimple-pretty-print.c, gimple-ssa-strength-reduction.c, 
	gimplify.c, graphite-blocking.c, graphite-clast-to-gimple.c, 
	graphite-dependences.c, graphite-interchange.c, 
	graphite-optimize-isl.c, graphite-poly.c, 
	graphite-sese-to-poly.c, haifa-sched.c, hw-doloop.c, ifcvt.c, 
	ipa.c, ipa-cp.c, ipa-inline-analysis.c, ipa-inline.c, 
	ipa-inline-transform.c, ipa-prop.c, ipa-pure-const.c, 
	ipa-reference.c, ipa-split.c, ipa-utils.c, ira.c, ira-emit.c, 
	jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, 
	loop-unroll.c, loop-unswitch.c, lower-subreg.c, 
	lto-section-out.c, lto-streamer-in.c, matrix-reorg.c, mcf.c, 
	mode-switching.c, modulo-sched.c, omega.c, omp-low.c, passes.c, 
	plugin.c, postreload.c, postreload-gcse.c, predict.c, print-rtl.c, 
	print-tree.c, profile.c, recog.c, ree.c, regcprop.c, reginfo.c, 
	regmove.c, regrename.c, reg-stack.c, reload1.c, reorg.c, 
	sched-rgn.c, sched-vis.c, sel-sched.c, sel-sched-ir.c, 
	store-motion.c, tracer.c, trans-mem.c, tree-affine.c, 
	tree-call-cdce.c, tree-cfgcleanup.c, tree-chrec.c, 
	tree-data-ref.c, tree-diagnostic.c, tree-dump.c,
	tree-eh.c, tree-flow-inline.h, tree-if-conv.c, tree-into-ssa.c, 
	tree-mudflap.c, tree-nrv.c, tree-object-size.c, 
	tree-optimize.c, tree-outof-ssa.c, tree-predcom.c, 
	tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, 
	tree-sra.c, tree-ssa-address.c, tree-ssa-alias.c, tree-ssa.c, 
	tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, 
	tree-ssa-copyrename.c,, tree-ssa-dce.c, tree-ssa-dom.c, 
	tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, 
	tree-ssa-loop.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, 
	tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, 
	tree-ssa-loop-manip.c, tree-ssa-loop-niter.c, 
	tree-ssa-loop-prefetch.c, tree-ssa-loop-unswitch.c, 
	tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, 
	tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-propagate.c, 
	tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-sink.c, 
	tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-ter.c, 
	tree-ssa-threadedge.c, tree-ssa-threadupdate.c, 
	tree-ssa-uncprop.c, tree-ssa-uninit.c, 
	tree-switch-conversion.c, tree-tailcall.c, 
	tree-vect-data-refs.c, tree-vect-loop.c, 
	tree-vect-loop-manip.c, tree-vectorizer.c, 
	tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, 
	tree-vrp.c, value-prof.c, var-tracking.c, web.c: Include tree-pass.h
	only if needed.  If tree-pass.h is included, do not include timevar.h
	and dumpfile.h.  If tree-pass.h is not included but dump_file, or
	dump_flags, or the TDF_* flags are used, include dumpfile.h.
	If gimple-pretty-print.h is included, don't include tree-pretty-print.h.
	Remove assorted unnecessary includes.

	* config/mn10300/mn10300.c, config/c6x/c6x.c, config/ia64/ia64.c,
	config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c,
	config/spu/spu.c, config/mep/mep.c, config/i386/i386.c:
	Include dumpfile.h.
	* config/rl78/rl78.c: Include dumpfile.h instead of tree-pass.h.
	* arm/t-arm, avr/t-avr, i386/t-i386, ia64/t-ia64, mep/t-mep,
	spu/t-spu-elf: Fix dependencies.

c-family/
	* c-gimplify.c: Include dumpfile.h instead of tree-dump.h.
	* c-ada-spec.c: Likewise.
	* c-dump.c (dump_stmt): Move to cp/dump.c, the only user.

c/
	* c-decl.c: Include dumpfile.h instead of tree-dump.h.
	* Make-lang.in: Fix dependencies.

cp/
	* dump.c (dump_stmt): Moved here from c-dump.c.
	* optimize.c: Include dumpfile.h instead of tree-dump.h.
	* class.c: Likewise.
	* decl2.c: Likewise.
	* Make-lang.in: Fix dependencies.

fortran/
	* f95-lang.c: Include dumpfile.h instead of tree-dump.h.
	* Make-lang.in: Fix dependencies.

java/
	* java-gimplify.c Include dumpfile.h instead of tree-dump.h
	* Make-lang.in: Fix dependencies.

lto/
	* lto.c: Do not include timevar.h.
	* Make-lang.in: Fix dependencies.

ada/
	* gcc-interface/utils.c: Include timevar.h.
	* Make-lang.in: Fix dependencies.

From-SVN: r189519
2012-07-16 11:32:42 +00:00
Eric Botcazou 2da02156af re PR middle-end/53590 (compiler fails to generate SIMD instruction for FP division)
PR middle-end/53590
	* common.opt (-fdelete-dead-exceptions): New switch.
	* doc/invoke.texi (Code Gen Options): Document it.
	* cse.c (count_reg_usage) <CALL_INSN>: Use !insn_nothrow_p in lieu of
	insn_could_throw_p predicate.  Do not skip an insn that could throw
	if dead exceptions can be deleted.
	(insn_live_p): Likewise, do not return true in that case.
	* dce.c (can_alter_cfg): New flag.
	(deletable_insn_p): Do not return false for an insn that can throw if
	the CFG can be altered and dead exceptions can be deleted.
	(init_dce): Set can_alter_cfg to false for fast DCE, true otherwise.
	* dse.c (scan_insn): Use !insn_nothrow_p in lieu of insn_could_throw_
	predicate. Do not preserve an insn that could throw if dead exceptions
	can be deleted.
	* function.h (struct function): Add can_delete_dead_exceptions flag.
	* function.c (allocate_struct_function): Set it.
	* lto-streamer-in.c (input_struct_function_base): Stream it.
	* lto-streamer-out.c (input_struct_function_base): Likewise.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Do not mark a
	statement that could throw as necessary if dead exceptions can be
	deleted.
ada/
	* gcc-interface/misc.c (gnat_init_options_struct): Set
	opts->x_flag_delete_dead_exceptions to 1.

From-SVN: r188651
2012-06-15 09:22:00 +00:00
Steven Bosscher be7a421eef output.h (__gcc_host_wide_int__): Move to hwint.h.
* output.h (__gcc_host_wide_int__): Move to hwint.h.
	(decl_default_tls_model): Move to tree.h
	(dump_file): Move to system.h.
	(default_stabs_asm_out_destructor, default_stabs_asm_out_constructor,
	dbxout_int, dbxout_stabd, dbxout_begin_stabn, dbxout_begin_stabn_sline,
	dbxout_begin_empty_stabs, dbxout_begin_simple_stabs,
	dbxout_begin_simple_stabs_desc, dbxout_stab_value_zero,
	dbxout_stab_value_zero, dbxout_stab_value_label_diff,
	dbxout_stab_value_internal_label,
	dbxout_stab_value_internal_label_diff): Move from here ...
	* dbxout.h: ... to here.
	* system.h (dump_file): Moved here from output.h.
	* hwint.h (__gcc_host_wide_int__): Moved here from output.h.
	* tree.h (decl_default_tls_model): Moved here from output.h.
	* varasm.c (default_stabs_asm_out_destructor,
	default_stabs_asm_out_constructor): Move from here ...
	* dbxout.c: ... to here.

	* gcov-dump.c (dump_file): Rename to dump_gcov_file.  Update callers.

	* collect2.h (dump_file): Rename to dump_ld_file.
	* collect2.c: Likewise.
	* tlink.c: Likewise.

	* alias.c: Do not include output.h.
	* auto-inc-dec.c: Likewise.
	* bt-load.c: Likewise.
	* caller-save.c: Likewise.
	* cfg.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfglayout.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphclones.c: Likewise.
	* combine-stack-adj.c: Likewise.
	* combine.c: Likewise.
	* cprop.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* dbgcnt.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* dojump.c: Likewise.
	* fwprop.c: Likewise.
	* gcse.c: Likewise.
	* graph.c: Likewise.
	* haifa-sched.c: Likewise.
	* hw-doloop.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-utils.c: Likewise.
	* ira-build.c: Likewise.
	* ira-emit.c: Likewise.
	* lcm.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-iv.c: Likewise.
	* loop-unroll.c: Likewise.
	* loop-unswitch.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* mcf.c: Likewise.
	* mode-switching.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* profile.c: Likewise.
	* ree.c: Likewise.
	* reg-stack.c: Likewise.
	* regcprop.c: Likewise.
	* regmove.c: Likewise.
	* regstat.c: Likewise.
	* reload1.c: Likewise.
	* sched-ebb.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* simplify-rtx.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* tracer.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-nomudflap.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-loop-ch.c: Likewise.
	* tree-ssa-loop-im.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-loop.c: Likewise.
	* tree-ssa-propagate.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.
	* value-prof.c: Likewise.
	* var-tracking.c: Likewise.
	* web.c: Likewise.

	* config/m32r/m32r.c: Include dbxout.h.
	* config/pa/pa.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.

	* Makefile.in: Fix dependencies.
	* config/rs6000/t-rs5000: Likewise.

c-family/
	* c-ada-spec.c: Do not include output.h.
	* c-semantics.c: Likewise.

cp/
	* call.c: Do not include output.h.
	* class.c: Likewise.
	* except.c: Likewise.
	* friend.c: Likewise.
	* init.c: Likewise.
	* lex.c: Likewise.
	* method.c: Likewise.
	* parser.c: Likewise.
	* pt.c: Likewise.
	* rtti.c: Likewise.
	* search.c: Likewise.

objc/
	* objc-act.c: Do not include output.h.

fortran/
	* trans-common.c: Do not include output.h.
	* trans-decl.c: Likewise.

java/
	* resource.c: Do not include output.h.

From-SVN: r188082
2012-05-31 20:19:00 +00:00
Richard Guenther 3828719aa9 tree.h (VAR_DECL_IS_VIRTUAL_OPERAND): New.
2012-05-22  Richard Guenther  <rguenther@suse.de>

	* tree.h (VAR_DECL_IS_VIRTUAL_OPERAND): New.
	(init_function_for_compilation): Remove.
	* tree-dfa.c (find_vars_r): Take struct function argument.
	(find_referenced_vars_in): Adjust.
	* tree-ssa-operands.c (clobber_stats): Remove.
	(create_vop_var): Take struct function argument.  Mark
	virtual operand with VAR_DECL_IS_VIRTUAL_OPERAND.
	(init_ssa_operands): Take struct function argument.
	(fini_ssa_operands): Do not dump dead stats.
	* tree-ssa-operands.h (init_ssa_operands): Take struct function
	argument.
	* cgraphunit.c (init_lowered_empty_function): Adjust.
	* lto-streamer-in.c (input_cfg): Likewise.
	* tree-inline.c (initialize_cfun): Likewise.
	* tree-into-ssa.c (rewrite_into_ssa): Likewise.
	* omp-low.c (expand_omp_taskreg): Likewise.  Avoid switching
	cfun.
	* gimple.c (is_gimple_reg): Optimize the SSA_NAME case,
	virtual operands are not registers.

From-SVN: r187772
2012-05-22 11:59:41 +00:00
Jan Hubicka 877ab5e91e cgraphunit.c (handle_alias_pairs): Declare; free alias_pairs
* cgraphunit.c (handle_alias_pairs): Declare; free alias_pairs
	(cgraph_process_new_functions): Process also aliases.
	* lto-streamer-out.c (struct sets): Remove.
	(trivally_defined_alias): Remove.
	(output_alias_pair_p): Remove.
	(output_unreferenced_globals): Remove.
	(produce_symtab); Do not handle alias pairs.
	(produce_asm_for_decls): Likewise.
	* lto-streamer-in.c (input_alias_pairs): Remove.
	(lto_read_body): Do not input alias pairs.
	(lto_input_constructors_and_inits): Remove.

From-SVN: r187681
2012-05-19 20:36:48 +00:00
Michael Matz 3e8b732e26 basic-block.h (struct rtl_bb_info, [...]): Move in front of basic_block_def.
* basic-block.h (struct rtl_bb_info, struct gimple_bb_info): Move
	in front of basic_block_def.
	(struct basic_block_def): Make il.gimple the full struct, not a
	pointer.
	(__assert_gimple_bb_smaller_rtl_bb): Asserting typedef.

	* cfgexpand.c (expand_gimple_basic_block): Clear all il.gimple
	members.
	* gimple-iterator.c (gimple_stmt_iterator): Don't special case
	NULL il.gimple, which can't happen anymore.
	* gimple.h (bb_seq): il.gimple can't be NULL.
	(bb_seq_add): Ditto.
	(set_bb_seq): Adjust.
	(gsi_start_bb, gsi_last_bb): Tidy.
	* lto-streamer-in.c (make_new_block): Don't zero members that
	are zeroed already, don't allocate a gimple_bb_info.
	* tree-cfg.c (create_bb): Don't allocate a gimple_bb_info.
	(remove_bb): Clear all il.gimple members.
	(gimple_verify_flow_info): Adjust for flat il.gimple.
	* tree-flow-inline.h (phi_nodes, phi_nodes_ptr, set_phi_nodes): Adjust.

	* coretypes.h (const_gimple_seq): Remove typedef.
	* gimple.h (gimple_seq_first): Take gimple_seq.
	(gimple_seq_first_stmt): Ditto.
	(gimple_seq_last): Ditto.
	(gimple_seq_last_stmt): Ditto.
	(gimple_seq_empty_p): Ditto.

From-SVN: r187099
2012-05-03 14:34:07 +00:00
Michael Matz 355a767352 coretypes.h (gimple_seq, [...]): Typedef as gimple.
* coretypes.h (gimple_seq, const_gimple_seq): Typedef as gimple.
	* gimple.h (struct gimple_seq_node_d, struct gimple_seq_d): Remove.
	(const_gimple_seq_node): Remove.
	(gimple_seq_node): Typedef as gimple.
	(struct gimple_statement_base): Add next and prev members,
	adjust all WORD markers in using structs.
	(union gimple_statement_d): Link via gsbase.next field for GC and PCH.
	(gimple_seq_first, gimple_seq_first_stmt, gimple_seq_last,
	gimple_seq_last_stmt): Adjust as gimple_seq, gimple_seq_node and
	gimple are the same.
	(gimple_seq_set_last, gimple_seq_set_first): Don't allocate
	gimple_seq, adjust.
	(gimple_init_singleton): New function.
	(gsi_start_1, gsi_last_1, gsi_end_p, gsi_one_before_end_p): Adjust.
	(gsi_next, gsi_prev): Adjust, handle prev cyclic list correctly.
	(gsi_stmt): Adjust.
	(gsi_stmt_ptr): Remove.
	(enum gimple_alloc_kind): Remove gimple_alloc_kind_seq member.

	* gimple-iterator.c (update_bb_for_stmts): Take last parameter
	again, adjust for above changes.
	(update_call_edge_frequencies): Adjust for above changes.
	(gsi_insert_seq_nodes_before): Rewrite for new data structure.
	(gsi_insert_seq_nodes_after): Ditto.
	(gsi_split_seq_after): Ditto.
	(gsi_set_stmt): Ditto.
	(gsi_split_seq_before): Ditto.
	(gsi_remove): Ditto.
	(gsi_insert_seq_before_without_update): Don't free sequence.
	(gsi_insert_seq_after_without_update): Ditto.
	(gsi_replace): Assert some more invariants.
	(gsi_insert_before_without_update, gsi_insert_after_without_update):
	Tidy.
	(gsi_for_stmt): Don't search for stmt.
	(gsi_insert_on_edge_immediate): Tidy.

	* gimple.c (gimple_alloc_k): Remove "sequences".
	(gimple_seq_cache): Remove.
	(gimple_alloc_stat): Make stmt a singleton sequence.
	(gimple_seq_alloc, gimple_seq_free): Remove.
	(gimple_assign_set_rhs_with_ops_1): Ensure new stmt is a singleton.
	(gimple_copy): Ditto.
	* gimplify.c (gimplify_cleanup_point_expr): Use gsi_set_stmt,
	create iterator from correct sequence.
	* tree-phinodes.c (make_phi_node): Make stmt a singleton.


	* gimple.h (gimple_stmt_iterator <seq>): Make it be pointer to
	gimple_seq.
	(gimple_seq_set_last, gimple_seq_set_first): Take pointer to
	sequence, lazily allocate it.
	(bb_seq_addr): New function.
	(gsi_start_1): Rename from gsi_start, but take pointer to sequence.
	(gsi_start): Macro to wrap gsi_start_1 taking pointer of argument.
	(gsi_none): New function.
	(gsi_start_bb): Adjust.
	(gsi_last_1): Rename from gsi_last, but take pointer to sequence.
	(gsi_last): Macro to wrap gsi_last_1 taking pointer of argument.
	(gsi_last_bb): Adjust.
	(gsi_seq): Adjust.
	* tree-flow-inline.h (phi_nodes_ptr): New function.

	* gimple-iterator.c (gsi_insert_seq_nodes_before): Adjust to 
	datastructure and interface change.
	(gsi_insert_seq_before_without_update): Ditto.
	(gsi_insert_seq_nodes_after): Ditto.
	(gsi_insert_seq_after_without_update): Ditto.
	(gsi_split_seq_after): Ditto, don't use gimple_seq_alloc.
	(gsi_split_seq_before): Ditto.
	(gsi_start_phis): Adjust.
	* tree-vect-loop.c (vect_determine_vectorization_factor): Use
	gsi_none.
	(vect_transform_loop): Ditto.
	* gimple.c (gimple_seq_add_stmt, gimple_seq_add_seq,
	gimple_seq_copy): Don't use gimple_seq_alloc.
	* gimplify.c (gimple_seq_add_stmt_without_update): Ditto.
	(gimplify_seq_add_seq): Ditto.
	* lto-streamer-in.c (make_new_block): Ditto.
	* tree-cfg.c (create_bb): Ditto.
	* tree-sra.c (initialize_parameter_reductions): Ditto.


	* gimple.h (gimple_seq_first, gimple_seq_first_stmt, gimple_seq_last,
	gimple_seq_last_stmt, gimple_seq_set_last, gimple_seq_set_first,
	gimple_seq_empty_p, gimple_seq_alloc_with_stmt, bb_seq,
	set_bb_seq): Move down to after gimple_statement_d definition.


	* gimple-fold.c (gimplify_and_update_call_from_tree): Use
	gsi_replace_with_seq, instead of inserting itself.
	* gimple-iterator.c (gsi_replace_with_seq): New function.
	* tree-ssa-forwprop.c (forward_propagate_comparison): Take
	iterator instead of statement, advance it.
	(ssa_forward_propagate_and_combine): Adjust call to above.


	* tree-phinodes.c (add_phi_node_to_bb): Tidy, don't use
	gimple_seq_alloc.
	* omp-low.c (finalize_task_copyfn): Don't use gimple_seq_alloc.
	* tree-nested.c (walk_gimple_omp_for): Ditto.
	* trans-mem.c (lower_transaction): Ditto.
	* tree-eh.c (do_return_redirection): Ditto.
	(do_goto_redirection): Ditto.
	(lower_try_finally_switch): Ditto.
	* gimplify.c (gimplify_stmt): Ditto.
	(gimplify_scan_omp_clauses): Ditto.
	(gimplify_omp_for): Ditto.
	(gimplify_function_tree): Ditto.
	* gimple-fold.c (gimplify_and_update_call_from_tree): Ditto.
	* tree-mudflap.c (mf_decl_cache_locals): Ditto.
	(mf_build_check_statement_for): Ditto.
	(mx_register_decls): Ditto.
	* graphite-sese-to-poly.c (remove_invariant_phi): Ditto,
	and don't use itertors to append.
	(insert_stmts): Ditto.
	(insert_out_of_ssa_copy): Ditto.
	(insert_out_of_ssa_copy_on_edge): Ditto.


	* gimple.h (gimple_bind_body_ptr): New function.
	(gimple_bind_body): Use it.
	(gimple_catch_handler): Use gimple_catch_handler_ptr.
	(gimple_eh_filter_failure_ptr): New function.
	(gimple_eh_filter_failure): Use it.
	(gimple_eh_else_n_body_ptr): New function.
	(gimple_eh_else_n_body): Use it.
	(gimple_eh_else_e_body_ptr): New function.
	(gimple_eh_else_e_body): Use it.
	(gimple_try_eval_ptr): New function.
	(gimple_try_eval): Use it.
	(gimple_try_cleanup_ptr): New function.
	(gimple_try_cleanup): Use it.
	(gimple_wce_cleanup_ptr): New function.
	(gimple_wce_cleanup): Use it.
	(gimple_omp_body_ptr): New function.
	(gimple_omp_body): Use it.
	(gimple_omp_for_pre_body_ptr): New function.
	(gimple_omp_for_pre_body): Use it.
	(gimple_transaction_body_ptr): New function.
	(gimple_transaction_body): Use it.
	(gsi_split_seq_before): Adjust to return nothing and take pointer
	to sequence.
	(gsi_set_stmt): Declare.
	(gsi_replace_with_seq): Declare.
	(walk_gimple_seq_mod): Declare.
	* function.h (struct function <gimple_body>): Use typedef gimple_seq.

	* gimple-iterator.c (gsi_set_stmt): New function.
	(gsi_split_seq_before): Return new sequence via pointer argument.
	(gsi_replace): Use gsi_set_stmt.

	* tree-ssa-loop-im.c (move_computations_stmt): First remove
	then insert stmt.
	* tree-complex.c (update_complex_components_on_edge): Don't
	copy gsi.
	* tree-phinodes.c (resize_phi_node): Don't resize stmt in-place,
	return new stmt.
	(reserve_phi_args_for_new_edge): Change call to above,
	use gsi_set_stmt.

	* omp-low.c (lower_omp): Change prototype to take pointer to
	sequence.
	(lower_rec_input_clauses): Use gimple_seq_add_seq instead of
	iterators.  Adjust call to lower_omp.
	(lower_lastprivate_clauses): Adjust call to lower_omp.
	(lower_reduction_clauses): Ditto.
	(expand_omp_taskreg): Nullify non-cfg body of child_fn.
	(lower_omp_sections): Don't explicitely count sequence length,
	nullify lowered bodies earlier, ensure stmts are part of only
	one sequence, adjust call to lower_omp.
	(lower_omp_single): Ensure stmts are part of only one sequence,
	adjust call to lower_omp.
	(lower_omp_master): Ditto.
	(lower_omp_ordered): Ditto.
	(lower_omp_critical): Ditto.
	(lower_omp_for): Ditto.
	(lower_omp_taskreg): Ditto, tidy.
	(lower_omp_1): Adjust calls to lower_omp.
	(execute_lower_omp): Ditto.
	(lower_omp): Adjust to take pointer to sequence.
	(diagnose_sb_2): Use walk_gimple_seq_mod.
	(diagnose_omp_structured_block_errors): Ditto and set possibly
	changed function body.
	* gimple-low.c (lower_function_body): Set function body after
	it stabilizes.
	(lower_sequence): Adjust to take pointer to sequence.
	(lower_omp_directive): Ensure stmt isn't put twice into the
	sequence, adjust call to lower_sequence.
	(lower_stmt): Adjust calls to lower_sequence.
	(lower_gimple_bind): Ditto.
	(gimple_try_catch_may_fallthru): Call gsi_start with lvalue.
	* tree-nested.c (walk_body): Take pointer to sequence, use
	walk_gimple_seq_mod.
	(walk_function): Adjust call to walk_body, set possibly changed
	body.
	(walk_gimple_omp_for): Adjust calls to walk_body.
	(convert_nonlocal_omp_clauses): Ditto.
	(convert_nonlocal_reference_stmt): Ditto.
	(convert_local_omp_clauses): Ditto.
	(convert_local_reference_stmt): Ditto.
	(convert_tramp_reference_stmt): Ditto.
	(convert_gimple_call): Ditto.
	(convert_nl_goto_reference): Use local iterator copy.
	* gimple.c (walk_gimple_seq_mod): Renamed from walk_gimple_seq,
	but taking pointer to sequence, ensure gsi_start is called with
	callers lvalue.
	(walk_gimple_seq): New wrapper around walk_gimple_seq_mod,
	asserting that the sequence head didn't change.
	(walk_gimple_stmt): Replace all calls to walk_gimple_seq with
	walk_gimple_seq_mod.
	* trans-mem.c (lower_transaction): Use walk_gimple_seq_mod.
	(execute_lower_tm): Ditto, and set possibly changed body.
	* tree-eh.c (lower_eh_constructs_1): Take pointer to sequence,
	call gsi_start with that lvalue.
	(replace_goto_queue_stmt_list): Ditto.
	(replace_goto_queue_1): Adjust calls to replace_goto_queue_stmt_list.
	(replace_goto_queue): Ditto.
	(lower_try_finally_nofallthru): Adjust calls to lower_eh_constructs_1.
	(lower_try_finally_onedest): Ditto.
	(lower_try_finally_copy): Ditto.
	(lower_try_finally_switch): Ditto.
	(lower_try_finally): Ditto.
	(lower_eh_filter): Ditto.
	(lower_eh_must_not_throw): Ditto.
	(lower_cleanup): Ditto.
	(lower_eh_constructs_2): Ditto.
	(lower_catch): Ditto, and ensure gsi_start is called with lvalue.
	(lower_eh_constructs): Adjust calls to lower_eh_constructs_1, and
	set possibly changed body.
	(optimize_double_finally): Call gsi_start with lvalue.

	* tree-cfg.c (make_blocks): Adjust call to gsi_split_seq_before.
	(gimple_split_block): Ditto.
	(gimple_merge_blocks): Use gsi_start_phis.
	(move_stmt_r): Use walk_gimple_seq_mod.
	* tree-ssa-dse.c (dse_enter_block): Use gsi_last_bb.
	* cgraphbuild.c (build_cgraph_edges): Use gsi_start_phis.
	(rebuild_cgraph_edges): Ditto.
	(cgraph_rebuild_references): Ditto.
	* ipa-prop.c (ipa_analyze_params_uses): Ditto.
	* tree-inline.c (copy_phis_for_bb): Ditto.
	* tree-ssa-dce.c: Ditto.

	* cgraphunit.c (cgraph_analyze_function): Use gimple_has_body_p.

From-SVN: r187053
2012-05-02 16:41:48 +00:00
Jan Hubicka 65d630d474 cgraph.c (ld_plugin_symbol_resolution_names): Move to symtab.c
* cgraph.c (ld_plugin_symbol_resolution_names): Move to symtab.c
	(cgraph_asm_nodes, cgraph_asm_last_node): Move to cgraphunit.c
	(cgraph_add_to_same_comdat_group): Remove.
	(cgraph_add_asm_node): Move to cgraphunit.c.
	(cgraph_make_decl_local): Move to symtab.c
	(cgraph_make_node_local_1): Update.
	(cgraph_can_remove_if_no_direct_calls_and): Update.
	(used_from_object_file_p): Update.
	(resolution_used_from_other_file_p): Move to symtab.c
	(cgraph_used_from_object_file_p): move to symtab.c
	(verify_cgraph_node): Verify same comdat groups.
	* cgraph.h (cgraph_asm_node): Rename to ...
	(asm_node): ... this one.
	(cgraph_asm_nodes): Rename to ...
	(asm_nodes): ... this one.
	(symtab_add_to_same_comdat_group): New function.
	(symtab_dissolve_same_comdat_group_list): New function.
	(symtab_used_from_object_file_p): Declare.
	(symtab_make_decl_local): Declare.
	(cgraph_add_to_same_comdat_group): Remove.
	(cgraph_add_asm_node): Remove.
	(cgraph_used_from_object_file_p, varpool_used_from_object_file_p):
	Remove.
	(cgraph_finalize_compilation_unit): Rename to ...
	(finalize_compilation_unit): ... this one.
	(cgraph_optimize): Rename to ....
	(compile): ... this one.
	(add_asm_node): Declare.
	(fixup_same_cpp_alias_visibility): Declare.
	(cgraph_make_decl_local): Remove.
	(varpool_assemble_pending_decls): Rename to ...
	(varpool_output_variables): ... this one.
	(varpool_remove_unreferenced_decls): Remove.
	* ipa-inline-transform.c (clone_inlined_nodes): Dissolve comdat groups.
	(preserve_function_body_p): Make static.
	* toplev.c (compile_file): Update comments;
	update.
	* cgraphunit.c: Update comments.
	(cgraph_expand_all_functions): Rename to ...
	(expand_all_functions): ... this one; update.
	(cgraph_mark_functions_to_output): Rename to ...
	(mark_functions_to_output): ... this one; cleanup.
	(cgraph_output_pending_asms): Remove prototype.
	(asm_nodes, asm_last_node): New static vars.
	(cgraph_process_new_functions): Update.
	(cgraph_reset_node): Cleanup; add comment.
	(cgraph_add_new_function): Update.
	(cgraph_output_pending_asms): Rename to ...
	(output_asm_statements): ... this one.
	(add_asm_node): New function.
	(fixup_same_cpp_alias_visibility): New function based on code
	in cgraph_analyze_function.
	(cgraph_analyze_function): Use it.
	(cgraph_order_sort): Update.
	(cgraph_output_in_order): Update.
	(cgraph_function_versioning): Update.
	(cgraph_optimize): Rename to ...
	(compile): ... this one; initialize streamer hooks here.
	(cgraph_finalize_compilation_unit): Rename to ...
	(finalize_compilation_unit): ... this one; do not initialize streamer
	hook here.
	* lto-streamer-out.c (lto_output_toplevel_asms): Update.
	* dwarf2out.c: Update ocmment.
	* optimize.c (maybe_clone_body): Use symtab_add_to_same_comdat_group.
	* method.c (use_thunk): Likewise.
	* semantics.c (maybe_add_lambda_conv_op): Likewise.
	* decl2.c (maybe_emit_vtables): Likewise.	
	(cp_write_global_declarations): Use finalize_compilation_unit.
	* parser.c (cp_parser_asm_definition): Use add_asm_node.
	* lto-streamer-in.c (lto_input_toplevel_asms): Use add_asm_node
	* c-decl.c (c_write_global_declarations): Use finalize_compilation_unit.
	* langhooks.c (write_global_declarations): Update.
	* ipa.c (cgraph_externally_visible_p): Update.
	(dissolve_same_comdat_group_list): Remove.
	(function_and_variable_visibility): Update.
	* symtab.c: Inlcude lto-streamer.h and rtl.h
	(ld_plugin_symbol_resolution_names): New.
	(symtab_add_to_same_comdat_group): New.
	(symtab_dissolve_same_comdat_group_list): New.
	(resolution_used_from_other_file_p): Move here from cgraph.c
	(symtab_used_from_object_file_p): New.
	(symtab_make_decl_local): New.
	* passes.c (register_pass): Update comments.
	* c-parser.c (c_parser_asm_definition): Update.
	* varpool.c (varpool_analyze_node): Use fixup_same_cpp_alias_visibility.
	(varpool_remove_unreferenced_decls): Make static.
	(varpool_assemble_pending_decls): Rename to ...
	(varpool_output_variables): ... this one; call
	varpool_remove_unreferenced_decls.
	(varpool_used_from_object_file_p): Remove.

	* gogo-tree.cc (Gogo::write_globals): Use finalize_compilation_unit.

	* gcc-interface/utils.c (rest_of_subprog_body_compilation): Update
	comment.
	(gnat_write_global_declarations): Use finalize_compilation_unit.

	* f95-lang.c (gfc_finish): Update comments.

	* lto.c (lto_main): Use compile ().
	* lto-partition.c (partition_cgraph_node_p): Use symtab_used_from_object_file_p.
	(partition_varpool_node_p): Likewise.

From-SVN: r186998
2012-04-30 17:55:29 +00:00
Jan Hubicka 2aae768068 cgraph.h (symtab_node_base): Add next and previous pointers.
* cgraph.h (symtab_node_base): Add next and previous pointers.
	(cgraph_node): Remove next and preivous pointers.
	(varpool_node): Likewise; remove next/previous GTY marker;
	it is not type safe.
	(symtab_node_def): Update GTY marker
	(x_cgraph_nodes, cgraph_nodes): Remove.
	(symtab_nodes): New function.
	(cgraph_order): Rename to ...
	(symtab_order): ... this one.
	(symtab_register_node, symtab_unregister_node, symtab_remove_node):
	Declare.
	(x_varpool_nodes, varpool_nodes): Remove.
	(FOR_EACH_STATIC_VARIABLE): Update.
	(symtab_function_p, symtab_variable_p): New function.
	(FOR_EACH_VARIABLE): Update.
	(varpool_first_variable, varpool_next_variable): New functions.
	(FOR_EACH_VARIABLE): Update.
	(cgraph_first_defined_function): Update.
	(cgraph_next_defined_function, cgraph_next_defined_function): Update.
	(FOR_EACH_DEFINED_FUNCTION, FOR_EACH_FUNCTION): Update.
	(cgraph_first_function, cgraph_next_function): New.
	(FOR_EACH_FUNCTION): Update.
	(cgraph_first_function_with_gimple_body,
	cgraph_next_function_with_gimple_body): Update.
	* symtab.c: New file.
	* cgraph.c: Update copyright dates.
	(x_cgraph_nodes, cgraph_order): Remove.
	(NEXT_FREE_NODE): Update.
	(SET_NEXT_FREE_NODE): New.
	(cgraph_create_node_1): Remove common code.
	(cgraph_create_node); Remove common code; call symtab_register_node.
	(cgraph_remove_node): Remove common code; call symtab_unregister-node.
	(cgraph_add_asm_node); update.
	(cgraph_clone_node): Register new node.
	* cgraphunit.c (process_function_and_variable_attributes): Update.
	(cgraph_analyze_functions): Update.
	(cgraph_analyze_functions): Update.
	(cgraph_output_in_order): Update.
	* lto-cgraph.c (input_node, input_varpool_node, input_cgraph_1): Update.
	* ipa-inline.c (recursive_inlining); update.
	* lto-streamer-in.c (lto_input_toplevel_asms); Update.
	* ipa.c (cgraph_remove_unreachable_nodes): Update.
	* Makefile.in: Add symtab.o
	* varpool.c (x_varpool_nodes): Remove
	(varpool_node): Remove common code; call symtab_register_node.
	(varpool_remove_node); Remove common code; call symtab_unregister_node.

From-SVN: r186496
2012-04-16 14:34:22 +00:00
Richard Guenther 23ee14a5e6 re PR lto/51497 (The run time for the polyhedron test nf.f90 is ~10% slower with -flto after revision 182107)
2011-12-14  Richard Guenther  <rguenther@suse.de>

	PR lto/51497
	* lto-streamer-in.c (lto_read_body): Fixup local types
	TYPE_CANONICAL and variant chain.

From-SVN: r182336
2011-12-14 15:31:24 +00:00
Eric Botcazou 4ad9a9de2d lto-streamer-out.c (write_symbol): Use proper 64-bit host type.
* lto-streamer-out.c (write_symbol): Use proper 64-bit host type.
	* lto-cgraph.c (input_cgraph_opt_section): Use 'int' for offsets.
	* lto-streamer-in.c (lto_read_body): Likewise.
	(lto_input_toplevel_asms): Likewise.
	* lto-section-in.c (lto_create_simple_input_block): Likewise.
	* ipa-inline-analysis.c (inline_read_section): Likewise.
	* ipa-prop.c (ipa_prop_read_section): Likewise.

	* df.h (DF_NOTE): Fix typo in comment.
lto/
	* lto.h (lto_parse_hex): Delete.
	* lto.c (lto_read_decls): Use 'int' for offsets.
	(lto_parse_hex): Make static and return proper 64-bit host type.
	(lto_resolution_read): Use proper 64-bit host type.

From-SVN: r182310
2011-12-13 21:59:39 +00:00
Lawrence Crowl 35f5b1c1b9 lto-streamer-in.c (input_struct_function_base): Factor out of ...
2011-10-12   Lawrence Crowl  <crowl@google.com>
	     Diego Novillo  <dnovillo@google.com>

	* lto-streamer-in.c (input_struct_function_base): Factor out of ...
	(input_function): ... here.
	* lto-streamer-out.c (output_struct_function_base): Factor out of ...
	(output_function): ... here.

Co-Authored-By: Diego Novillo <dnovillo@google.com>

From-SVN: r179928
2011-10-13 11:41:52 -04:00
Gabriel Charette a22286c349 streamer-hooks.h (struct streamer_hooks): Add hooks input_location and output_location.
2011-10-12  Gabriel Charette  <gchare@google.com>
	    Diego Novillo  <dnovillo@google.com>

	* streamer-hooks.h (struct streamer_hooks): Add hooks
	input_location and output_location.
	* lto-streamer-in.c (lto_input_location): Use
	streamer_hooks.input_location, if set.
	* lto-streamer-out.c (lto_output_location): Use
	streamer_hooks.output_location, if set.

Co-Authored-By: Diego Novillo <dnovillo@google.com>

From-SVN: r179927
2011-10-13 11:40:29 -04:00
Jan Hubicka 398f05daa1 lto-streamer.h (lto_input_toplevel_asms): Add order_base parameter.
* lto-streamer.h (lto_input_toplevel_asms): Add order_base parameter.
	* lto-streamer-in.c (lto_input_toplevel_asms): Stream in order.
	* lto-streamer-out.c (lto_output_toplevel_asms): Stream out order.
	* lto-cgraph.c (order_base): New static var.
	(lto_output_node): Stream in order.
	(lto_output_varpool_node): Stream out order.
	(input_node): Stream in order.
	(input_varpool_node): Stream out order.
	(input_cgraph_1): Initialize order base; update call of
	lto_input_toplevel_asms.

From-SVN: r179496
2011-10-04 09:46:56 +00:00
Jan Beulich 49f836ba6f Split out LTO's writing of top level asm nodes in preparation of extending what...
Split out LTO's writing of top level asm nodes in preparation of extending
what needs to be written out when top level asm-s get enhanced to accept a
limited set of input operands.

gcc/
2011-09-30  Jan Beulich  <jbeulich@suse.com>

	* lto-cgraph.c (output_cgraph): Remove processing of
	'cgraph_asm_nodes', call lto_output_toplevel_asms() instead.
	(input_cgraph_1): Remove loop calling cgraph_add_asm_node(), call
	lto_input_toplevel_asms() instead.
	* lto-section-in.c (lto_section_name): Add "asm" entry.
	* lto-streamer-in.c (lto_input_toplevel_asms): New.
	* lto-streamer-out.c (lto_output_toplevel_asms): New.
	* lto-streamer.h (LTO_minor_version): Bump.
	(enum lto_section_type): Add LTO_section_asm.
	(struct lto_asm_header): New.
	(lto_input_toplevel_asms, lto_output_toplevel_asms): Declare.
	* tree-streamer.h (streamer_write_string_cst): Declare.
	* tree-streamer-out.c (write_string_cst): Rename to
	streamer_write_string_cst and make global. Handle incoming string
	being NULL.
	(streamer_write_tree_header): Adjust call to renamed function.

From-SVN: r179386
2011-09-30 14:56:01 +00:00
Michael Matz 0b11d702db re PR lto/50165 (Huge build time regression (Firefox lto build))
PR lto/50165
	* lto-streamer-in.c (canon_file_name): Initialize new_slot->len;
	don't call strlen twice, use memcpy.

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

From-SVN: r178118
2011-08-26 16:02:17 +00:00
Diego Novillo 412288f1c0 data-streamer.h (streamer_write_zero): Rename from output_zero.
* data-streamer.h (streamer_write_zero): Rename from output_zero.
 	(streamer_write_uhwi): Rename from lto_output_uleb128.
 	(streamer_write_hwi): Rename from output_sleb128.
 	(streamer_write_string): Rename from lto_output_string.
 	(streamer_string_index): Rename from lto_string_index.
 	(streamer_write_string_with_length): Rename from
 	lto_output_string_with_length.
 	(streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream.
 	(streamer_write_hwi_stream): Rename from lto_output_sleb128_stream.
 	(streamer_read_string): Rename from lto_input_string.
 	(streamer_read_indexed_string): Rename from input_string_internal.
 	(streamer_read_uhwi): Rename from lto_input_uleb128.
 	(streamer_read_hwi): Rename from lto_input_sleb128.
 	(streamer_write_hwi_in_range): Rename from lto_output_int_in_range.
 	(streamer_read_hwi_in_range): Rename from lto_input_int_in_range.
 	(streamer_write_enum): Rename from lto_output_enum.
 	(streamer_read_enum): Rename from lto_input_enum.
 	(streamer_write_record_start): Rename from output_record_start.
 	(streamer_read_record_start): Rename from input_record_start.
 	(streamer_write_bitpack): Rename from lto_output_bitpack.
 	(streamer_read_bitpack): Rename from lto_input_bitpack.
 	(streamer_write_char_stream): Rename from lto_output_1_stream.
 	(streamer_read_uchar): Rename from lto_input_1_unsigned.
 	* tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d.
 	(streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p.
 	(streamer_read_string_cst): Rename from input_string_cst.
 	(streamer_read_chain): Rename from lto_input_chain.
 	(streamer_alloc_tree): Rename from lto_materialize_tree.
 	(streamer_read_tree_body): Rename from lto_input_tree_pointers.
 	(streamer_get_pickled_tree): Rename from lto_get_pickled_tree.
 	(streamer_get_builtin_tree): Rename from lto_get_builtin_tree.
 	(streamer_read_integer_cst): Rename from lto_input_integer_cst.
 	(streamer_read_tree_bitfields): Rename from tree_read_bitfields.
 	(streamer_write_chain): Rename from lto_output_chain.
 	(streamer_write_tree_header): Rename from lto_output_tree_header.
 	(streamer_pack_tree_bitfields): Rename from pack_value_fields.
 	(streamer_write_tree_body): Rename from lto_output_tree_pointers.
 	(streamer_write_integer_cst): Rename from lto_output_integer_cst.
 	(streamer_write_builtin): Rename from lto_output_builtin_tree.
 	(streamer_check_handled_ts_structures): Rename from
 	check_handled_ts_structures.
 	(streamer_tree_cache_insert): Rename from lto_streamer_cache_insert.
 	(streamer_tree_cache_insert_at): Rename from
 	lto_streamer_cache_insert_at.
 	(streamer_tree_cache_append): Rename from lto_streamer_cache_append.
 	(streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup.
 	(streamer_tree_cache_get): Rename from lto_streamer_cache_get.
 	(streamer_tree_cache_create): Rename from lto_streamer_cache_create.
 	(streamer_tree_cache_delete): Rename from lto_streamer_cache_delete.
 	* tree-streamer-out.c (write_string_cst): Rename from output_string_cst.
 	(write_identifier): Rename from output_identifier.
 	(write_ts_common_tree_pointers): Rename from
 	lto_output_ts_common_tree_pointers.
 	(write_ts_vector_tree_pointers): Rename from
 	lto_output_ts_vector_tree_pointers.
 	(write_ts_complex_tree_pointers): Rename from
 	lto_output_ts_complex_tree_pointers.
 	(write_ts_decl_minimal_tree_pointers): Rename from
 	lto_output_ts_decl_minimal_tree_pointers.
 	(write_ts_decl_common_tree_pointers): Rename from
 	lto_output_ts_decl_common_tree_pointers.
 	(write_ts_decl_non_common_tree_pointers): Rename from
 	lto_output_ts_decl_non_common_tree_pointers.
 	(write_ts_decl_with_vis_tree_pointers): Rename from
 	lto_output_ts_decl_with_vis_tree_pointers.
 	(write_ts_field_decl_tree_pointers): Rename from
 	lto_output_ts_field_decl_tree_pointers.
 	(write_ts_function_decl_tree_pointers): Rename from
 	lto_output_ts_function_decl_tree_pointers.
 	(write_ts_type_common_tree_pointers): Rename from
 	lto_output_ts_type_common_tree_pointers.
 	(write_ts_type_non_common_tree_pointers): Rename from
 	lto_output_ts_type_non_common_tree_pointers.
 	(write_ts_list_tree_pointers): Rename from
 	lto_output_ts_list_tree_pointers.
 	(write_ts_vec_tree_pointers): Rename from
 	lto_output_ts_vec_tree_pointers.
 	(write_ts_exp_tree_pointers): Rename from
 	lto_output_ts_exp_tree_pointers.
 	(write_ts_block_tree_pointers): Rename from
 	lto_output_ts_block_tree_pointers.
 	(write_ts_binfo_tree_pointers): Rename from
 	lto_output_ts_binfo_tree_pointers.
 	(write_ts_constructor_tree_pointers): Rename from
 	lto_output_ts_constructor_tree_pointers.
 	(write_ts_target_option): Rename from
 	lto_output_ts_target_option.
 	(write_ts_translation_unit_decl_tree_pointers): Rename from
 	lto_output_ts_translation_unit_decl_tree_pointers.
 	* tree-streamer.c (streamer_tree_cache_add_to_node_array):
 	Rename from lto_streamer_cache_add_to_node_array.
 	(streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1.
 	(record_common_node): Rename from lto_record_common_node.

	* streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward
	declarations.
	* data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused
	function.
	* data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove
	unused function.
	* Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H.
	(ipa-reference.o): Likewise.
	* lto-section-out.c: Include data-streamer.h.
	* ipa-reference.c: Include data-streamer.h.

From-SVN: r177704
2011-08-12 12:42:13 -04:00
Diego Novillo b939365672 tree-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers): Call stream_write_tree instead of output_record_start.
* tree-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers):
	Call stream_write_tree instead of output_record_start.
	(lto_output_ts_binfo_tree_pointers): Likewise.

	* streamer-hooks.h (stream_write_tree): Move from tree-streamer.h.
	Convert it to a macro.
	(stream_read_tree): Likewise.

	* lto-streamer.h (lto_stream_as_builtin_p): Move ...
	* tree-streamer.h (lto_stream_as_builtin_p): ... here.

	* lto-streamer-in.c (lto_read_tree): Call lto_streamer_cache_append
	and tree_read_bitfields.
	* lto-streamer-out.c (lto_is_streamable): Move from lto-streamer.c
	(lto_write_tree): Call it.
	* lto-streamer.c (lto_is_streamable): Move to lto-streamer-out.c
	* streamer-hooks.h (struct streamer_hooks): Remove fields
	name, is_streamable and alloc_tree. Update all users.
	* tree-streamer-in.c (tree_read_bitfields): Factor out of ...
	(lto_materialize_tree): ... here.
	Handle CALL_EXPR codes.
	Remove call to lto_streamer_cache_append.
	* tree-streamer-out.c (lto_output_tree_header): Handle
	CALL_EXPR nodes.
	* tree-streamer.h (tree_read_bitfields): Declare.

	* Makefile.in (TREE_STREAMER_H): Add STREAMER_HOOKS_H.
	(gimple-streamer-in.o): Add dependency on TREE_STREAMER_H.
	* tree-streamer.h (stream_read_tree): New.  Replace all calls
	to lto_input_tree with it.
	(stream_write_tree): New.  Replace all calls to lto_output_tree,
	lto_output_tree_ref and lto_output_tree_or_ref with it.
	* lto-streamer-in.c (lto_read_tree): Inline code from
	lto_streamer_read_tree.
	(lto_input_tree): Move from tree-streamer-in.c.
	* lto-streamer-out.c (lto_output_tree_ref): Make static.
	Remove handling of NULL values for EXPR.
	Do not handle EXPRs that are not indexable.
	(lto_write_tree): Move from tree-streamer-out.c.
	Inline lto_streamer_write_tree.
	(lto_output_tree): Move from tree-streamer-out.c.
	If REF_P is true and EXPR is indexable, call lto_output_tree_ref.
	* lto-streamer.c (lto_record_common_node): Move to tree-streamer.c.
	(lto_preload_common_nodes): Likewise.
	Remove assertions and adjustments for nodes
	main_identifier_node, ptrdiff_type_node and fileptr_type_node.
	(lto_streamer_hooks_init): Set streamer_hooks.write_tree to
	lto_output_tree and streamer_hooks.read_tree to
	lto_input_tree.
	* lto-streamer.h (lto_input_tree): Declare.
	(lto_output_tree_ref): Remove.
	* streamer-hooks.h (struct streamer_hooks): Remove fields
	preload_common_nodes, indexable_with_decls_p,
	pack_value_fields, unpack_value_fields, output_tree_header and
	has_unique_integer_csts_p.
	Update all users.
	* tree-streamer-in.c (lto_materialize_tree): Make extern.
	(lto_input_tree_pointers): Likewise.
	(lto_read_tree): Move to lto-streamer-in.c.
	(lto_input_integer_cst): Make extern.
	(lto_get_pickled_tree): Likewise.
	(lto_get_builtin_tree): Likewise.
	(lto_input_tree): Move to lto-streamer-in.c.
	* tree-streamer-out.c (pack_value_fields): Make extern.
	(lto_output_tree_or_ref): Remove.  Replace all callers with
	calls to stream_write_tree.
	(lto_output_builtin_tree): Make extern.
	(lto_streamer_write_tree): Inline into lto_write_tree.
	(lto_output_tree_pointers): Make extern.
	(lto_output_tree_header): Likewise.
	(lto_output_integer_cst): Likewise.
	(lto_write_tree): Move to lto-streamer-out.c.
	(lto_output_tree): Likewise.
	* tree-streamer.c (lto_record_common_node): Move from
	lto-streamer.c
	(preload_common_nodes): Likewise.
	(lto_streamer_cache_create): Call it.
	* tree-streamer.h: Include streamer-hooks.h.
	(stream_write_tree): New.
	(stream_read_tree): New.
	(lto_input_tree): Remove.
	(lto_materialize_tree): Declare.
	(lto_input_tree_pointers): Declare.
	(lto_get_pickled_tree): Declare.
	(lto_get_builtin_tree): Declare.
	(lto_input_integer_cst): Declare.
	(lto_output_tree_header): Declare.
	(pack_value_fields): Declare.
	(lto_output_tree_pointers): Declare.
	(lto_output_integer_cst): Declare.
	(lto_output_builtin_tree): Declare.

From-SVN: r177661
2011-08-11 08:02:34 -04:00
Diego Novillo f0efc7aa77 rebase
From-SVN: r177571
2011-08-08 12:49:34 -04:00
Richard Henderson 7644b3c7f0 dwarf2: Extract cfi creation to a new pass.
* tree-pass.h (pass_dwarf2_frame): Declare.
        * passes.c (init_optimization_passes): Add it.
        * dwarf2cfi.c (dwarf2out_frame_debug): Make static.
        (create_cfi_notes): Rename from dwarf2out_frame_debug_after_prologue;
        make static, do not call add_cfis_to_fde.
        (dwarf2out_frame_debug_init, dwarf2cfi_function_init,
        dwarf2out_frame_init): Merge into...
        (execute_dwarf2_frame): ... here.  New function.
        (dwarf2out_do_frame, dwarf2out_do_cfi_asm): Make boolean.  Change
        saved_do_cfi_asm to a tri-state variable.
        (gate_dwarf2_frame, pass_dwarf2_frame): New.
        * dwarf2out.c (dwarf2out_begin_prologue): Only allocate the fde
        if it has yet to be done.  Don't call dwarf2cfi_function_init.
        * dwarf2out.h, debug.h: Update decls.
        * final.c (final_start_function): Don't call
        dwarf2out_frame_debug_init or dwarf2out_frame_debug_after_prologue.
        * lto-streamer-in.c (lto_init_eh): Don't call dwarf2out_frame_init.
        * toplev.c (lang_dependent_init): Likewise.

From-SVN: r176019
2011-07-07 17:05:57 -07:00
Eric Botcazou bc712852cd tree.h (TYPE_ARTIFICIAL): New flag.
* tree.h (TYPE_ARTIFICIAL): New flag.
	* dwarf2out.c (modified_type_die): Add a DW_AT_artificial attribute to
	the DIE of the type if it is artificial.
	(gen_array_type_die): Likewise.
	(gen_enumeration_type_die): Likewise.
	(gen_struct_or_union_type_die): Likewise.
	* lto-streamer-in.c (unpack_ts_base_value_fields): Use TYPE_ARTIFICIAL.
	* lto-streamer-out.c (pack_ts_base_value_fields): Likewise.
ada/
	* gcc-interface/utils.c (record_builtin_type): Set TYPE_ARTIFICIAL on
	the type according to the ARTIFICIAL_P parameter.
	(create_type_decl): Likewise.
	(create_type_stub_decl): Set TYPE_ARTIFICIAL on the type to 1.

Co-Authored-By: Nicolas Setton <setton@adacore.com>
Co-Authored-By: Olivier Hainque <hainque@adacore.com>

From-SVN: r175781
2011-07-02 18:13:47 +00:00
Diego Novillo 47c79d563b Makefile.in (lto-compress.o): Add dependency on LTO_STREAMER_H.
* Makefile.in (lto-compress.o): Add dependency on LTO_STREAMER_H.
	(cgraph.o): Likewise.
	(cgraphunit.o): Likewise.
	* cgraphunit.c: Include lto-streamer.h
	(cgraph_finalize_compilation_unit): Call lto_streamer_hooks_init
	if LTO is enabled.
	* lto-streamer-in.c (unpack_value_fields): Call
	streamer_hooks.unpack_value_fields if set.
	(lto_materialize_tree): For unhandled nodes, first try to
	call lto_streamer_hooks.alloc_tree, if it exists.
	(lto_input_ts_decl_common_tree_pointers): Move reading of
	DECL_INITIAL to lto_streamer_read_tree.
	(lto_read_tree): Call lto_streamer_hooks.read_tree if set.
	(lto_streamer_read_tree): New.
	(lto_reader_init): Rename from lto_init_reader.
	Move initialization code to lto/lto.c.
	* lto-streamer-out.c (pack_value_fields): Call
	streamer_hooks.pack_value_fields if set.
	(lto_output_tree_ref): For tree nodes that are not
	normally indexable, call streamer_hooks.indexable_with_decls_p
	before giving up.
	(lto_output_ts_decl_common_tree_pointers): Move handling
	for FUNCTION_DECL and TRANSLATION_UNIT_DECL to
	lto_streamer_write_tree.
	(lto_output_tree_header): Call streamer_hooks.is_streamable
	instead of lto_is_streamable.
	Call lto_streamer_hooks.output_tree_header if set.
	(lto_write_tree): Call lto_streamer_hooks.write_tree if
	set.
	(lto_streamer_write_tree): New.
	(lto_output): Call lto_streamer_init directly.
	(lto_writer_init): Remove.
	* lto-streamer.c (streamer_hooks): New.
	(lto_streamer_cache_create): Call streamer_hooks.preload_common_nodes
	instead of lto_preload_common_nodes.
	(lto_is_streamable): Move from lto-streamer.h
	(lto_streamer_hooks_init): New.
	(streamer_hooks): New.
	(streamer_hooks_init): New.
	* lto-streamer.h (struct output_block): Forward declare.
	(struct lto_input_block): Likewise.
	(struct data_in): Likewise.
	(struct bitpack_d): Likewise.
	(struct streamer_hooks): Declare.
	(streamer_hooks): Declare.
	(lto_streamer_hooks_init): Declare.
	(lto_streamer_write_tree): Declare.
	(lto_streamer_read_tree): Declare.
	(streamer_hooks_init): Declare.
	(lto_is_streamable): Move to lto-streamer.c

lto/ChangeLog

	* lto.c (lto_init): New.
	(lto_main): Call it.

From-SVN: r174709
2011-06-06 12:49:11 -04:00
Diego Novillo dc58780924 lto-streamer-in.c (unpack_value_fields): Remove unneeded asserts.
* lto-streamer-in.c (unpack_value_fields): Remove unneeded asserts.
	(lto_input_tree_pointers): Likewise.
	* lto-streamer-out.c (pack_value_fields): Likewise.
	(lto_output_tree_pointers): Likewise.
	* lto-streamer.h (lto_is_streamable): Add check for OMP_CLAUSE
	and OPTIMIZATION_NODE.

From-SVN: r174625
2011-06-03 18:48:27 -04:00
Diego Novillo d5828cc762 lto-streamer-in.c (get_resolution): Move to lto/lto.c.
* lto-streamer-in.c (get_resolution): Move to lto/lto.c.
	(lto_register_var_decl_in_symtab): Likewise.
	(lto_register_function_decl_in_symtab): Likewise.
	(lto_read_tree): Move VAR_DECL and FUNCTION_DECL registration
	logic to lto_read_decls.

lto/ChangeLog

	* lto.c (get_resolution): Move from lto-streamer-in.c.
	(lto_register_var_decl_in_symtab): Likewise.
	(lto_register_function_decl_in_symtab): Likewise.
	(uniquify_nodes): Call lto_register_var_decl and
	lto_register_function_decl_in_symtab after reading a new
	VAR_DECL or FUNCTION_DECL.

From-SVN: r174604
2011-06-03 10:53:27 -04:00
Jan Hubicka fa76600695 lto-streamer-out.c (pack_ts_fixed_cst_value_fields, [...]): Use enum and variable length i/o.
* lto-streamer-out.c (pack_ts_fixed_cst_value_fields,
	pack_ts_decl_common_value_fields, pack_ts_decl_with_vis_value_fields,
	pack_ts_function_decl_value_fields, lto_output_builtin_tree,
	output_cfg, output_gimple_stmt): Use enum and variable length i/o.
	* lto-streamer-in.c (input_cfg, input_gimple_stmt,
	unpack_ts_fixed_cst_value_fields, unpack_ts_decl_common_value_fields,
	unpack_ts_decl_with_vis_value_fields,
	unpack_ts_type_common_value_fields, unpack_ts_block_value_fields,
	lto_get_builtin_tree): Use enum and variable length i/o.
	* basic-block.h (profile_status_d): Add PROFILE_LAST.
	* lto-streamer.h (bp_pack_int_in_range, bp_unpack_int_in_range):
	New functions.
	(bp_pack_enum, bp_unpack_enum): New macros.

From-SVN: r174394
2011-05-29 11:40:25 +00:00
Jan Hubicka 51a9ed47c9 lto-streamer-out.c (lto_string_index): break out from...; offset by 1 so 0 means NULL string.
* lto-streamer-out.c (lto_string_index): break out from...; offset by 1
	so 0 means NULL string.
	(lto_output_string_with_length): ... here.
	(lto_output_string, output_string_cst, output_identifier): Update handling
	of NULL strings.
	(lto_output_location_bitpack): New function.
	(lto_output_location): Use it.
	(lto_output_tree_ref): Use output_record_start.
	(pack_ts_type_common_value_fields): Pack aliagn & alias set in var len values.
	* lto-streamer-in.c (string_for_index): Break out from ...; offset values by 1.
	(input_string_internal): ... here; 
	(input_string_cst, input_identifier, lto_input_string): Update handling of
	NULL strings.
	(lto_input_location_bitpack): New function
	(lto_input_location): Use it.
	(unpack_ts_type_common_value_fields): Pack align & alias in var len values.
	* lto-streamer.h (bp_pack_val_len_unsigned, bp_pack_val_len_int,
	bp_unpack_val_len_unsigned, bp_unpack_val_len_int): Declare.
	(bp_pack_value): Sanity check the value range.
	* lto-section-in.c (bp_unpack_val_len_unsigned, bp_unpack_val_len_int):
	New functions.
	* lto-section-out.h (bp_pack_val_len_unsigned, bp_pack_val_len_int):
	New functions.

From-SVN: r174325
2011-05-27 09:57:40 +00:00
Jan Hubicka f242c0a5c0 lto-streamer-out.c (output_record_start): Use lto_output_enum
* lto-streamer-out.c (output_record_start): Use lto_output_enum
	(lto_output_tree): Use output_record_start.
	* lto-streamer-in.c (input_record_start): Use lto_input_enum
	(lto_get_pickled_tree): Use input_record_start.
	* lto-section-in.c (lto_section_overrun): Turn into fatal error.
	(lto_value_range_error): New function.
	* lto-streamer.h (lto_value_range_error): Declare.
	(lto_output_int_in_range, lto_input_int_in_range): New functions.
	(lto_output_enum, lto_input_enum): New macros.

From-SVN: r174186
2011-05-25 12:07:38 +00:00
Nathan Froyd 515456820e split tree_type
split tree_type
gcc/ada/
	* gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE): Use TYPE_MINVAL.
	(TYPE_GCC_MIN_VALUE): Use TYPE_MINVAL.
	(TYPE_GCC_MAX_VALUE): Use TYPE_MAXVAL.

gcc/cp/
	* cp-tree.h (TYPENAME_TYPE_FULLNAME, TYPEOF_TYPE_EXPR): Use
	TYPE_VALUES_RAW.
	(UNDERLYING_TYPE_TYPE, DECLTYPE_TYPE_EXPR): Likewise.
	(DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): Likewise.
	(TEMPLATE_TYPE_PARM_INDEX): Likewise.

gcc/
	* ggc-page.c (extra_order_size_table): Use struct
	tree_type_non_common.
	* lto-streamer-in.c (unpack_ts_type_value_fields): Rename to...
	(unpack_ts_type_common_value_fields): ...this.  Update comment.
	(unpack_value_fields): Adjust for renaming.
	(lto_input_ts_type_tree_pointers): Split into...
	(lto_input_ts_type_common_tree_pointer): ...this and...
	(lto_input_ts_type_non_common_tree_pointers): ...this.
	(lto_input_tree_pointers): Adjust for above split.
	* lto-streamer-out.c (pack_ts_type_value_fields): Rename to...
	(pack_ts_type_common_value_fields): ...this.  Update comment.
	(lto_output_ts_type_tree_pointers): Split into...
	(lto_output_ts_type_common_tree_pointers): ...this and...
	(lto_output_ts_type_non_common_tree_pointers): ...this.
	(lto_output_tree_pointers): Adjust for above split.
	* lto-streamer.c (check_handled_ts_structures): Mark TS_TYPE_COMMON,
	TS_TYPE_WITH_LANG_SPECIFIC, and TS_TYPE_NON_COMMON as handled.
	* stor-layout.c (vector_type_mode): Adjust location of mode field.
	* tree.h (MARK_TS_TYPE_COMMON, MARK_TS_TYPE_WITH_LANG_SPECIFIC):
	Define.
	(struct tree_type): Split into...
	(struct tree_type_common: ...this and...
	(struct tree_type_with_lang_specific): ...this and...
	(struct tree_type_non_common): ...this.  Adjust accessor macros
	accordingly.
	(TYPE_VALUES_RAW): Define.
	(union tree_node): Update for above changes.
	* tree.c (tree_node_structure_for_code) [tcc_type]: Return
	TS_TYPE_NON_COMMON.
	(initialize_tree_contains_struct) [TS_TYPE]: Use TS_TYPE_COMMON.
	Add TS_TYPE_WITH_LANG_SPECIFIC and TS_TYPE_NON_COMMON.
	(tree_code_size) [tcc_type]: Use struct tree_type_non_common.
	* treestructu.def (TS_TYPE): Remove.
	(TS_TYPE_COMMON, TS_TYPE_WITH_LANG_SPECIFIC, TS_TYPE_NON_COMMON):
	Define.

gcc/java/
	* java-tree.h (TYPE_ARGUMENT_SIGNATURE): Use TYPE_MINVAL.

gcc/lto/
	* lto.c (lto_ft_type): Use TYPE_MINVAL and TYPE_MAXVAL.  Adjust
	location of binfo field.
	(lto_fixup_prevailing_decls): Likewise.

gcc/objc/
	* objc-act.h (CLASS_NAME, CLASS_SUPER_NAME): Use proper accessors.
	(CLASS_NST_METHODS, CLASS_CLS_METHODS): Likewise.
	(PROTOCOL_NAME, PROTOCOL_NST_METHODS, PROTOCOL_CLS_METHODS): Likewise.

From-SVN: r173658
2011-05-11 13:48:55 +00:00
Eric Botcazou 907a08d9b1 tree.h (get_pending_sizes): Remove prototype.
* tree.h (get_pending_sizes): Remove prototype.
	(put_pending_size): Likewise.
	(put_pending_sizes): Likewise.
	* stor-layout.c (pending_sizes): Delete.
	(get_pending_sizes): Likewise.
	(put_pending_size): Likewise.
	(put_pending_sizes): Likewise.
	(variable_size): Do not call put_pending_size and tidy up.
	* function.h (struct function): Remove dont_save_pending_sizes_p.
	* lto-streamer-in.c (input_function): Do not stream it.
	* lto-streamer-out.c (output_function): Likewise.
	* tree-inline.c (initialize_cfun): Do not copy it.
	* c-decl.c (store_parm_decls): Do not set it.
	* omp-low.c (create_task_copyfn): Likewise.
	* tree-optimize.c (tree_rest_of_compilation): Likewise.
cp/
	* decl.c (start_preparsed_function): Likewise.
fortran/
	* trans-decl.c (trans_function_start): Likewise.
ada/
	* gcc-interface/utils.c (begin_subprog_body): Do not call
	get_pending_sizes.
	(end_subprog_body): Likewise.

From-SVN: r173424
2011-05-05 11:49:05 +00:00
Richard Guenther 9efdb4adb6 re PR tree-optimization/48846 (Many -O2 -flto testsuite failures with -m32 -mavx)
2011-05-03  Richard Guenther  <rguenther@suse.de>

	PR lto/48846
	* lto-streamer-in.c (unpack_ts_decl_common_value_fields):
	Stream decl_common.off_align instead of the derived DECL_OFFSET_ALIGN.
	* lto-streamer-out.c (pack_ts_decl_common_value_fields): Likewise.

From-SVN: r173298
2011-05-03 10:18:29 +00:00
Richard Sandiford 25583c4f45 Makefile.in (INTERNAL_FN_DEF, [...]): Define.
gcc/
	* Makefile.in (INTERNAL_FN_DEF, INTERNAL_FN_H): Define.
	(GIMPLE_H): Include $(INTERNAL_FN_H).
	(OBJS-common): Add internal-fn.o.
	(internal-fn.o): New rule.
	* internal-fn.def: New file.
	* internal-fn.h: Likewise.
	* internal-fn.c: Likewise.
	* gimple.h: Include internal-fn.h.
	(GF_CALL_INTERNAL): New gf_mask.
	(gimple_statement_call): Put fntype into a union with a new
	internal_fn field.
	(gimple_build_call_internal): Declare.
	(gimple_build_call_internal_vec): Likewise.
	(gimple_call_same_target_p): Likewise.
	(gimple_call_internal_p): New function.
	(gimple_call_internal_fn): Likewise.
	(gimple_call_fntype): Return null for internal calls.
	(gimple_call_set_fntype): Assert that the function is not internal.
	(gimple_call_set_fn): Likewise.
	(gimple_call_set_fndecl): Likewise.
	(gimple_call_set_internal_fn): New function.
	(gimple_call_addr_fndecl): Handle null functions.
	(gimple_call_return_type): Likewise null types.
	* gimple.c (gimple_build_call_internal_1): New function.
	(gimple_build_call_internal): Likewise.
	(gimple_build_call_internal_vec): Likewise.
	(gimple_call_same_target_p): Likewise.
	(gimple_call_flags): Handle calls to internal functions.
	(gimple_call_fnspec): New function.
	(gimple_call_arg_flags, gimple_call_return_flags): Use it.
	(gimple_has_side_effects): Handle null functions.
	(gimple_rhs_has_side_effects): Likewise.
	(gimple_call_copy_skip_args): Handle calls to internal functions.
	* cfgexpand.c (expand_call_stmt): Likewise.
	* expr.c (expand_expr_real_1): Assert that the call isn't internal.
	* gimple-fold.c (gimple_fold_call): Handle null functions.
	(gimple_fold_stmt_to_constant_1): Don't fold
	calls to internal functions.
	* gimple-low.c (gimple_check_call_args): Handle calls to internal
	functions.
	* gimple-pretty-print.c (dump_gimple_call): Likewise.
	* ipa-prop.c (ipa_analyze_call_uses): Handle null functions.
	* tree-cfg.c (verify_gimple_call): Handle calls to internal functions.
	(do_warn_unused_result): Likewise.
	* tree-eh.c (same_handler_p): Use gimple_call_same_target_p.
	* tree-ssa-ccp.c (ccp_fold_stmt): Handle calls to internal functions.
	* tree-ssa-dom.c (hashable_expr): Use the gimple statement to record
	the target of a call.
	(initialize_hash_element): Update accordingly.
	(hashable_expr_equal_p): Use gimple_call_same_target_p.
	(iterative_hash_hashable_expr): Handle calls to internal functions.
	(print_expr_hash_elt): Likewise.
	* tree-ssa-pre.c (can_value_number_call): Likewise.
	(eliminate): Handle null functions.
	* tree-ssa-sccvn.c (visit_use): Handle calls to internal functions.
	* tree-ssa-structalias.c (get_fi_for_callee): Likewise.
	(find_func_aliases): Likewise.
	* value-prof.c (gimple_ic_transform): Likewise.
	(gimple_indirect_call_to_profile): Likewise.
	* lto-streamer-in.c (input_gimple_stmt): Likewise.
	* lto-streamer-out.c (output_gimple_stmt): Likewise.

From-SVN: r172758
2011-04-20 08:21:25 +00:00
Nathan Froyd 81f653d624 ada-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN.
gcc/ada/
	* gcc-interface/ada-tree.h (union lang_tree_node): Check for
	TS_COMMON before calling TREE_CHAIN.
	* gcc-interface/misc.c (gnat_init_ts): New function.
	(LANG_HOOKS_INIT_TS): Define.

gcc/
	* c-decl.c (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.
	* print-tree.c (print_node): Likewise.
	* tree-inline.c (copy_tree_r): Likewise.
	* c-lang.c (LANG_HOOKS_INIT_TS): Define.
	* lto-streamer-in.c (lto_input_tree_pointers): Check for TS_TYPED
	instead of TS_COMMON.
	* lto-streamer-out.c (lto_output_tree_pointers): Likewise.
	* tree.c (initialize_tree_contains_struct): Handle TS_TYPED.
	(copy_node_stat): Zero TREE_CHAIN only if necessary.
	(MARK_TS_BASE, MARK_TS_TYPED, MARK_TS_COMMON): Move these...
	(MARK_TS_DECL_COMMON, MARK_TS_DECL_COMMON, MARK_TS_DECL_WRTL):
	...and these...
	(MARK_TS_DECL_WITH_VIS, MARK_TS_DECL_NON_COMMON): ...and these...
	* tree.h: ...here.
	(TREE_CHAIN): Check for a TS_COMMON structure.
	(TREE_TYPE): Check for a TS_TYPED structure.

gcc/c-family/
	* c-common.h (c_common_init_ts): Declare.
	* c-common.c (c_common_init_ts): Define.

gcc/cp/
	* cp-lang.c (cp_init_ts): Call cp_common_init_ts.  Move
	tree_contains_struct initialization to...
	* cp-objcp-common.c (cp_common_init_ts): ...here.  Use MARK_*
	macros.
	* cp-objcp-common.h (cp_common_init_ts): Declare.
	* cp-tree.h (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.

gcc/fortran/
	* f95-lang.c (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.

gcc/go/
	* go-lang.c (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.

gcc/java/
	* java-tree.h (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.

gcc/lto/
	* lto-tree.h (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.
	* lto.c (lto_fixup_common): Likewise.

gcc/objc/
	* objc-lang.c (objc_init_ts): Move code for this function...
	* objc-act.c (objc_common_init_ts): ...here. Define.
	* objc-act.h (objc_common_init_ts): Declare.

gcc/objcp/
	* objcp-lang.c (objcxx_init_ts): Call objc_common_init_ts and
	cp_common_init_ts.

From-SVN: r172359
2011-04-13 03:09:53 +00:00
Richard Guenther f20ca72587 re PR tree-optimization/46076 (constant propagation and compile-time math no longer happening versus 4.4 and 4.5)
2011-04-12  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/46076
	* gimple.h (struct gimple_statement_call): Add fntype field.
	(gimple_call_fntype): Adjust.
	(gimple_call_set_fntype): New function.
	* gimple.c (gimple_build_call_1): Set the call function type.
	* gimplify.c (gimplify_call_expr): Preserve the function
	type the frontend used for the call.
	(gimplify_modify_expr): Likewise.
	* lto-streamer-in.c (input_gimple_stmt): Input the call stmts
	function type.
	* lto-streamer-out.c (output_gimple_stmt): Output the call stmts
	function type.
	* tree-ssa.c (useless_type_conversion_p): Function pointer
	conversions are useless.

	* gcc.dg/tree-ssa/pr46076.c: Un-XFAIL.

From-SVN: r172310
2011-04-12 10:44:15 +00:00
Martin Jambor a358e18845 cgraph.h (cgraph_node): Remove function declaration.
2011-04-12  Martin Jambor  <mjambor@suse.cz>

	* cgraph.h (cgraph_node): Remove function declaration.
	(cgraph_create_node): Declare.
	(cgraph_get_create_node): Likewise.
	* cgraph.c (cgraph_create_node): Renamed to cgraph_create_node_1.
	Updated all callers.
	(cgraph_node): Renamed to cgraph_create_node, assert that a node for
	the decl does not already exist.  Call cgraph_get_create_node instead
	of cgraph_node.
	(cgraph_get_create_node): New function.
	(cgraph_same_body_alias): Update comment.
	(cgraph_set_call_stmt): Call cgraph_get_node instead of cgraph_node,
	assert it does not return NULL.
	(cgraph_update_edges_for_call_stmt): Likewise.
	(cgraph_clone_edge): Likewise.
	(cgraph_create_virtual_clone): Likewise.
	(cgraph_update_edges_for_call_stmt_node): Call cgraph_get_create_node
	instead of cgraph_node.
	(cgraph_add_new_function): Call cgraph_create_node or
	cgraph_get_create_node instead of cgraph_node.
	* cgraphbuild.c (record_reference): Call cgraph_get_create_node
	instead of cgraph_node.
	(record_eh_tables): Likewise.
	(mark_address): Likewise.
	(mark_load): Likewise.
	(build_cgraph_edges): Call cgraph_get_create_node instead
	of cgraph_node.
	(rebuild_cgraph_edges): Likewise.
	* cgraphunit.c (cgraph_finalize_function): Call cgraph_get_create_node
	instead of cgraph_node.
	(cgraph_copy_node_for_versioning): Call cgraph_create_node instead of
	cgraph_node.
	* lto-symtab.c (lto_symtab_merge_cgraph_nodes_1): Call
	cgraph_create_node instead of cgraph_node.
	* c-decl.c (finish_function): Call cgraph_get_create_node instead
	of cgraph_node.
	* lto-cgraph.c (input_node): Likewise.
	* lto-streamer-in.c (input_function): Likewise.
	* varasm.c (mark_decl_referenced): Likewise.
	(assemble_alias): Likewise.

gcc/c-family/
	* c-gimplify.c (c_genericize): Call cgraph_get_create_node instead
	of cgraph_node.

gcc/cp/
	* cp/class.c (cp_fold_obj_type_ref): Call cgraph_get_create_node
	instead of cgraph_node.
	* cp/decl2.c (cxx_callgraph_analyze_expr): Likewise.
	(cp_write_global_declarations): Likewise.
	* cp/optimize.c (maybe_clone_body): Likewise.
	* cp/semantics.c (maybe_add_lambda_conv_op): Likewise.
	* cp/mangle.c (mangle_decl): Likewise.
	* cp/method.c (make_alias_for_thunk): Likewise.
	(use_thunk): Likewise.

gcc/ada/
	* gcc-interface/utils.c (end_subprog_body): Call
	cgraph_get_create_node instead of cgraph_node.

gcc/fortran/
	* trans-decl.c (gfc_generate_function_code): Call
	cgraph_get_create_node instead of cgraph_node.

gcc/objc/
	* objc-act.c (mark_referenced_methods): Call cgraph_get_create_node
	instead of cgraph_node.

From-SVN: r172307
2011-04-12 11:27:18 +02:00
Martin Jambor fe660d7bfe tree-inline.c (tree_function_versioning): Call cgraph_get_node instead of cgraph_node and assert it does not return NULL.
2011-04-12  Martin Jambor  <mjambor@suse.cz>

	* tree-inline.c (tree_function_versioning): Call cgraph_get_node
	instead of cgraph_node and assert it does not return NULL.
	* lto-streamer-in.c (lto_read_body): Likewise.
	* omp-low.c (new_omp_context): Likewise.
	(create_task_copyfn): Likewise.
	* tree-emutls.c (lower_emutls_function_body): Likewise.
	* matrix-reorg.c (transform_allocation_sites): Likewise.

From-SVN: r172306
2011-04-12 11:12:58 +02:00
Michael Matz e89964e31c lto-streamer.h (struct lto_streamer_cache_d): Remove offsets and next_slot members.
* lto-streamer.h (struct lto_streamer_cache_d): Remove offsets
	and next_slot members.
	(lto_streamer_cache_insert, lto_streamer_cache_insert_at,
	lto_streamer_cache_lookup, lto_streamer_cache_get): Adjust prototypes.
	(lto_streamer_cache_append): Declare.
	* lto-streamer.c (lto_streamer_cache_add_to_node_array): Use
	unsigned index, remove offset parameter, ensure that we append
	or update existing entries.
	(lto_streamer_cache_insert_1): Use unsigned index, remove offset_p
	parameter, update next_slot for append.
	(lto_streamer_cache_insert): Use unsigned index, remove offset_p
	parameter.
	(lto_streamer_cache_insert_at): Likewise.
	(lto_streamer_cache_append): New function.
	(lto_streamer_cache_lookup): Use unsigned index.
	(lto_streamer_cache_get): Likewise.
	(lto_record_common_node): Don't test tree_node_can_be_shared.
	(preload_common_node): Adjust call to lto_streamer_cache_insert.
	(lto_streamer_cache_delete): Don't free offsets member.
	* lto-streamer-out.c (eq_string_slot_node): Use memcmp.
	(lto_output_string_with_length): Use lto_output_data_stream.
	(lto_output_tree_header): Remove ix parameter, don't write it.
	(lto_output_builtin_tree): Likewise.
	(lto_write_tree): Adjust callers to above, don't track and write
	offset, write unsigned index.
	(output_unreferenced_globals): Don't emit all global vars.
	(write_global_references): Use unsigned indices.
	(lto_output_decl_state_refs): Likewise.
	(write_symbol): Likewise.
	* lto-streamer-in.c (lto_input_chain): Move earlier.
	(input_function): Use unsigned index.
	(input_alias_pairs): Don't read and then ignore all global vars.
	(lto_materialize_tree): Remove ix_p parameter, don't read index,
	don't pass it back, use lto_streamer_cache_append.
	(lto_register_var_decl_in_symtab): Use unsigned index.
	(lto_register_function_decl_in_symtab): Likewise.
	(lto_get_pickled_tree): Don't read in or handle offset, read unsigned
	index.
	(lto_get_builtin_tree): Don't read index, use
	lto_streamer_cache_append.
	(lto_read_tree): Adjust call to lto_materialize_tree.

	* ipa-inline.c (cgraph_edge_badness): Move growth calculaton,
	don't use function calls in arguments to MIN.

	* varasm.c (decl_binds_to_current_def_p): Don't check TREE_PUBLIC
	twice.

	* gimple.c (gimple_type_leader_entry): Mark deletable.

lto/
	* lto.c (lto_materialize_function): Don't read and then discard
	sections in WPA mode.
	(lto_read_in_decl_state): Adjust call to lto_streamer_cache_get.

	* lto-lang.c (registered_builtin_fndecls): Remove.
	(lto_getdecls): Return NULL_TREE.
	(lto_builtin_function): Don't remember in registered_builtin_fndecls.

From-SVN: r171906
2011-04-03 11:21:06 +00:00
Richard Biener 8f98453427 tree-dfa.c (renumber_gimple_stmt_uids): Also number PHIs.
2011-03-30  Richard Guenther  <rguenther@suse.de>

	* tree-dfa.c (renumber_gimple_stmt_uids): Also number PHIs.
	* lto-streamer-out.c (output_function): Do not use
	renumber_gimple_stmt_uids.
	* lto-streamer-in.c (input_function): Likewise.

From-SVN: r171734
2011-03-30 15:43:59 +00:00
Diego Novillo a183b5c7af lto-opts.c (input_data_block): Move to lto-streamer-in.c.
* lto-opts.c (input_data_block): Move to lto-streamer-in.c.
	* lto-streamer-in.c (input_string_internal): Add clarifying
	comments.
	(lto_input_data_block): Move from lto-opts.c.  Make extern.
	Update all users.
	(lto_input_string): Rename from input_string.  Make extern.
	Update all users.
	* lto-streamer-out.c (lto_output_string_with_length): Rename from
	output_string_with_length.
	Output 0 to indicate a non-NULL string.  Update all callers to
	not emit 0.
	(lto_output_string): Rename from output_string.  Make extern.
	Update all users.
	(lto_output_decl_state_streams): Make extern.
	(lto_output_decl_state_refs): Make extern.
	* lto-streamer.h (lto_input_string): Declare.
	(lto_input_data_block): Declare.
	(lto_output_string): Declare.
	(lto_output_string_with_length): Declare.
	(lto_output_decl_state_streams): Declare.
	(lto_output_decl_state_refs): Declare.

From-SVN: r171387
2011-03-24 08:39:59 -04:00
Richard Guenther 06c7edcc27 re PR lto/46911 (ICE: SIGSEGV in add_name_and_src_coords_attributes (dwarf2out.c:17792) with -flto -g)
2011-03-01  Richard Guenther  <rguenther@suse.de>

	PR lto/46911
	* lto-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
	Do not stream DECL_ABSTRACT_ORIGIN.
	(lto_input_ts_block_tree_pointers): Nor BLOCK_SOURCE_LOCATION,
	BLOCK_NONLOCALIZED_VARS or BLOCK_ABSTRACT_ORIGIN.
	* lto-streamer-out.c (lto_output_ts_decl_common_tree_pointers):
	Do not stream DECL_ABSTRACT_ORIGIN.
	(lto_output_ts_block_tree_pointers): Nor BLOCK_SOURCE_LOCATION,
	BLOCK_NONLOCALIZED_VARS or BLOCK_ABSTRACT_ORIGIN.

	* gfortran.dg/lto/pr46911_0.f: New testcase.

From-SVN: r170588
2011-03-01 09:45:05 +00:00
Richard Guenther 1c3277eef0 lto-streamer-in.c (input_bb): Do not find referenced vars in debug statements.
2011-02-24  Richard Guenther  <rguenther@suse.de>

	* lto-streamer-in.c (input_bb): Do not find referenced vars
	in debug statements.

From-SVN: r170465
2011-02-24 12:50:54 +00:00
Richard Guenther e292d00367 re PR bootstrap/47820 (LTO bootstrap failed with bootstrap-profiled)
2011-02-21  Richard Guenther  <rguenther@suse.de>

	PR lto/47820
	* lto-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
	Do not stream DECL_INITIAL for TRANSLATION_UNIT_DECLs.
	(lto_input_ts_block_tree_pointers): Hook a BLOCK into the
	TUs context.
	* lto-streamer-out.c (lto_output_ts_decl_common_tree_pointers): 
	Do not stream DECL_INITIAL for TRANSLATION_UNIT_DECLs.

From-SVN: r170359
2011-02-21 13:38:48 +00:00
Richard Guenther becf4c11df re PR debug/47647 (BLOCKs are empty)
2011-02-18  Richard Guenther  <rguenther@suse.de>

	PR lto/47647
	* lto-streamer-in.c (lto_input_ts_decl_minimal_tree_pointers):
	Remove lazy BLOCK_VARS streaming.
	(lto_input_ts_block_tree_pointers): Likewise.
	* lto-streamer-out.c (lto_output_ts_block_tree_pointers): Likewise.

From-SVN: r170321
2011-02-19 19:50:36 +00:00
Richard Guenther 237d62592a re PR lto/47798 (LTO debuginfo for globals wrong)
2011-02-18  Richard Guenther  <rguenther@suse.de>

	PR lto/47798
	* lto-streamer.h (lto_global_var_decls): Declare.
	* lto-streamer-in.c (lto_register_var_decl_in_symtab): Register
	statics for global var processing.

	lto/
	* lto-tree.h (lto_global_var_decls): Do not declare here.
	* lto-lang.c: Include lto-streamer.h.
	* Make-lang.in (lto-lang.o): Adjust dependencies.

From-SVN: r170274
2011-02-18 16:24:40 +00:00
Jan Hubicka 06c9eb5136 re PR lto/46083 (gcc.dg/initpri1.c FAILs with -flto/-fwhopr (attribute constructor/destructor doesn't work))
PR lto/46083
	* lto-streamer-out.c (pack_ts_function_decl_value_fields): Store
	DECL_FINI_PRIORITY.
	* lto-streamer-in.c (unpack_ts_function_decl_value_fields):
	Restore DECL_FINI_PRIORITY.
	* gcc.dg/initpri3.c: New testcase.

From-SVN: r168642
2011-01-10 21:54:33 +00:00
Jan Hubicka e7abfe07ee * lto-streamer-in.c (input_cfg): Fix pasto.
From-SVN: r167467
2010-12-05 01:22:12 +00:00
Jan Hubicka db0bf14f6b re PR driver/46760 (LTO bootstrap doesn't work with FDO)
PR tree-optimization/46760
	* cgraph.c (cgraph_create_node): Initialize count_materialization_scale.
	* cgraph.h (struct cgraph_node): Add count_materialization_scale.
	* lto-cgraph.c (lto_output_edge): Fix assert.
	(lto_output_node): Output count_materialization_scale.
	(output_profile_summary): Output only runs and sum_max.
	(input_node): Input count_materialization_scale.
	(input_profile_summary): Read data into file specific gcov summary.
	(merge_profile_summaries): New function.
	(input_cgraph): Update call of input_profile_summary;
	call merge_profile_summaries.
	* lto-streamer-in.c (input_cfg): Add count_materialization_scale arg;
	rescale counts at read in.
	(intput_bb): Likewise.
	(input_function): Update call of input_bb.
	(lto_read_body): Update call of input_cfg.
	* lto-streamer.h: Inlclude gcov-io.h
	(lto_file_decl_data): Add gcov_ctr_summary.

From-SVN: r167458
2010-12-04 19:35:23 +00:00
Richard Guenther e0cbb51bee lto-streamer-in.c (input_gimple_stmt): Use types_compatible_p.
2010-11-24  Richard Guenther  <rguenther@suse.de>

	* lto-streamer-in.c (input_gimple_stmt): Use types_compatible_p.

From-SVN: r167116
2010-11-24 15:42:27 +00:00
Richard Guenther dbe9f23ca7 re PR lto/46606 (ICE in input_gimple_stmt in lto1)
2010-11-24  Richard Guenther  <rguenther@suse.de>

	PR lto/46606
	* lto-streamer-in.c (input_gimple_stmt): When we cannot find
	a FIELD_DECL that is type correct issue a warning and fixup
	with a VIEW_CONVERT_EXPR.

From-SVN: r167115
2010-11-24 14:00:43 +00:00
Richard Guenther 132797449d re PR lto/45789 (ICE: tree code 'lang_type' is not supported in gimple streams with -flto when using __builtin_printf())
2010-11-19  Richard Guenther  <rguenther@suse.de>

	PR lto/45789
	* lto-streamer-out.c (lto_output_ts_common_tree_pointers): For
	IDENTIFIERs do not stream TREE_TYPE.
	* lto-streamer-in.c (lto_input_ts_common_tree_pointers): Likewise.

From-SVN: r166936
2010-11-19 11:57:21 +00:00
Nathan Froyd 77a74ed7f0 basic-block.h (single_succ_edge): Use gcc_checking_assert.
* basic-block.h (single_succ_edge): Use gcc_checking_assert.
	(single_pred_edge, ei_container, ei_next, ei_prev): Likewise.
	* cfghooks.c (fixup_reorder_chain): Likewise.
	* cfgrtl.c (cfg_layout_merge_blocks): Likewise.
	* cgraph.c (cgraph_add_thunk): Likewise.
	(cgraph_create_edge_1): Likewise.
	(cgraph_create_virtual_clone): Likewise.
	* ddg.c (add_cross_iteration_register_deps): Likewise.
	* dwarf2out.c (modified_type_die): Likewise.
	* emit-rtl.c (set_mem_alias_set): Likewise.
	* ggc-zone.c (zone_allocate_marks): Likewise.
	* gimple-iterator.c (gsi_move_to_bb_end): Likewise.
	* gimple.c (iterative_hash_gimple_type): Likewise.
	* graphite-scop-detection.c (create_single_entry_edge): Likewise.
	(create_single_exit_edge): Likewise.
	* haifa-sched.c (choose_ready): Likewise.
	* lto-streamer-in.c (input_gimple_stmt): Likewise.
	* passes.c (execute_todo): Likewise.
	* sched-ebb.c (begin_schedule_ready): Likewise.
	* sel-sched.c (code_motion_process_successors): Likewise.
	* tree-call-cdce.c (gen_conditions_for_pow): Likewise.
	* tree-cfg-cleanup.c (tree_forwarder_block_p): Likewise.
	* tree-flow-inline.h (link_imm_use, move_use_after_head): Likewise.
	(phi_arg_index_from_use, phi_ssa_name_p): Likewise.
	* tree-into-ssa.c (insert_updated_phi_nodes_for): Likewise.
	* tree-ssa-coalesce.c (ssa_conflicts_test_p): Likewise.
	(ssa_conflicts_add): Likewise.
	* tree-ssa-copy.c (replace_exp): Likewise.
	* tree-ssa-dom.c (eliminate_redundant_computations): Likewise.
	* tree-ssa-forwprop.c (simple_gimple_switch): Likewise.
	* tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise.
	* tree-ssa-pre.c (bitmap_value_insert_into_set): Likewise.
	(compute_antic): Likewise.
	* tree-ssa-ter.c (add_to_partition_kill_list): Likewise.
	(add_dependence): Likewise.
	(process_replaceable, kill_expr, find_replaceable_exprs): Likewise.
	* tree-vrp.c (supports_overflow_infinity): Likewise.
	(make_overflow_infinity, negative_overflow_infinity): Likewise.
	(avoid_overflow_infinity, register_new_assert_for): Likewise.
	(process_assert_insertions_for): Likewise.
	* var-tracking.c (dv_is_value_p, dv_as_decl, dv_from_decl): Likewise.
	(dv_from_value, variable_union, find_loc_in_1pdv): Likewise.
	(intersect_loc_chains, variable_merge_over_cur): Likewise.

From-SVN: r165774
2010-10-21 13:08:28 +00:00