Commit Graph

45 Commits

Author SHA1 Message Date
Daniel Berlin 0a05048550 Makefile.def: Remove libbanshee.
Toplevel:

2004-09-09  Daniel Berlin  <dberlin@dberlin.org>

	* Makefile.def: Remove libbanshee.
	* Makefile.tpl: Ditto.
	* configure.in: Ditto.
	* Makefile.in: Regen.
	* configure: Ditto.

gcc/

2004-09-09  Daniel Berlin  <dberlin@dberlin.org>

	* Makefile.in: Remove libbanshee, tree-alias-*.
	Remove tree-alias-common.h dependencies.
	* common.opt: Remove -ftree-points-to.
	* configure.ac: Remove libbanshee.
	* flags.h: Remove pta_type, flag_tree_points_to.
	* gengtype.c (open_base_files): Remove tree-alias-type.h.
	* opts.c (OPT_ftree_points_to): Remove.
	* toplev.c: Remove tree-alias-common.h, flag_tree_points_to.
	* tree-dfa.c: Remove tree-alias-common.h
	* tree-into-ssa.c: Ditto.
	* tree-outof-ssa.c: Ditto.
	* tree-ssa-copyrename.c: Ditto.
	* tree-ssa-live.c: Ditto.
	* tree-optimize.c: Ditto.
	* tree-ssa.c: Ditto.
	Remove pass_build_pta, pass_del_pta.
	* tree-pass.h: Ditto.
	* tree-ssa-alias.c: Remove tree-alias-common.h.
	(struct alias_stats_d):	Remove pta_queries, pta_resolved.
	(pass_may_alias): Remove PROP_pta requirement.
	(may_alias_p): Remove pta_queries, pta_resolved, use of andersens.
	(get_tmt_for): Ditto.
	(dump_alias_stats): Ditto.
	* doc/passes.texi: Remove blurb about points-to analysis.
	* fortran/Make-lang.in: Remove tree-alias-*.o.

From-SVN: r87253
2004-09-09 20:53:41 +00:00
Giovanni Bajo 1e128c5f7b targhooks.c (default_unwind_emit, [...]): Use gcc_assert, gcc_unreachable & internal_error instead of abort.
* targhooks.c (default_unwind_emit, default_scalar_mode_supported_p):
	Use gcc_assert, gcc_unreachable & internal_error instead of abort.
	* timevar.c (timevar_push, timevar_pop, timevar_start,
	timevar_stop): Likewise.
	* toplev.c (default_pch_valid_p): Likewise.
	* tracer.c (tail_duplicate): Likewise.
	* tree-alias-common.c (get_alias_var_decl,
	get_values_from_constructor, create_alias_var, delete_alias_vars,
	empty_points_to_set, same_points_to_set, ptr_may_alias_var):
	Likewise.
	* tree.c (tree_size, make_node_stat, copy_node_stat,
	build_int_cst_wide, integer_all_onesp, list_length, chainon,
	tree_node_structure, type_contains_placeholder_p, substitute_in_expr,
	substitute_placeholder_in_expr, tabilize_reference_1, build0_stat,
	build1_stat, build2_stat, build3_stat, build4_stat, is_attribute_p,
	lookup_attribute, type_hash_canon, host_integerp, iterative_hash_expr,
	build_method_type_directly, decl_type_context, get_callee_fndecl,
	get_set_constructor_bits, build_vector_type_for_mode, int_cst_value,
	tree_fold_gcd): Likewise.
	* tree-cfg.c (create_bb, make_ctrl_stmt_edges, make_exit_edges,
	make_cond_expr_edges, group_case_labels, tree_merge_blocks,
	cleanup_control_expr_graph, find_taken_edge,
	find_taken_edge_switch_expr, phi_alternatives_equal,
	is_ctrl_altering_stmt, disband_implicit_edges, set_bb_for_stmt,
	stmt_for_bsi, tree_find_edge_insert_loc, bsi_insert_on_edge_immediate,
	tree_split_edge, tree_verify_flow_info, thread_jumps,
	tree_redirect_edge_and_branch, tree_flow_call_edges_add): Likewise.
	* tree-chrec.c (chrec_fold_poly_cst, chrec_fold_plus_poly_poly,
	chrec_fold_multiply_poly_poly): Likewise.
	* tree-complex.c (extract_component, expand_complex_division,
	expand_complex_comparison, expand_complex_operations_1,
	build_replicated_const, expand_vector_operations_1): Likewise.
	* tree-data-ref.c (tree_fold_bezout, build_classic_dist_vector,
	build_classic_dir_vector): Likewise.
	* tree-dfa.c (compute_immediate_uses_for_phi,
	compute_immediate_uses_for_stmt, create_var_ann, create_stmt_ann,
	create_tree_ann, collect_dfa_stats, get_virtual_var): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* tree-eh.c (record_stmt_eh_region, add_stmt_to_eh_region,
	record_in_finally_tree, replace_goto_queue_1,
	maybe_record_in_goto_queue, verify_norecord_switch_expr,
	do_return_redirection): Likewise.
	* tree-if-conv.c (tree_if_convert_stmt, tree_if_convert_cond_expr,
	add_to_dst_predicate_list, find_phi_replacement_condition,
	replace_phi_with_cond_modify_expr, get_loop_body_in_if_conv_order):
	Likewise.
	* tree-inline.c (remap_decl, remap_type, remap_decls, copy_body_r,
	initialize_inlined_parameters, declare_return_variable,
	estimate_num_insns_1, expand_call_inline, expand_calls_inline,
	optimize_inline_calls, copy_tree_r): Likewise.
	* tree-into-ssa.c (rewrite_initialize_block_local_data, rewrite_stmt,
	ssa_rewrite_stmt, rewrite_into_ssa): Likewise.
	* tree-iterator.c (alloc_stmt_list, tsi_link_before, tsi_link_after,
	tsi_split_statement_list_after, tsi_split_statement_list_before):
	Likewise.
	* tree-mudflap.c (mf_varname_tree): Likewise.
	* tree-nested.c (create_tmp_var_for, lookup_field_for_decl,
	lookup_tramp_for_decl, convert_all_function_calls): Likewise.
	* tree-optimize.c (tree_rest_of_compilation): Likewise.
	* tree-outof-ssa.c (create_temp, eliminate_build, eliminate_phi,
	coalesce_abnormal_edges, coalesce_ssa_name, eliminate_virtual_phis,
	free_temp_expr_table, add_dependance, finish_expr, rewrite_trees):
	Likewise.
	* tree-phinodes.c (resize_phi_node, add_phi_arg,
	remove_all_phi_nodes_for): Likewise.
	* tree-pretty-print.c (op_prio, print_call_name): Likewise.
	* tree-profile.c (tree_gen_interval_profiler, tree_gen_pow2_profiler,
	tree_gen_one_value_profiler, tree_gen_const_delta_profiler): Likewise.
	* tree-sra.c (type_can_instantiate_all_elements, sra_hash_tree,
	sra_elt_eq, sra_walk_expr, instantiate_missing_elements,
	generate_one_element_ref, generate_element_copy,
	generate_element_zero, scalarize_copy, scalarize_init,
	scalarize_ldst): Likewise.
	* tree-ssa-alias.c (delete_alias_info, group_aliases, may_alias_p,
	add_may_alias, add_pointed_to_expr, add_pointed_to_var,
	collect_points_to_info_r, get_tmt_for, get_ptr_info): Likewise.
	* tree-ssa.c (walk_use_def_chains, check_phi_redundancy): Likewise.
	* tree-ssa-ccp.c (dump_lattice_value, get_default_value, get_value,
	set_lattice_value, likely_value, ccp_visit_phi_node, visit_assignment,
	widen_bitfield, ccp_fold_builtin): Likewise.
	* tree-ssa-copy.c (may_propagate_copy, merge_alias_info,
	replace_exp_1, propagate_tree_value): Likewise.
	* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise.
	* tree-ssa-dce.c (set_control_dependence_map_bit,
	find_control_dependence, find_pdom, mark_operand_necessary,
	mark_stmt_if_obviously_necessary,
	mark_control_dependent_edges_necessary, remove_dead_stmt): Likewise.
	* tree-ssa-dom.c (dom_opt_initialize_block_local_data,
	simplify_switch_and_lookup_avail_expr, cprop_into_successor_phis,
	eliminate_redundant_computations, avail_expr_eq): Likewise.
	* tree-ssa-dse.c (fix_stmt_v_may_defs): Likewise.
	* tree-ssa-loop-ch.c (should_duplicate_loop_header_p,
	duplicate_blocks): Likewise.
	* tree-ssa-loop-im.c (for_each_index, set_level,
	is_call_clobbered_ref): Likewise.
	* tree-ssa-loop-ivopts.c (dump_use, divide, stmt_after_ip_normal_pos,
	stmt_after_increment, set_iv, contains_abnormal_ssa_name_p,
	find_interesting_uses_outer_or_nonlin, add_derived_ivs_candidates,
	peel_address, ptr_difference_cost, may_replace_final_value,
	determine_use_iv_cost, rewrite_use_nonlinear_expr, rewrite_use_outer,
	rewrite_use, rewrite_uses): Likewise.
	* tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa,
	check_loop_closed_ssa_use): Likewise.
	* tree-ssanames.c (make_ssa_name): Likewise.
	* tree-ssa-operands.c (finalize_ssa_defs, finalize_ssa_uses,
	finalize_ssa_v_must_defs, finalize_ssa_stmt_operands,
	get_stmt_operands, get_expr_operands, get_asm_expr_operands,
	get_indirect_ref_operands, add_stmt_operand): Likewise.
	* tree-ssa-pre.c (value_exists_in_set_bitmap,
	value_remove_from_set_bitmap, bitmap_insert_into_set, insert_into_set,
	phi_translate, valid_in_set, compute_antic,
	find_or_generate_expression, create_expression_by_pieces, insert_aux,
	create_value_expr_from, eliminate): Likewise.
	* tree-ssa-propagate.c (cfg_blocks_get): Likewise.
	* tree-ssa-threadupdate.c (remove_last_stmt_and_useless_edges):
	Likewise.
	* tree-tailcall.c (independent_of_stmt_p, adjust_return_value,
	eliminate_tail_call): Likewise.
	* tree-vectorizer.c (vect_create_index_for_array_ref,
	vect_align_data_ref, vect_create_data_ref,
	vect_create_destination_var, vect_get_vec_def_for_operand,
	vect_finish_stmt_generation, vect_transform_stmt,
	vect_transform_loop_bound, vect_transform_loop,
	vect_analyze_operations): Likewise.
	* tree-vn.c (vn_compute, set_value_handle, get_value_handle):
	Likewise.
	* tree-flow-inline.h (var_ann, get_var_ann, get_def_from_ptr,
	get_use_op_ptr, immediate_use, phi_ssa_name_p, bsi_start,
	bsi_after_labels, bsi_last): Likewise.
	* tree-ssa-live.c (var_union, change_partition_var,
	create_ssa_var_map, calculate_live_on_entry, root_var_init,
	type_var_init, add_coalesce, sort_coalesce_list, pop_best_coalesce):
	Likewise.
	* tree-ssa-live.h (partition_is_global, live_entry_blocks,
	tpa_find_tree): Likewise.
	(register_ssa_partition_check): Declare.
	(register_ssa_partition): use it.
	* tree-ssa-live.c: Include errors.h.
	(register_ssa_partition_check): New.
	* tree-ssa-operands.c: Include errors.h.
	* Makefile.in (tree-ssa-operands.o): Depend on errors.h.

Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>

From-SVN: r87223
2004-09-09 07:54:12 +00:00
Daniel Berlin 599eabdb42 Makefile.in (tree-loop-linear.o): Added.
2004-09-08  Daniel Berlin  <dberlin@dberlin.org>

	* Makefile.in (tree-loop-linear.o): Added.
	(OBJS-common): Add tree-loop-linear.o
	* common.opt: New flag, ftree-loop-linear.
	* timevar.def: New timevar, TV_TREE_LOOP_LINEAR.
	* tree-flow.h: Add prototype for linear_transform_loops.
	* tree-optimize.c: Add linear transform after vectorization.
	* tree-pass.h: Add struct pass_linear_transform.
	* tree-ssa-loop.c: Add pass_linear_transform.
	* tree-loop-linear.c: New file.
	* lambda-code.c: gcc_assertify.
	(gcc_loop_to_lambda_loop): Handle all exit tests.
	Handle case where we have (invariant >= induction var).
	(find_induction_var_from_exit_cond): Ditto.

From-SVN: r87190
2004-09-08 15:28:56 +00:00
Jan Hubicka 8948052222 cgraph.c (cgraph_remove_node): Free DECL_INITIAL field of node.
* cgraph.c (cgraph_remove_node): Free DECL_INITIAL field of node.
	* cgraphunit.c (verify_cgraph): Don't verify on syntax errors.
	(cgraph_expand_function): Remove stale cgraph edges of currently
	compiled function; fix non-unit-at-a-time code copying function
	node for later reuse.

From-SVN: r87181
2004-09-08 09:28:06 +00:00
Paolo Bonzini 9f8628bacd Unify the management of RTL and tree-level dump files.
2004-09-06  Paolo Bonzini  <bonzini@gnu.org>

	Unify the management of RTL and tree-level dump files.

	* cfgexpand.c (tree_expand_cfg): Fix incorrect comment.
	Don't print function name to the dump file, the pass manager
	would do this for us. Add code from the top of
	rest_of_compilation, up to the initial RTL dump.
	* passes.c (rest_of_handle_jump): Call fixup_tail_calls and
	close the DFI_sibling dump file.
	(rest_of_compilation): Don't do that here.  Remove code up to the
	initial RTL dump.
	(init_optimization_passes): Remove.
	(pass_rest_of_compilation): Change pass name to NULL.
	* toplev.c (lang_dependent_init): Do not use an empty dump file prefix.
	Do not call init_optimization_passes.
	* toplev.h (init_optimization_passes): Remove.

	* graph.c (print_rtl_graph_with_bb, clean_graph_dump_file,
	finish_graph_dump_file): Remove SUFFIX parameter.
	* graph.h (print_rtl_graph_with_bb, clean_graph_dump_file,
	finish_graph_dump_file): Likewise.

	* tree-pass.h (struct tree_opt_pass): Add `letter' field.
	* cfgexpand.c (pass_expand): Adjust.
	* gimple-low.c (pass_lower_cf, pass_remove_useless_vars): Adjust.
	* passes.c (pass_rest_of_compilation): Adjust.
	* predict.c (pass_profile): Adjust.
	* tree-alias-common.c (pass_build_pta, pass_del_pta): Adjust.
	* tree-cfg.c (pass_build_cfg, pass_remove_useless_stmts,
	pass_split_crit_edges, pass_warn_function_return): Adjust.
	* tree-complex.c (pass_lower_vector_ssa, pass_pre_expand): Adjust.
	* tree-dfa.c (pass_referenced_vars): Adjust.
	* tree-eh.c (pass_lower_eh): Adjust.
	* tree-if-conv.c (pass_build_ssa): Adjust.
	* tree-into-ssa.c (pass_build_ssa): Adjust.
	* tree-mudflap.c (pass_mudflap_1, pass_mudflap_2): Adjust.
	* tree-nomudflap.c (pass_mudflap_1, pass_mudflap_2): Adjust.
	* tree-nrv.c (pass_nrv): Adjust.
	* tree-optimize.c (pass_gimple, pass_all_optimizations,
	pass_cleanup_cfg_post_optimizing, pass_free_datastructures,
	pass_init_datastructures): Adjust.
	* tree-outof-ssa.c (pass_del_ssa): Adjust.
	* tree-profile.c (pass_tree_profile): Adjust.
	* tree-sra.c (pass_sra): Adjust.
	* tree-ssa-alias.c (pass_may_alias): Adjust.
	* tree-ssa-ccp.c (pass_ccp, pass_fold_builtins): Adjust.
	* tree-ssa-copyrename.c (pass_rename_ssa_copies): Adjust.
	* tree-ssa-dce.c (pass_dce, pass_cd_dce): Adjust.
	* tree-ssa-dom.c (pass_dominator): Adjust.
	* tree-ssa-dse.c (pass_dse): Adjust.
	* tree-ssa-forwprop.c (pass_forwprop): Adjust.
	* tree-ssa-if-conv.c (pass_if_conversion): Adjust.
	* tree-ssa-loop-ch.c (pass_ch): Adjust.
	* tree-ssa-loop.c (pass_loop, pass_loop_init, pass_lim,
	pass_loop_done, pass_complete_unroll, pass_iv_canon,
	pass_iv_optimize, pass_vectorize): Adjust.
	* tree-ssa-phiopt.c (pass_phiopt): Adjust.
	* tree-ssa-pre.c (pass_pre, pass_fre): Adjust.
	* tree-ssa.c (pass_redundant_phi, pass_early_warn_uninitialized,
	pass_late_warn_uninnitialized): Adjust.
	* tree-tailcall.c (pass_tail_recursion, pass_tail_calls): Adjust.

	* Makefile.in (tree-dump.o): Add new dependencies.
	* cgraph.c (cgraph_remove_node): TDF_all -> TDF_tree_all.
	* cgraphunit.c (cgraph_preserve_function_body_p, cgraph_optimize):
	Likewise.
	* toplev.c (dump_file_name): New.
	* tree-dump.c (dump_enable_all): Add LETTER parameter.
	(struct dump_file_info): Add NUM and LETTER fields.
	(dump_files): Adjust and add RTL dump files.
	(dump_register): Add NUM and LETTER fields.
	(get_dump_file_name, dump_initialized_p, enable_rtl_dump_file): New.
	(dump_begin): Use get_dump_file_name.
	(dump_switch_p_1): Adjust call to dump_enable_all.
	* tree-dump.h (dump_register): Adjust prototype.
	* tree-optimize.c (register_one_dump_file): Take dump file index.
	Support flags for RTL dumps.
	(register_dump_files): Fill in NUM field of struct dump_file_info.
	Track properties both when the gate is executed and when it is not.
	(execute_todo): Dump RTL.  Add PROPERTIES parameter.
	(execute_one_pass): Pass properties to execute_todo.  Handle VCG
	dumps of RTL.
	* tree-pass.h (dump_file_name): New.
	* tree.h (TDF_TREE, TDF_RTL, get_dump_file_name, dump_initialized_p):
	New.

	* Makefile.in (passes.o): Add new dependencies.
	* passes.c (struct dump_file_info, enum dump_file_index,
	dump_file_tbl, init_optimization_passes): Remove.
	(open_dump_file, close_dump_file): Use tree-dumping infrastructure.
	(rest_of_handle_new_regalloc, rest_of_handle_old_regalloc): Use
	dump_enabled_p.
	(finish_optimization_passes): Update finish_graph_dump_file loop.
	(enable_rtl_dump_file): Remove.
	* tree-dump.c (dump_files): Adjust and add RTL dump files.
	(enable_rtl_dump_file): Add here.
	* tree.h (enum tree_dump_index): Add RTL dump file indices.
	* doc/invoke.texi (Debugging options): Document new RTL debugging
	options.  Update.

From-SVN: r87113
2004-09-06 10:08:17 +00:00
Kazu Hirata 8c27b7d4d1 c-common.c, [...]: Fix comment formatting.
* c-common.c, c-decl.c, combine.c, defaults.h, fold-const.c,
	gimplify.c, gthr-nks.h, hooks.c, lambda-code.c, lambda-mat.c,
	stor-layout.c, target.h, tree-cfg.c, tree-chrec.c,
	tree-if-conv.c, tree-inline.c, tree-into-ssa.c,
	tree-mudflap.c, tree-optimize.c, tree-scalar-evolution.c,
	tree-ssa-alias.c, tree-ssa-ccp.c, tree-ssa-dce.c,
	tree-ssa-pre.c, tree-vectorizer.c, tree-vectorizer.h, tree.h,
	vec.h: Fix comment formatting.

From-SVN: r87105
2004-09-05 16:05:06 +00:00
Zdenek Dvorak 8b11a64cd9 tree-ssa-loop-ivopts.c: New file.
* tree-ssa-loop-ivopts.c: New file.
	* Makefile.in (tree-ssa-loop-ivopts.c): Add.
	* cfgloop.h (target_avail_regs, target_res_regs, target_small_cost,
	target_pres_cost, target_spill_cost): Declare.
	* cfgloopanal.c (avail_regs, res_regs, small_cost, pres_cost,
	spill_cost): Renamed to ...
	(target_avail_regs, target_res_regs, target_small_cost,
	target_pres_cost, target_spill_cost): ... and exported.
	(init_set_costs, global_cost_for_size): Work with renamed variables.
	* common.opt (flag_ivopts): New flag.
	* expr.c (expand_expr_real_1): Handle SSA_NAME case.  Handle
	REF_ORIGINAL.
	* gimplify.c (struct gimplify_ctx): Add into_ssa field.
	(internal_get_tmp_var, gimplify_modify_expr, gimplify_expr): Support
	generating SSA form.
	(force_gimple_operand): New function.
	* timevar.def (TV_TREE_LOOP_IVOPTS): New timevar.
	* tree-cfg.c (stmt_bsi): New function.
	* params.def (PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND,
	PARAM_IV_MAX_CONSIDERED_USES): New.
	* tree-flow.h (stmt_bsi, tree_ssa_iv_optimize, split_loop_exit_edge,
	bsi_insert_on_edge_immediate_loop. standard_iv_increment_position,
	ip_end_pos, ip_normal_pos, force_gimple_operand): Declare.
	* tree-gimple.c (is_gimple_formal_tmp_var): Accept ssa names.
	* tree-nested.c (build_addr): Export.
	* tree-optimize.c (init_tree_optimization_passes): Add
	pass_iv_optimize.
	* tree-pass.h (pass_iv_optimize): Declare.
	* tree-ssa-loop-im.c (for_each_index): Handle REALPART_EXPR and
	IMAGPART_EXPR.
	* tree-ssa-loop-manip.c (create_iv): Force the base to be acceptable
	as a phi node argument.
	(split_loop_exit_edge, bsi_insert_on_edge_immediate_loop,
	ip_end_pos, ip_normal_pos, standard_iv_increment_position): New
	functions.
	* tree-ssa-loop-niter.c (zero_p, unsigned_type_for): Export.
	* tree-ssa-loop.c (tree_ssa_loop_ivopts, gate_tree_ssa_loop_ivopts,
	pass_iv_optimize): New pass.
	* tree-ssa-operands.c (get_indirect_ref_operands): Handle REF_ORIGINAL.
	* tree-ssanames.c (release_ssa_name): Allow calling with var = NULL.
	* tree.c (build_int_cst_type, cst_and_fits_in_hwi): New functions.
	* tree.h (REF_ORIGINAL): New macro.
	(build_int_cst_type, unsigned_type_for, zero_p,
	cst_and_fits_in_hwi, build_addr): Declare.
	* doc/invoke.texi (-fivopts): Document.
	(PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND,
	PARAM_IV_MAX_CONSIDERED_USES): Document.
	* doc/passes.texi: Document induction variable optimizations pass.

	* gcc.dg/tree-ssa/loop-2.c: New test.
	* gcc.dg/tree-ssa/loop-3.c: New test.
	* gcc.dg/tree-ssa/loop-4.c: New test.
	* gcc.dg/tree-ssa/loop-5.c: New test.

From-SVN: r87100
2004-09-05 09:25:37 +00:00
Devang Patel 40923b202d Tree level if-conversion for vectorizer.
* Makefile.in (OBJS-common): Add tree-if-conv.o
        (tree-if-conv.o): New rule.
        * cfgloop.c (flow_loop_exit_edges_find): Set EDGE_LOOP_EXIT flag.
        (get_loop_body_in_bfs_order): New.
        * cfgloop.h (get_loop_body_in_bfs_order): New.
        * tree-flow.h (enum move_pos): Move here from ..
        * tree-ssa-loop-im.c (enum move_pos): here.
        (movement_possibility): Make externally visible.
        * tree-optimize.c (init_tree_optimization_passes): New entry for
        if conversion pass.
        * tree-pass.h (pass_if_conversion): New.
        * tree-ssa-operands.c (get_expr_operands): Handle COND_EXPR.
        * tree-if-conv.c: New file.
        * doc/passes.texi: Document tree if-conversion pass.
        * doc/tree-ssa.texi: Same.

        testsuite:

        * gcc.dg/tree-ssa/ifc-20040816-1.c: New test.
        * gcc.dg/tree-ssa/ifc-20040816-2.c: New test.

From-SVN: r87073
2004-09-03 20:27:01 -07:00
Zdenek Dvorak 82b85a85c8 tree-ssa-loop-ivcanon.c: New file.
* tree-ssa-loop-ivcanon.c: New file.
	* tree-ssa-loop-manip.c (create_iv): New function.
	* Makefile.in (tree-ssa-loop-ivcanon.o): Add.
	(tree-ssa-loop.o, tree-ssa-loop-manip.o): Add SCEV_H dependency.
	* cfgloop.c (mark_single_exit_loops): New function.
	(verify_loop_structure): Verify single-exit loops.
	* cfgloop.h (struct loop): Add single_exit field.
	(LOOPS_HAVE_MARKED_SINGLE_EXITS): New constant.
	(mark_single_exit_loops): Declare.
	(tree_num_loop_insns): Declare.
	* cfgloopmanip.c (update_single_exits_after_duplication): New function.
	(duplicate_loop_to_header_edge): Use it.
	* common.opt (fivcanon): New flag.
	* timevar.def (TV_TREE_LOOP_IVCANON, TV_COMPLETE_UNROLL): New timevars.
	* tree-cfg.c (tree_find_edge_insert_loc): Return newly created block.
	(bsi_commit_edge_inserts_1): Pass null to tree_find_edge_insert_loc.
	(bsi_insert_on_edge_immediate): New function.
	* tree-flow.h (bsi_insert_on_edge_immediate,
	canonicalize_induction_variables, tree_unroll_loops_completely,
	create_iv): Declare.
	* tree-optimize.c (init_tree_optimization_passes): Add
	pass_iv_canon and pass_complete_unroll.
	* tree-pass.h (pass_iv_canon, pass_complete_unroll): Declare.
	* tree-scalar-evolution.c (get_loop_exit_condition,
	get_exit_conditions_rec, number_of_iterations_in_loop,
	scev_initialize): Use single_exit information.
	* tree-ssa-loop-niter.c (number_of_iterations_cond): Record
	missing assumptions.
	(loop_niter_by_eval):  Return number of iterations as unsigned
	int.
	* tree-ssa-loop.c (tree_ssa_loop_init): Mark single exit loops.
	(tree_ssa_loop_ivcanon, gate_tree_ssa_loop_ivcanon, pass_iv_canon,
	tree_complete_unroll, gate_tree_complete_unroll, pass_complete_unroll):
	New passes.
	(tree_ssa_loop_done): Call free_numbers_of_iterations_estimates.
	* tree-ssanames.c (make_ssa_name): Allow creating ssa name before
	the defining statement is ready.
	* tree-vectorizer.c (vect_create_iv_simple): Removed.
	(vect_create_index_for_array_ref, vect_transform_loop_bound):
	Use create_iv.
	(vect_transform_loop_bound): Use single_exit information.
	(vect_analyze_loop_form): Cleanup bogus tests.
	(vectorize_loops): Do not call flow_loop_scan.
	* tree.h (may_negate_without_overflow_p): Declare.
	* fold-const.c (may_negate_without_overflow_p): Split out from ...
	(negate_expr_p): ... this function.
	(tree_expr_nonzero_p): Handle overflowed constants correctly.
	* doc/invoke.texi (-fivcanon): Document.
	* doc/passes.texi: Document canonical induction variable creation.

	* gcc.dg/tree-ssa/loop-1.c: New test.

From-SVN: r86516
2004-08-24 20:48:23 +00:00
Dorit Naishlos 79fe1b3bd0 tree-vectorizer.c: New File: loop vectorization on SSAed GIMPLE trees.
* tree-vectorizer.c: New File: loop vectorization on SSAed GIMPLE trees.
        * tree-vectorizer.h: New File: Same.
        * Makefile.in (tree-vectorizer.c, tree-vectorizer.h): Add new files.
        * common.opt (ftree-vectorize): New flag to enable vectorization.
        * timevar.def (TV_TREE_VECTORIZATION): New dump file for vectorization
        pass.
        * tree-data-ref.h (init_data_ref): Additional argument.
        (array_base_name_differ_p): Moved to tree-data-ref.c.
        * tree-data-ref.c (array_base_name_differ_p): Revised.
        (initialize_data_dependence_relation): Call array_base_name_differ_p
        with an extra argument.
        (analyze_all_data_dependences): Same.
        (init_data_ref): Additional argument is_read to set DR_IS_READ.
        * tree-ssa-phiopt.c (empty_block_p): Expose for usage out of this file.
        * tree-flow.h (vectorize_loops, empty_block_p): Add declaration.
        * tree-optimize.c (pass_vectorize): Schedule the vectorization pass.
        * tree-pass.h (tree_opt_pass pass_vectorize): Declare the new
        vectorization pass.
        * tree-ssa-loop.c (tree_ssa_loop_init): Call scev_initialize.
        (tree_ssa_loop_done): Call scev_finalize.
        (tree_vectorize): Define the new vectorization pass.
        * defaults.h (UNITS_PER_SIMD_WORD): Allow targets to specify the size of
        the vector they support (until support for multiple vector sizes is
        added to the vectorizer).
        * config/i386/i386.h (UNITS_PER_SIMD_WORD): Define.
        * config/rs6000/rs6000.h (UNITS_PER_SIMD_WORD): Define.
        * invoke.texi (fdump-tree-vect, ftree-vectorize): Add
        documentation.

From-SVN: r86131
2004-08-17 16:17:14 +00:00
Diego Novillo c1b763fa9a tree-optimize.c (init_tree_optimization_passes): Schedule pass_may_alias right after the program is renamed into SSA.
* tree-optimize.c (init_tree_optimization_passes): Schedule
	pass_may_alias right after the program is renamed into SSA.
	* tree-pass.h (PROP_alias): Define.
	* tree-outof-ssa.c (pass_del_ssa): Require PROP_alias.
	* tree-sra.c (pass_sra): Likewise.
	* tree-ssa-ccp.c (pass_ccp): Likewise.
	* tree-ssa-copyrename.c (pass_rename_ssa_ccp): Likewise.
	* tree-ssa-dce.c (pass_dce): Likewise.
	* tree-ssa-dom.c (pass_dominator): Likewise.
	* tree-ssa-dse.c (pass_dse): Likewise.
	* tree-ssa-forwprop.c (pass_forwprop): Likewise.
	* tree-ssa-loop-ch.c (pass_ch): Likewise.
	* tree-ssa-phiopt.c (pass_phiopt): Likewise.
	* tree-ssa-pre.c (pass_pre): Likewise.
	* tree-tailcall.c (pass_tail_recursion): Likewise.
	* tree-ssa.c (pass_redundant_phi): Likewise.
	* tree-ssa-alias.c (aliases_computed_p): Remove.
	Update all users.
	(init_alias_info): Do not mark all type tags for renaming
	unconditionally.
	Clear may_aliases from every symbol.
	(setup_pointers_and_addressables): If a pointer has not been
	dereferenced and it had a type tag, clear it and mark the old
	tag for renaming.


testsuite/ChangeLog

	* gcc.dg/tree-ssa/20030714-2.c: Adjust number of expected
	conditionals.
	* gcc.dg/tree-ssa/20031022-1.c: Adjust number of expected
	loads.
	* gcc.dg/tree-ssa/ssa-dom-cse-1.c: Expect optimization in
	DOM1.

From-SVN: r85255
2004-07-28 01:13:10 -04:00
Richard Kenner 1a837f7746 re PR tree-optimization/15077 (ICE in make_decl_rtl when inlining tail recursive nested function)
PR optimization/15077
	* function.h (struct function): Add field saved_static_chain_decl.
	Fix comment for static_chain_decl.
	* tree-inline.c (save_body): Add new arg and handle static_chain_decl.
	* tree-inline.h (save_body): Add new arg.
	* tree-optimize.c (tree_rest_of_compilation): Handle saving
	static_chain_decl.

From-SVN: r85247
2004-07-27 22:27:20 -04:00
Brian Booth b3fade8399 tree-optimize.c (register_one_dump_file): Update condition that uses static_pass_number.
* tree-optimize.c (register_one_dump_file): Update condition that uses
	static_pass_number.
	(dup_pass_1): Replace with...
	(next_pass_1): This.
	(NEXT_PASS): Call next_pass_1.
	(DUP_PASS): Remove.
	(init_tree_optimization_passes): Remove uses of DUP_PASS.
	(execute_one_pass): Update condition that uses
	static_pass_number.
	* tree-pass.h (tree_opt_pass): Declare static_pass_number as a signed
	integer.

From-SVN: r85226
2004-07-27 18:32:50 +00:00
Paolo Bonzini 26277d4179 tree-cfg.c (gimplify_val): Move from tree-complex.c.
2004-07-22  Paolo Bonzini  <bonzini@gnu.org>

	* tree-cfg.c (gimplify_val): Move from tree-complex.c.
	(gimplify_build1): Move from tree-complex.c do_unop.
	(gimplify_build2): Move from tree-complex.c do_binop.
	(gimplify_build3): New.
	* tree-complex.c (gimplify_val, do_unop, do_binop): Remove.
	Adjust throughout to call the functions above.
	* tree-flow.h: Declare the functions above.
	* tree-nested.c (gimplify_val): Rename to...
	(tsi_gimplify_val): ... this.

	* Makefile.in (tree_complex.o): Update dependencies.
	(stor-layout.o): Depend on regs.h.
	* c-common.c (handle_vector_size_attribute): Update for
	vector types without corresponding vector modes.
	* expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if
	a corresponding vector mode is not available.
	* print-tree.c (print_node): Print nunits for vector types
	* regclass.c (have_regs_of_mode): New.
	(init_reg_sets_1): Initialize it and use it instead
	of allocatable_regs_of_mode.
	* regs.h (have_regs_of_mode): Declare it.
	* stor-layout.c (layout_type): Pick a mode for vector types.
	* tree-complex.c (build_word_mode_vector_type, tree_vec_extract,
	build_replicated_const, do_unop, do_binop, do_plus_minus,
	do_negate, expand_vector_piecewise, expand_vector_parallel,
	expand_vector_addition, expand_vector_operations_1,
	expand_vector_operations, tree_lower_operations,
	pass_lower_vector_ssa, pass_pre_expand): New.
	(expand_complex_operations, pass_lower_complex): Remove.
	* tree-optimize.c (init_tree_optimization_passes): Adjust
	pass ordering for changes in tree-complex.c.
	* tree-pass.h: Declare new passes.
	* tree.c (finish_vector_type): Remove.
	(make_vector_type): New.
	(build_vector_type_for_mode, build_vector_type): Rewritten.
	* tree.def (VECTOR_TYPE): Document where the number of
	subparts is stored.
	* tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field.
	(make_vector): Remove declaration.

From-SVN: r85039
2004-07-22 08:20:40 +00:00
Steven Bosscher 165b54c3f3 cfgcleanup.c (try_simplify_condjump): Don't remove line notes to avoid unreachable code warnings.
* cfgcleanup.c (try_simplify_condjump): Don't remove line
	notes to avoid unreachable code warnings.
	* toplev.c (backend_init): Don't emit line notes for
	unreachable code warnings.

	* combine.c (distribute_notes): Don't distribute a
	REG_VTABLE_REF note.
	* final.c (final_scan_insn): Don't handle it.
	* rtl.c (reg_note_name): Remove it.
	* rtl.h (enum reg_node): Dito.

	* emit-rtl.c (force_line_numbers, restore_line_number_status):
	Remove.
	* rtl.h (force_line_numbers, restore_line_number_status):
	Remove prototypes.

	* stmt.c (using_eh_for_cleanups_p, using_eh_for_cleanups): Move...
	* tree-eh.c (using_eh_for_cleanups_p): ...here.  Make static.
	(using_eh_for_cleanups): Also moved here.

	* expr.c (expand_expr_real_1) <CASE_LABEL_EXPR>: Die if we see one.
	<SWITCH_EXPR>: Die if we have a non-NULL SWITCH_BODY.  Update calls
	to expand_start_case and add_case_node.
	* stmt.c (struct nesting): Cleanup unused fields condition_code,
	last_unconditional_cleanup, nominal_type, printname, and
	line_number_status.
	(struct fixup_goto): Remove.
	(struct stmt_status): Remove x_goto_fixup_chain field.
	(goto_fixup_chain): Remove.
	(strip_default_case_nodes, group_case_nodes, emit_jump_if_reachable,
	pushcase, pushcase_range): Remove.
	(expand_start_bindings_and_block): Don't set unused fields in
	the nesting stack.
	(expand_start_case, add_case_node): Cleanup unused formal arguments.
	(expand_end_case_type): Don't simplify the case-list.  Use emit_jump
	instead of emit_jump_if_reachable.
	(emit_case_nodes): Likewise.
	* tree-cfg.c (group_case_labels, cleanup_dead_labels): No longer
	static.
	(update_eh_label): Work around left-over exception handing regions.
	* tree-flow.h (group_case_labels, cleanup_dead_labels): Add protos.
	* tree-optimize.c (execute_cleanup_cfg_post_optimizing): New function.
	(pass_cleanup_cfg_post_optimizing): New pass.
	(init_tree_optimization_passes): Run the new pass after all
	optimizations.
	* tree.h (pushcase, pushcase_range): Remove prototypes.
	(expand_start_case, add_case_node): Update prototypes.

cp/
	* cp-tree.h (struct lang_type): Don't have three GTY options on a
	single bit GTY desc.

java/
	* parse.y (java_complete_expand_methods, java_expand_classes): Don't
	abuse restore_line_number_status.

From-SVN: r84849
2004-07-17 00:31:15 +00:00
Diego Novillo 2aaf3dd5b4 tree-optimize.c (execute_todo): Flush DUMP_FILE before verification.
* tree-optimize.c (execute_todo): Flush DUMP_FILE before
	verification.

From-SVN: r84639
2004-07-13 16:39:09 -04:00
Paolo Bonzini 55e99d5226 re PR tree-optimization/14107 (Return warnings don't work without optimizations enabled)
gcc/ChangeLog:
2004-06-29  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/14107
	* gimplify.c (gimplify_return_expr): Accept a
	RETURN_EXPR with an error argument.
	* tree-optimize.c (init_tree_optimization_passes):
	Run pass_warn_function_return at -O0.

gcc/cp/ChangeLog:
2004-06-29  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/14107
	* decl.c (finish_function): Remove temporary band-aid.

From-SVN: r84550
2004-07-12 06:56:45 +00:00
Zdenek Dvorak a7e5372d6a tree-ssa-loop-im.c: New file.
* tree-ssa-loop-im.c: New file.
	* Makefile.in (tree-ssa-loop-im.o): Add.
	* cfgloop.c (superloop_at_depth): New function.
	* cfgloop.h (superloop_at_depth): Declare.
	* common.opt (ftree-lim): New flag.
	* expr.c (array_ref_up_bound): New function.
	* params.def (PARAM_LIM_EXPENSIVE): New parameter.
	* timevar.def (TV_LIM): New timevar.
	* tree-dfa.c (compute_immediate_uses): Respect TDFA_USE flags when
	computing immediate uses of a phi node.
	* tree-flow.h (struct tree_ann_common_d): Add aux field.
	(loop_commit_inserts, for_each_index, tree_ssa_lim): Declare.
	* tree-optimize.c (init_tree_optimization_passes): Add pass_lim.
	* tree-pass.h (pass_lim): Declare.
	* tree-ssa-loop.c (tree_ssa_loop_im, gate_tree_ssa_loop_im): New
	functions.
	(pass_lim): New pass structure.
	* tree-eh.c (tree_could_trap_p): Handle ARRAY_REFs correctly.
	* tree.c (in_array_bounds_p): New function.
	* tree.h (TREE_THIS_NOTRAP): Define also for ARRAY_REFs.
	(in_array_bounds_p, array_ref_up_bound): Declare.
	* doc/invoke.texi (-ftree-lim, --param lim-expensive): Document.
	* doc/passes.texi (tree-ssa-loop-im.c): Document.

From-SVN: r84441
2004-07-10 04:57:58 +00:00
Diego Novillo d8903b30e1 tree-dfa.c (dump_variable): If the variable is a pointer SSA_NAME, also dump its points-to information.
* tree-dfa.c (dump_variable): If the variable is a pointer
	SSA_NAME, also dump its points-to information.
	* tree-flow.h (struct ptr_info_def): Add field
	is_dereferenced.
	(dump_points_to_info_for): Declare.
	(debug_points_to_info_for): Declare.
	* tree-optimize.c (init_tree_optimization_passes): Add a
	second alias analysis pass after DOM2.
	Move pass_del_pta to a later spot.
	* tree-ssa-alias.c (compute_points_to_and_addr_escape): Do not
	create a name tags when we find a dereferenced pointer.  Just
	mark the pointer dereferenced.
	(collect_points_to_info_for): Move code to clear points-to
	information to create_name_tags.
	(create_name_tags): New function.
	(compute_flow_sensitive_aliasing): Call it.
	(setup_pointers_and_addressables): Mark type tags for renaming
	here instead of ...
	(create_memory_tag): ... here.
	(merge_pointed_to_info): Do not merge PT_MALLOC attributes.
	(dump_points_to_info_for): Declare extern.
	(debug_points_to_info_for): New function.

From-SVN: r84377
2004-07-09 11:12:48 -04:00
Richard Henderson 84936f6f88 langhooks-def.h (LANG_HOOKS_GIMPLE_BEFORE_INLINING): Remove.
* langhooks-def.h (LANG_HOOKS_GIMPLE_BEFORE_INLINING): Remove.
        * langhooks.h (struct lang_hooks): Remove gimple_before_inlining.
        * tree-inline.c (copy_body_r, setup_one_parameter,
        initialize_inlined_parameters, expand_call_inline,
        declare_inline_vars): Don't check it.
        (expand_calls_inline): Remove old version, rename new version
        from gimple_expand_calls_inline.
        * tree-optimize.c (execute_gimple): Remove.
        (pass_gimple): Don't run anything.

From-SVN: r84190
2004-07-06 20:19:55 -07:00
Richard Henderson 4025c040c5 function.h (struct function): Remove x_whole_function_mode_p.
* function.h (struct function): Remove x_whole_function_mode_p.
        * c-decl.c (store_parm_decls): Don't set it.
        * tree-optimize.c (tree_rest_of_compilation): Likewise.
        * passes.c (rest_of_compilation): Don't check it.
        * stmt.c (expand_fixup): Likewise.
        * function.c (fixup_var_refs_insn): Remove unused variable.
fortran/
        * trans-decl.c (gfc_generate_function_code): Don't set
        x_whole_function_mode_p.
        (gfc_generate_constructors): Likewise.

From-SVN: r83947
2004-06-30 18:12:19 -07:00
Richard Henderson 6a0bec2ce1 tree.h (immediate_size_expand): Delete.
* tree.h (immediate_size_expand): Delete.
        * stor-layout.c (immediate_size_expand): Delete.
        (variable_size): Don't look at it.
        * c-decl.c (push_parm_decl): Don't frob immediate_size_expand.
        (start_function): Likewise.
        * cfgexpand.c (construct_exit_block): Likewise.
        * function.c (init_function_start, expand_function_end): Likewise.
        * tree-optimize.c (tree_rest_of_compilation): Likewise.
cp/
        * decl.c (start_preparsed_function): Don't set immediate_size_expand.
        * method.c (use_thunk): Likewise.
fortran/
        * trans-decl.c (gfc_generate_function_code): Don't set
        immediate_size_expand.
        (gfc_generate_constructors): Likewise.

From-SVN: r83946
2004-06-30 17:38:38 -07:00
Zdenek Dvorak c66b6c6689 common.opt (ftree-loop-optimize): New flag.
* common.opt (ftree-loop-optimize): New flag.
	* tree-flow.h (kill_redundant_phi_nodes): Declare.
	* tree-optimize.c (init_tree_optimization_passes): Add pass_loop.
	* tree-pass.h (pass_loop_init, pass_loop_done): Declare.
	* tree-ssa-loop.c (current_loops): New variable.
	(tree_loop_optimizer_init, gate_loop, tree_ssa_loop_init,
	tree_ssa_loop_done): New functions.
	(pass_loop, pass_loop_init, pass_loop_done): New passes.
	* tree-ssa.c (kill_redundant_phi_nodes): Export.
	* doc/invoke.texi (-ftree-loop-optimize): Document.

From-SVN: r83933
2004-06-30 21:29:00 +00:00
Zdenek Dvorak 5f240ec46e tree-ssa-loop-ch.c: New file.
* tree-ssa-loop-ch.c: New file.
	* Makefile.in (tree-ssa-loop-ch.o): Add.
	(tree-into-ssa.o): Add GGC_H dependency.
	* tree-cfg.c (tree_duplicate_bb): Copy virtual arguments.
	* tree-flow.h (rewrite_into_ssa): Declaration changed.
	(rewrite_ssa_into_ssa, compute_global_livein, duplicate_ssa_name):
	Declare.
	* tree-into-ssa.c: Include ggc.h.
	(struct def_blocks_d): Add phi_blocks field.
	(struct mark_def_sites_global_data): Add names_to_rename field.
	(struct ssa_name_info): New.
	(compute_global_livein): Export.
	(set_def_block, insert_phi_nodes, mark_def_sites, set_livein_block,
	insert_phi_nodes_1, rewrite_finalize_block, insert_phi_nodes_for,
	register_new_def, get_reaching_def, def_blocks_free,
	get_def_blocks_for, rewrite_into_ssa): Modified to work with
	rewrite_ssa_into_ssa.
	(get_ssa_name_ann, get_phi_state, set_phi_state, get_current_def,
	set_current_def, ssa_mark_def_sites_initialize_block,
	ssa_mark_phi_uses, ssa_mark_def_sites, duplicate_ssa_name,
	ssa_register_new_def, ssa_rewrite_initialize_block,
	ssa_rewrite_phi_arguments, ssa_rewrite_finalize_block,
	ssa_rewrite_stmt, rewrite_ssa_into_ssa, rewrite_all_into_ssa): New
	functions.
	(pass_build_ssa): Call rewrite_all_into_ssa.
	* tree-optimize.c (execute_todo, execute_one_pass,
	tree_rest_of_compilation): Allocate vars_to_rename only once.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Provide parameter
	to rewrite_into_ssa.
	* tree-ssa-loop.c (should_duplicate_loop_header_p,
	mark_defs_for_rewrite, duplicate_blocks, do_while_loop_p,
	copy_loop_headers, gate_ch, pass_ch): Moved to tree-ssa-loop-ch.c.
	Use rewrite_ssa_into_ssa.
	* tree-ssa-operands.c (copy_virtual_operands): New function.
	* tree-ssa-operands.h (copy_virtual_operands): Declare.
	* tree.h (struct tree_ssa_name): Add aux field.
	(SSA_NAME_AUX): New macro to access it.

From-SVN: r83932
2004-06-30 21:11:28 +00:00
Diego Novillo 33c94679bd Makefile.in (tree-vn.o): New.
* Makefile.in (tree-vn.o): New.
	(tree-ssa-pre.o): Don't depend on RTL_H.
	* tree-dfa.c (find_referenced_vars): Don't call init_tree_ssa.
	* tree-flow.h (struct var_ann_d): Remove field expr_set.
	(add_to_value, expressions_equal_p, get_value_handle, vn_compute,
	vn_lookup_or_add, vn_add, vn_lookup, vn_init, vn_delete): Declare.
	* tree-optimize.c (execute_init_datastructures): New local function.
	(pass_init_datastructures): New local variable.
	(init_tree_optimization_passes): Sequence pass_init_datastructures.
	* tree-pretty-print.c (MASK_POINTER): Remove.
	(dump_generic_node): Handle VALUE_HANDLE.
	* tree-ssa-pre.c: Move all value numbering routines to tree-vn.c.
	Update callers to use new function names.
	Use VALUE_HANDLE_ID and VALUE_HANDLE_EXPR_SET instead of
	variable annotations.
	* tree-ssa.c (init_tree_ssa): Call vn_init.
	(delete_tree_ssa): Call vn_delete.
	* tree-vn.c: New file.
	* tree.c (tree_size): Handle VALUE_HANDLE.
	(tree_node_structure): Likewise.
	(iterative_hash_expr): Likewise.
	* tree.def (VALUE_HANDLE): New code.
	* tree.h (struct tree_value_handle): New.
	(VALUE_HANDLE_ID): Define.
	(VALUE_HANDLE_EXPR_SET): Define.
	(enum tree_node_structure_enum): Add TS_VALUE_HANDLE.
	(union tree_node): Add struct tree_value_handle.

From-SVN: r83564
2004-06-23 16:12:44 -04:00
Jan Hubicka 242229bbdc CFG transparent RTL expansion:
* Makefile.in (cfgexpand.o): New object file.
	(builtins.o): Add dependency on basic-block.h
	* builtins.c: Include basic-block.h
	(entry_of_function): New function.
	(expand_builtin_apply_args, expand_builtin_saveargs): Use it.
	* cfgexpand.c: New file.
	* expr.c (execute_expand, pass_expand): Kill.
	* pass.c (rest_of_compilation): Do not build CFG unless called from
	coverage code.
	* tree-cfg.c (delete_tree_cfg): Rename to..
	(delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself.
	* tree-flow.h (delete_tree_cfg_annotations): Declare.
	(dleete_tree_cfg): Kill.
	* tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill.
	(execute_del_cfg): Rename to...
	(execute_free_datastructures): This one...
	(pass_del_cfg): Rename to...
	(pass_free_datastructures): ... this one; Do not kill PROP_cfg.
	(init_tree_optimization_passes): Make cfg build and profiling to happen
	unconditionally.

	* tree-mudflap.c (mf_decl_cache_locals): Skip labels before
	inserting the cache variables.

	* tree-mudflap.c: Include headers to make basic_block available.
	Move functions around such that related functions are near each
	other.  Add prototypes for all static functions.  Add comments
	briefly explaining what IR the mudflap1 and mudflap2 work on and
	what they do.
	(mudflap_function_decls): Rename to execute_mudflap_function_decls.
	(mudflap_function_ops): Rename to execute_mudflap_function_ops.
	(pass_mudflap_1, pass_mudflap_2): Update.
	(mf_decl_cache_locals): Make it work on the CFG instead of the saved
	function tree.
	(mf_build_check_statement_for): Make it work on the CFG.
	(mf_xform_derefs_1): Likewise.  Cleanup code style.
	(mf_xform_derefs): Likewise.

	* tree-cfg.c (label_to_block): Invent the label destination for
	undefined labels.
	(cleanup_dead_labels): Update table in the case label_to_block added
	new label.

From-SVN: r83385
2004-06-19 15:33:06 +00:00
Ben Elliston ac5347368c tree-alias-common.c: Add whitespace.
* tree-alias-common.c: Add whitespace.
	* tree-inline.c: Correct comment about this file's purpose.
	* tree-optimize.c: Likewise.
	* tree-tailcall.c: Likewise.

From-SVN: r83286
2004-06-17 15:13:30 +10:00
Paolo Bonzini 2f8e398bf4 coverage.c: Remove argument to rest_of_compilation.
gcc/ChangeLog:
2004-06-16  Paolo Bonzini  <bonzini@gnu.org>

	* coverage.c: Remove argument to rest_of_compilation.
	* expr.c (execute_expand, set_save_expr_context, pass_expand): New.
	* passes.c (rest_of_compilation): Remove argument.
	(pass_rest_of_compilation): New.
	(rest_of_handle_final, rest_of_handle_delay_slots,
	rest_of_handle_stack_regs, rest_of_handle_variable_tracking
	rest_of_handle_machine_reorg, rest_of_handle_regrename
	rest_of_handle_sched, rest_of_handle_sched2, rest_of_handle_gcse2
	rest_of_handle_regmove, rest_of_handle_tracer
	rest_of_handle_if_conversion, rest_of_handle_if_after_combine
	rest_of_handle_web, rest_of_handle_branch_prob
	rest_of_handle_value_profile_transformations, rest_of_handle_cfg
	rest_of_handle_addressof, rest_of_handle_jump_bypass
	rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2):
	Check that the two arguments are actually superfluous.
	* toplev.h (rest_of_compilation): Adjust prototype.
	* tree-optimize.c (register_dump_files): Add properties argument.
	Track validity of passes.  Only initialize dump files for
	tree-based passes.  Store the full set of provided passes in
	the pass.
	(init_tree_optimization_passes): Register pass_expand and
	pass_rest_of_compilation.
	(execute_one_pass): Do not track the presence of required properties
	here.  Set in_gimple_form.  Do not update current_properties.
	(current_properties): Remove.
	(set_save_expr_context): Remove.
	(tree_rest_of_compilation): Do not set in_gimple_form.  Do not
	expand to RTL here, and do not call rest_of_compilation.  Push
	GGC context even before gimplification.
	* tree-pass.h (PROP_rtl, PROP_trees): New flags.
	(pass_expand, pass_rest_of_compilation): Declare.

gcc/java/ChangeLog:
2004-06-16  Paolo Bonzini  <bonzini@gnu.org>

	* java/class.c (emit_register_classes): Remove argument to
	rest_of_compilation.
	* java/resource.c (write_resource_constructor): Likewise.

From-SVN: r83225
2004-06-16 07:25:53 +00:00
Paolo Bonzini 096f22f424 function.h (struct function): Remove cannot_inline field.
gcc/ChangeLog:
2004-06-15  Paolo Bonzini  <bonzini@gnu.org>

	* function.h (struct function): Remove cannot_inline field.
	(current_function_cannot_inline): Remove.
	* passes.c (rest_of_compilation): Reset DECL_DEFER_OUTPUT.
	Simplify conditionals to ignore warn_return_type.
	* tree-optimize.c (tree_rest_of_compilation): Do not reset
	DECL_DEFER_OUTPUT.
	* objc/objc-act.c (build_module_descriptor, finish_method_def):
	Do not set current_function_cannot_inline.

gcc/java/ChangeLog:
2004-06-15  Paolo Bonzini  <bonzini@gnu.org>

	* class.c (emit_register_classes): Make the function uninlinable,
	do not set current_function_cannot_inline.
	* resource.c (write_resource_constructor): Do not reset
	flag_inline_functions around rest_of_compilation.

gcc/cp/ChangeLog:
2004-06-15  Paolo Bonzini  <bonzini@gnu.org>

	* cp-tree.h (struct language_function): Remove cannot_inline.
	* decl.c (save_function_data): cannot_inline is no more.
	(cxx_push_function_context): Likewise.
	* decl2.c (start_objects, start_static_storage_duration_function):
	Reset DECL_INLINE, set DECL_UNINLINABLE.

From-SVN: r83181
2004-06-15 12:46:07 +00:00
Steven Bosscher 673fda6b48 c-gimplify.c (c_genericize): Replace calls via (*lang_hooks.foo) with lang_hooks.foo.
* c-gimplify.c (c_genericize):
	Replace calls via (*lang_hooks.foo) with lang_hooks.foo.
	* c-parse.in <expr_no_commas>: Likewise.
	<if_prefix>: Likewise.
	<select_or_iter_stmt>: Likewise.
	* expr.c (expand_var, expand_expr_real_1): Likewise.
	* expr.h (expand_expr): Make it a static inline function.
	Move prototype for expand_expr_real up before this.
	* fold-const.c (fold_relational_hi_lo, fold_relational_const):
	Likewise.
	* gimplify.c (gimple_boolify, gimplify_addr_expr,
	gimplify_asm_expr, gimplify_expr): Likewise.
	* tree-cfg.c (dump_tree_cfg, dump_cfg_stats, tree_cfg2vcg,
	dump_function_to_file): Likewise.
	* tree-dfa.c (dump_immediate_uses, dump_dfa_stats): Likewise.
	* tree-inline.c (remap_block, save_body, walk_tree): Likewise.
	* tree-into-ssa.c (dump_tree_ssa): Likewise.
	* tree-mudflap.c (mf_varname_tree, mf_file_function_line_tree):
	Likewise.
	* tree-optimize.c (execute_one_pass): Likewise.
	* tree-pretty-print.c (dump_generic_bb_buff): Likewise.
	* tree-ssa-alias.c (dump_alias_stats, dump_alias_info): Likewise.

objc/
	* objc-act.c (objc_build_try_enter_fragment,
	objc_build_try_epilogue, objc_build_catch_stmt,
	objc_build_finally_prologue): Replace calls via (*lang_hooks.foo)
	with lang_hooks.foo ().

From-SVN: r81907
2004-05-15 23:07:53 +00:00
Diego Novillo 6de9cd9a88 Merge tree-ssa-20020619-branch into mainline.
From-SVN: r81764
2004-05-13 02:41:07 -04:00
Jan Hubicka 18c6ada9b2 cgraph.c: Add overall comment.
* cgraph.c: Add overall comment.
	(cgraph_inline_hash): New global variable.
	(cgraph_create_node): Break out from ...
	(cgraph_node): ... here.
	(cgraph_edge): New function.
	(cgraph_create_edge): New CALL_EXPR argument; some sanity checking.
	(cgraph_remove_edge): Accept edge, intead of source and destination.
	(cgraph_redirect_edge_callee): New.
	(cgraph_remove_node): Update all new datastructures.
	(cgraph_record_call, cgraph_remove_call): Kill.
	(dump_cgraph_node): Break out from ... ; dump new datastructures.
	(dump_cgraph): ... here.
	(cgraph_function_possibly_inlined_p): Use new hashtable.
	(cgraph_clone_edge, cgraph_clone_node): New.
	* cgraph.h: Include hashtab.h
	(struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output
	fields, add inlined_to pointer.
	(cgraph_node): Add pointer to next_clone.
	(cgraph_remove_edge, cgraph_create_edge): Update prototype.
	(cgraph_remove_call, cgraph_record_call): Kill.
	(cgraph_inline_hash): Declare.
	(dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node,
	cgraph_redirect_edge_callee): Declare.
	(cgraph_create_edges, cgraph_inline_p): Update prorotype.
	(cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node,
	cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare.
	* cgraphunit.c: Add overall comment.
	(cgraph_optimize_function): Kill.
	(cgraph_assemble_pending_functions): Do not assemble inline clones.
	(cgraph_finalize_function): Update call of cgraph_remove_node
	(record_call_1): Record call sites.
	(cgraph_create_edges): Accept node instead of decl argument.
	(error_found): New static variable.
	(verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions.
	(cgraph_analyze_function): Update for new datastructures.
	(cgraph_finalize_compilation_unit): Plug memory leak.
	(cgraph_optimize_function): Kill.
	(cgraph_expand_function): Do not use cgraph_optimize_function.
	(INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into,
	cgraph_inlined_callees): Kill.
	(cgraph_remove_unreachable_nodes): Verify cgraph; update handling of
	clones.
	(estimate_growth): Simplify.
	(cgraph_clone_inlined_nodes): New function.
	(cgraph_mark_inline_edge): Re-implement.
	(cgraph_mark_inline): Likewise.
	(cgraph_check_inline_limits): Simplify.
	(cgraph_recursive_inlining_p): New.
	(update_callee_keys): Break out from ...
	(cgraph_decide_inlining_of_small_functions): ... here; simplify.
	(cgraph_decide_inlining, cgraph_decide_inlining_incrementally):
	Likewise.
	(cgraph_expand_all_functions):  Remove inline clones from the ordered
	list.
	(cgraph_preserve_function_body_p): New predicate.
	(cgraph_optimize): Verify cgraph.
	* function.h (struct function): Add fields saved_tree/saved_args.
	* timevar.def (TV_CGRAPH_VERIFY): Use verifier.
	* toplev.c (rest_of_compilation): Do not free cfun.
	* tree-inline.c: Include function.h
	(struct inline_data): Add saving_p field; replace decl/current_decl by
	node/current_node.
	(insert_decl_map): New function.
	(copy_body_r): Handle saving; update cgraph datastructure.
	(copy_body): Handle recursive inlining.
	(initialize_inlined_parameters): Likewise.
	(expand_call_inline): Propagate node attributes; update cgraph.
	(optimize_inline_calls): Verify that datastructure still match.
	(save_body): New function.
	* tree-inline.h (save_body): New.
	* tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining.
	* langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New.
	* langhooks.c (lang_hooks): Add update_decl_after_saving.

	* cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define.
	* cp-tree.h (cp_update_decl_after_saving): Declare.
	* tree.c (cp_update_decl_after_saving): Define.

	* Make-lang.in (com.o): Add dependnecy on function.h
	* com.c: Include function.h
	(finish_function): Clear DECL_STRUCT_FUNCTION.

	* utils.c: Include function.h
	(end_subprog_body): Clear DECL_STRUCT_FUNCTION.

From-SVN: r80334
2004-04-01 23:28:15 +00:00
Roger Sayle ae2bcd98fa alias.c (get_alias_set): Replace calls via (*lang_hooks.foo) () with lang_hooks.foo ().
* alias.c (get_alias_set): Replace calls via (*lang_hooks.foo) ()
	with lang_hooks.foo ().
	* builtins.c (expand_builtin_va_arg): Likewise.
	* c-common.c (fname_as_string, c_common_truthvalue_conversion,
	c_common_type_for_mode, c_common_nodes_and_builtins,
	handle_mode_attribute, handle_vector_size_attribute): Likewise.
	* c-convert.c (convert): Likewise.
	* c-format.c (check_format_types): Likewise.
	* c-objc-common.c (c_tree_printer): Likewise.
	* c-typeck.c (build_unary_op, build_conditional_expr,
	build_binary_op): Likewise.
	* calls.c (try_to_integrate, expand_call,
	emit_library_call_value_1): Likewise.
	* cgraph.c (cgraph_node_name, cgraph_function_possibly_inlined_p):
	Likewise.
	* cgraphunit.c (record_call_1, cgraph_analyze_function,
	cgraph_expand_function): Likewise.
	* convert.c (convert_to_pointer, convert_to_integer): Likewise.
	* coverage.c (build_fn_info_type, build_ctr_info_type,
	build_gcov_info, create_coverage): Likewise.
	* dbxout.c (dbxout_init): Likewise.
	* diagnostic.c (diagnostic_report_current_function): Likewise.
	* dojump.c (do_jump): Likewise.
	* dwarf2out.c (dwarf2_name): Likewise.
	* except.c (init_eh): Likewise.
	* explow.c (expr_size, int_expr_size): Likewise.
	* expmed.c (make_tree, const_mult_add_overflow_p, expand_mult_add):
	Likewise.
	* expr.c (store_expr, store_constructor, safe_from_p,
	expand_expr_real, do_store_flag, try_casesi): Likewise.
	* function.c (push_function_context_to, pop_function_context_from,
	free_after_parsing, assign_stack_local_1, assign_stack_temp_for_type,
	put_var_into_stack, allocate_struct_function, current_function_name):
	Likewise.
	* integrate.c (copy_decl_for_inlining, expand_inline_function):
	Likewise.
	* langhooks.c (lhd_clear_binding_stack, write_global_declarations,
	lhd_print_error_function): Likewise.
	* opts.c (handle_option, decode_options): Likewise.
	* passes.c (open_dump_file): Likewise.
	* print-tree.c (print_node): Likewise.
	* stmt.c (expand_fixup, fixup_gotos, expand_asm_operands,
	expand_decl_cleanup, emit_case_nodes): Likewise.
	* stor-layout.c (variable_size): Likewise.
	* toplev.c (announce_function, wrapup_global_declarations,
	check_global_declarations, compile_file, default_tree_printer,
	process_options, lang_dependent_init, finalize): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* tree-inline.c (remap_decl, remap_block, copy_body_r,
	initialize_inlined_parameters, declare_return_variable,
	inlinable_function_p, expand_call_inline, optimize_inline_calls,
	walk_tree, copy_tree_r): Likewise.
	* tree-optimize.c (tree_rest_of_compilation): Likewise.
	* tree.c (decl_assembler_name, tree_size, size_in_bytes, staticp,
	unsafe_for_reeval, get_unwidened, get_narrower, get_callee_fndecl,
	variably_modified_type_p, dump_tree_statistics): Likewise.
	* varasm.c (assemble_variable, compare_constant, copy_constant,
	force_const_mem, compute_reloc_for_constant, output_constant,
	output_addressed_constants, initializer_constant_valid_p): Likewise.

From-SVN: r79481
2004-03-14 22:26:14 +00:00
Steven Bosscher 1da326c335 (c-decl.c, [...]): Replace DECL_SAVED_INSNS with DECL_STRUCT_FUNCTION.
* (c-decl.c, c-semantics.c, calls.c, cgraph.c, cgraphunit.c,
        function.c, integrate.c, print-tree.c, toplev.c, tree-optimize.c,
        tree.h): Replace DECL_SAVED_INSNS with DECL_STRUCT_FUNCTION.
        * ada/utils.c: Likewise.
        * cp/decl.c: Likewise.
        * f/com.c: Likewise.
        * java/class.c: Likewise.

From-SVN: r77985
2004-02-17 21:33:43 +00:00
Jan Hubicka 8f6a8d03ac tree-optimize.c (tree_rest_of_compilation): Do not release DECL_ARGUMENTS.
* tree-optimize.c (tree_rest_of_compilation): Do not release
	DECL_ARGUMENTS.

From-SVN: r77711
2004-02-12 16:33:07 +00:00
Kazu Hirata 283334f011 alloc-pool.c, c-lex.c, c-pragma.h, c-semantics.c, cfghooks.c,
cfghooks.h, cfglayout.c, cfgloopmanip.c, debug.c, debug.h,
	flow.c, genextract.c, ggc-common.c, ggc-page.c, ggc.h,
	ifcvt.c, jump.c, loop-unswitch.c, timevar.c, timevar.def,
	tree-optimize.c, vmsdbgout.c, config/fp-bit.c,
	config/alpha/alpha.c, config/alpha/alpha.h,
	config/alpha/alpha.md, config/alpha/unicosmk.h,
	config/alpha/vms.h, config/arm/linux-elf.h, config/avr/avr.c,
	config/c4x/c4x-protos.h, config/c4x/c4x.md,
	config/d30v/d30v.h, config/frv/frv.md, config/frv/frvbegin.c,
	config/frv/frvend.c, config/i386/cygming.h,
	config/i386/djgpp.h, config/i386/emmintrin.h,
	config/i386/gthr-win32.c, config/i386/i386-interix.h,
	config/i386/i386-protos.h, config/i386/openbsd.h,
	config/i386/winnt.c, config/i386/xm-mingw32.h,
	config/i386/xmmintrin.h, config/ia64/ia64.md,
	config/iq2000/iq2000.md, config/m32r/m32r.md,
	config/m68k/m68k.md, config/mcore/mcore-elf.h,
	config/mcore/mcore.md, config/mips/elf.h, config/mips/elf64.h,
	config/mips/iris5gas.h, config/mips/iris6.h,
	config/mips/iris6gas.h, config/mips/linux.h,
	config/mips/mips.md, config/mips/netbsd.h,
	config/mips/openbsd.h, config/mips/windiss.h,
	config/pa/fptr.c, config/rs6000/aix.h,
	config/rs6000/altivec.h, config/rs6000/darwin.h,
	config/rs6000/xcoff.h, config/s390/s390-protos.h,
	config/s390/s390.c, config/s390/s390.h, config/s390/s390.md,
	config/sh/netbsd-elf.h, config/sh/sh.h, config/sh/vxworks.h,
	config/sparc/sol2.h: Update copyright.

From-SVN: r77018
2004-01-31 02:07:12 +00:00
Jan Hubicka d173e68599 re PR c++/12850 (memory consumption for heavy template instantiations tripled since 3.3)
PR c++/12850
	* cgraph.c (cgraph_remove_node): Clear out saved/insns/arguments and
	initial pointers.
	* cgraphunit.c (cgraph_finalize_function): Clear out DECL_SAVED_INSNS
	for functions that will be only inlined.
	(cgraph_mark_function_to_output): Likewise.
	(cgraph_expand_function): Sanity check that DECL_DEFER_OUTPUT is clear;
	do not clear function body.
	* tree-optimize.c (clear_decl_rtl): Use decl_function_context.
	(tree_rest_of_compilation): Reorganize the logic releasing function
	body to use callgraph datastructure.

From-SVN: r76822
2004-01-29 00:34:09 +00:00
Jan Hubicka ec89843ee6 * tree-optimize.c (tree_rest_of_compilation): Fix warning.
From-SVN: r73385
2003-11-09 03:06:21 +00:00
Jan Hubicka bd04ab3253 cgraphunit.c (cgraph_expand_function): Use cgraph_possibly_inlined_p.
* cgraphunit.c (cgraph_expand_function): Use
	cgraph_possibly_inlined_p.
	* tree-optimize.c (tree_rest_of_compilation): Do not kill saved tree.

	* opts.c (common_handle_option): Do not set max-inline-insns.
	* params.def: Update comments.
	(PARAM_MAX_INLINE_INSNS): Kill.
	* invoke.texi (max-inline-insns): Kill.

From-SVN: r73384
2003-11-09 02:37:54 +00:00
Richard Henderson f31686a322 Revert DECL_SOURCE_LOCATION -> TREE_LOCUS change.
From-SVN: r71641
2003-09-21 22:09:32 -07:00
Richard Henderson 7e2af53a14 tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.
* tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.
	(TREE_FILENAME, TREE_LINENO): Likewise.
	(set_tree_locus, copy_tree_locus, set_tree_file_line): New.
	(TREE_LOCUS_SET_P): New.
	* c-aux-info.c, c-decl.c, c-parse.in, coverage.c, dbxout.c,
	diagnostic.c, dwarf2out.c, dwarfout.c, function.c, integrate.c,
	print-tree.c, stmt.c, toplev.c, tree-dump.c, tree-inline.c,
	tree-optimize.c, tree.c, tree.def, xcoffout.c, config/alpha/alpha.c,
	config/mips/mips.c, doc/c-tree.texi, objc/objc-act.c: Update to match.

ada/
	* trans.c, utils.c: Update for DECL_SOURCE_LOCATION rename and
	change to const.

cp/
	* class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c,
	method.c, optimize.c, pt.c, semantics.c, tree.c: Update for
	DECL_SOURCE_LOCATION rename and change to const.

f/
	* com.c, ste.c: Update for DECL_SOURCE_LOCATION rename and
	change to const.

java/
	* class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y,
	resource.c: Update for DECL_SOURCE_LOCATION rename and change to const.

treelang/
	* treetree.c: Update for DECL_SOURCE_LOCATION rename and
	change to const.

From-SVN: r71636
2003-09-21 16:39:40 -07:00
Richard Henderson ddd2d57e72 c-format.c (gcc_diag_char_table): Add %J.
* c-format.c (gcc_diag_char_table): Add %J.
        (gcc_cdiag_char_table, gcc_cxxdiag_char_table): Likewise.
        (check_format_types): Fix wanted_type name lookup.
        (init_dynamic_diag_info): Setup %J.
        * diagnostic.c (text_specifies_location): Implement %J.
        * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, calls.c,
        dwarfout.c, expr.c, function.c, stmt.c, stor-layout.c, toplev.c,
        tree-inline.c, tree-optimize.c, varasm.c, config/arm/pe.c,
        config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c,
        config/v850/v850.c, objc/objc-act.c: Use %J in diagnostics.

        * tree-inline.c: Include intl.h
        (inline_forbidden_p_1): Fix i18n of inline_forbidden_reason.
        * Makefile.in (tree-inline.o): Update.
cp/
        * decl.c, decl2.c, pt.c: Use %J in diagnostics.
java/
        * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics.
testsuite/
        * gcc.dg/format/gcc_diag-1.c: Add tests for %J.

From-SVN: r71619
2003-09-20 22:07:20 -07:00
Richard Henderson 5d4854c85e tree-optimize.c (tree_rest_of_compilation): Save and restore input_location.
* tree-optimize.c (tree_rest_of_compilation): Save and restore
        input_location.

        * semantics.c (expand_body): Don't save/restore input_location.

From-SVN: r71498
2003-09-17 18:59:27 -07:00
Richard Henderson c1f927e84e c-decl.c (c_expand_body_1): Push and pop function context here.
gcc/
        * c-decl.c (c_expand_body_1): Push and pop function context here.
        * tree-optimize.c (tree_rest_of_compilation): ... not here.  Take
        nested argument instead of computing nesting ourselves.

gcc/cp/
        * decl.c (finish_function): Clear current_function_decl.
        * decl2.c (mark_used): Don't push/pop gc context.
        * optimize.c (optimize_function): Likewise.
        * tree.c (cp_cannot_inline_tree_fn): Likewise.
        * pt.c (instantiate_decl): Inc/dec function_depth instead.
        * semantics.c (expand_body): Update for tree_rest_of_compilation
        nested argument.

From-SVN: r71208
2003-09-08 08:56:27 -07:00
Richard Henderson 4985cde3ef tree-optimize.c: New file.
gcc/
        * tree-optimize.c: New file.
        * Makefile.in (OBJS-archive): Add tree-optimize.o.
        (tree-optimize.o): New.
        * c-decl.c (store_parm_decls): Use allocate_struct_function.
        (finish_function): Don't free_after_parsing or free_after_compilation.
        (set_save_expr_context): Move to tree-optimize.c.
        (c_expand_body_1): Use tree_rest_of_compilation.
        * c-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New.
        * objc/objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New.
        * c-objc-common.c (expand_deferred_fns): Don't emit unused inlines;
        iterate until closure.
        * langhooks-def.h (LANG_HOOKS_RTL_EXPAND_START,
        LANG_HOOKS_RTL_EXPAND_STMT, LANG_HOOKS_RTL_EXPAND_END): New.
        (LANG_HOOKS_RTL_EXPAND_INITIALIZER): New.
        * langhooks.h (struct lang_hooks_for_rtl_expansion): New.
        * toplev.h (tree_rest_of_compilation): Declare it.

gcc/cp/
        * cp-lang.c (LANG_HOOKS_RTL_EXPAND_START): New.
        (LANG_HOOKS_RTL_EXPAND_STMT): New.
        * cp-tree.h (cxx_expand_function_start): Declare.
        * decl.c (start_function): Use allocate_struct_function.
        Move stmts_are_full_exprs_p assertion from expand_body.
        Do not free_after_parsing or free_after_compilation.
        (cxx_push_function_context): Move code to set struct function
        data from genrtl_start_function.
        * optimize.c (optimize_function): Don't inc/dec function_depth.
        * semantics.c (expand_body): Use tree_rest_of_compilation.
        (cxx_expand_function_start): Rename from genrtl_start_function,
        omit bits done by tree_rest_of_compilation.
        (genrtl_finish_function): Remove.
        (clear_decl_rtl): Move to ../tree-optimize.c.

Co-Authored-By: Jason Merrill <jason@redhat.com>

From-SVN: r70933
2003-08-29 16:21:13 -07:00