This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-profiling] Housekeeping...


Hi,
this patch cleans up several issues
 - Wrong and missplaced changelog entries (Steven/Kenny, please next time use
   ChangeLog.profiling)
 - Adds early local passes into passmanger and cleans up some of the mess
   introduced by cfg inliner patch not doing it at first place
 - Brings in Zdenek's fix for PR 18040 as we are hitting it during bootstrap
   now.  I realize that the patch is still being disucssed and will revert it
   of the patch is fixed differently on mainline later
 - Re-enable Kenny's static vars analysis and profile estimation
 - Cleans up timevars

I am sorry for not breaking the patch further but it has turned out to be bit
dificult and most of this mess came in in single patch anyway.  The patch
breaks some of branch profiling testcases but since profiling is utterly broken
anyway (none of SPEC benchmarks compile at the moment) I am ignoring it for the
moment and will look into this next.

The patch has been tested on i686-linux and I will commit it soonish.

Honza

Index: ChangeLog.profiling
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/ChangeLog.profiling,v
retrieving revision 1.1.2.76
diff -c -3 -p -r1.1.2.76 ChangeLog.profiling
*** ChangeLog.profiling	10 Nov 2004 15:03:28 -0000	1.1.2.76
--- ChangeLog.profiling	28 Nov 2004 17:45:45 -0000
***************
*** 1,3 ****
--- 1,233 ----
+ 2004-11-28  Jan Hubicka  <jh@suse.cz>
+ 
+ 	* Changelog.profiling:  Fix up entries
+ 	* Changelog: Move tree-profiling entries where they belong
+ 	* cgraph.c (cgraph_function_body_availability): Fix inlining condition.
+ 	* cgraphunit.c (cgraph_build_cfg): Do not build profile.
+ 	(cgraph_varpool_analye_pending_decls): Add timevar.
+ 	(cgraph_analyze_function): Do early optimizations passes,
+ 	push/pop context.
+ 	(cgraph_optimize): Add timevars.
+ 	(cgraph_build_static_cdtor): Do early passes.
+ 	* ipa-static-vars-anal.c: Include timevar.h.
+ 	(analyze_function): Reorganize to work on CFG.
+ 	(pass_ipa_static): Set timevar.
+ 	* timevar.def (TV_CGRAPHOPT): Kill.
+ 	(TV_IPA_OPT, TV_IPA_ANALYSIS, TV_IPA_STATIC_VAR): New.
+ 	* tree-cfg.c: Undo all of cfg inliner merge patch except
+ 	for build_tree_cfg bits.
+ 	* tree-optimize.c (pass_gimple): Revert cfg inliner patch.
+ 	(all_early_local_passes): New static variable.
+ 	(init_tree_optimization_passes): Cleanup mess introduced by cfg inliner patch;
+ 	re-enable profiling and ipa-static vars, introduce early passes.
+ 	(tree_early_local_passes): New function.
+ 	* tree-pass.h (tree_early_local_passes): Declare.
+ 	(pass_lower_cf): Revert cfg inliner patch.
+ 
+ 2004-11-17  Stuart Hastings <stuarth@apple.com>
+ 	    Dale Johannesen  <dalej@apple.com>
+ 
+ 	* Makefile.in (tree-inline.o): Add dependency on $(TREE_FLOW_H) and
+ 	on except.h.
+ 	(tree-eh.o): Don't depend on gt-tree-eh.h.
+ 	(tree-pretty-print.o): Don't depend on tree-iterator.h.
+ 	(except.o): Add dependency on $(TREE_FLOW_H).
+ 	(cgraph.o): Likewise.
+ 	(cgraphunit.o): Add dependency on except.h and coverage.h.
+ 	(GTFILES): Remove $(srcdir)/except.c.  Add $(srcdir)/tree-inline.c.
+ 	* basic-block.h (FOR_EACH_BB_FN, FOR_EACH_BB_REVERSE_FN): New.
+ 	(FOR_EACH_BB, FOR_EACH_BB_REVERSE): Define in terms of the above.
+ 	* cfg.c (init_flow): Don't clear n_edges.
+ 	* cfglayout.c (flow_obstack): Don't declare.
+ 	* cgraph.c: Include basic-block.h.
+ 	(cgraph_create_edge): Set edge_count.
+ 	(cgraph_remove_node): Remove nodes for inlined nested functions.
+ 	* cgraph.h: Include tree.h and basic-block.h.
+ 	(struct cgraph_node): Add the fields current_basic_block,
+ 	insn_size, and most_desirable.
+ 	(cgraph_node, cgraph_edge, cgraph_varpool_node, cgraph_inline_p,
+ 	cgraph_mark_inline_edge, cgraph_clone_inlined_nodes,
+ 	cgraph_build_static_cdtor): Cleanup prototypes.
+ 	* cgraphunit.c: Include basic-block.h, tree-iterator.h, tree-flow.h,
+ 	value-prof.h, coverage.h, and except.h.
+ 	(cgraph_build_cfg): New.  Build the CFG for a function.
+ 	(record_call_1): Don't look at STATEMENT_LIST nodes.
+ 	(cgraph_create_edges): Handle FUNCTION_DECLs as special cases when
+ 	looking for things to add to the call graph.
+ 	(verify_cgraph_node): Use walk_tree with a pointer set instead of
+ 	walk_tree_without_duplicates.
+ 	(cgraph_varpool_analyze_pending_decls): Only look at DECL_INITIAL
+ 	for things to add to the call graph when it is non-NULL.
+ 	(cgraph_analyze_function): Build the CFG from here.
+ 	(cgraph_expand_function): Make sure there is a CFG at this point.
+ 	(cgraph_estimate_growth): Avoid negative size estimates.
+ 	(cgraph_clone_inlined_nodes): Avoid cleating duplicate, unnecessary
+ 	clones.
+ 	(cgraph_clone_inlined_nodes_1): New, callback for the above.
+ 	(cgraph_mark_inline_edge): Handle simple recursion.
+ 	(cgraph_desirability): New, determine how "desirable" it is for
+ 	some given function to be inlined.
+ 	(cgraph_pick_most_desirable_edge): New, find the inline candidate
+ 	most desirable to be inlined.
+ 	(cgraph_profile_driven_inlining): New.
+ 	(cgraph_decide_inlining_of_small_function): Don't compute max_insns
+ 	from here.
+ 	(cgraph_decide_inlining): Do it here.
+ 	(cgraph_build_static_cdtor): If all else fails, build a CFG from here,
+ 	for irregular functions such as mudflap.
+ 	* except.c: Include tree-iterator.h, tree-inline.h, and tree-flow.h.
+ 	(struct eh_status): Add per-function throw_stmt_table hash table.
+ 	(eh_region_must_not_throw_p): New.
+ 	(expand_resx_expr): Add sanity check.
+ 	(current_function_has_exception_handlers):
+ 	(duplicate_eh_region_1): Rewrite for trees.
+ 	(duplicate_eh_region_2): Likewise.
+ 	(duplicate_eh_regions): Likewise.
+ 	(remove_eh_handler): No longer static.  Make sure there is EH info
+ 	for the current function cfun.
+ 	(change_to_nothrow): New, fixup EH statements for which we've later
+ 	figured out that they don't actually throw.
+ 	(set_nothrow_function_flags): Call it.
+ 	(set_eh_throw_stmt_table): New.
+ 	(get_eh_throw_stmt_table): New.
+ 	(get_maybe_saved_eh_throw_stmt_table): New.
+ 	(get_eh_last_region_number): New.
+ 	(get_eh_cur_region): New.
+ 	(set_eh_cur_region): New.
+ 	* except.h (duplicate_eh_regions): Adjust prototype after rewrite.
+ 	(add_stmt_to_eh_region_fn, remove_stmt_from_eh_region_fn,
+ 	lookup_stmt_eh_region_fn): New prototypes.
+ 	(struct throw_stmt_node): Moved from tree-eh.c.
+ 	(remove_eh_handler, set_eh_throw_stmt_table, get_eh_throw_stmt_table,
+ 	get_maybe_saved_eh_throw_stmt_table, get_eh_last_region_number,
+ 	get_eh_cur_region, set_eh_cur_region, eh_region_must_not_throw_p):
+ 	More new prototypes.
+ 	* expr.c (expand_expr_real): Beware of MODIFY_EXPRs and RETURN_EXPRs
+ 	that might throw at the end of a function.
+ 	* function.c (allocate_struct_function): Clear n_edges here.
+ 	* function.h (struct function): Add saved_eh and saved_cfg fields.
+ 	* gengtype.c (open_base_files): Remove except.h from headers to
+ 	analyze.
+ 	* gimple-low.c (lower_function_body): No longer static.
+ 	* integrate.c (copy_decl_for_inlining): Clear LABEL_DECL_UID for
+ 	copied labels.
+ 	* langhooks-def.h (lhd_tree_inlining_add_pending_fn_decls,
+ 	lhd_tree_inlining_start_inlining, lhd_tree_inlining_end_inlining):
+ 	Remove prototypes.
+ 	(lhd_tree_inlining_copy_res_decl_for_inlining): Add prototype.
+ 	(LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
+ 	LANG_HOOKS_TREE_INLINING_START_INLINING,
+ 	LANG_HOOKS_TREE_INLINING_END_INLINING): Remove.
+ 	(LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): New hook.
+ 	(lhd_tree_inlining_disregard_inline_limit):
+ 	(lhd_tree_inlining_add_pending_fn_decls):
+ 	(lhd_tree_inlining_auto_var_in_fn_p):
+ 	(lhd_tree_inlining_copy_res_decl_for_inlining):
+ 	(lhd_tree_inlining_anon_aggr_type_p):
+ 	(lhd_tree_inlining_start_inlining):
+ 	(lhd_tree_inlining_end_inlining):
+ 	* langhooks.c (lhd_tree_inlining_add_pending_fn_decls,
+ 	lhd_tree_inlining_start_inlining, lhd_tree_inlining_end_inlining):
+ 	Remove.
+ 	(lhd_tree_inlining_copy_res_decl_for_inlining): New default hook.
+ 	* langhooks.h (struct lang_hooks_for_tree_inlining): Adjust.
+ 	* passes.c: Don't include alloc-pool.h.
+ 	* print-tree.c: Include tree-iterator.h.
+ 	(print_node): Print STATEMENT_LIST nodes.
+ 	* tree-cfg.c (build_tree_cfg): No longer static.  Create
+ 	ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR here.
+ 	(make_blocks): Purge basic_block_info.  Rechain split statements.
+ 	Let statements in an EH region end a basic block.
+ 	(make_edges): Make edges for blocks ending with an EH statement.
+ 	(label_to_block): Rename to...
+ 	(label_to_block_fn): ... this.  Work per function.
+ 	(remove_useless_stmts_warn_notreached): Disable.
+ 	(remove_useless_stmts_bind): Likewise.
+ 	(remove_useless_stmts_1): Don't use them. Tighten up checks.
+ 	(remove_useless_stmts): Rewrite to be basic block aware.
+ 	(set_bb_for_stmt): Force the multiply to happen before the divide.
+ 	(tree_forwarder_block_p): Don't forward forced labels.
+ 	* tree-eh.c (struct throw_stmt_node): Removed here, moved to except.c.
+ 	(add_stmt_to_eh_region_fn): New.
+ 	(remove_stmt_from_eh_region_fn): New.
+ 	(lookup_stmt_eh_region_fn): New.
+ 	(record_stmt_eh_region): Get the table from cfun.
+ 	(add_stmt_to_eh_region): Likewise.
+ 	(remove_stmt_from_eh_region): Likewise.
+ 	(lookup_stmt_eh_region): Likewise.
+ 	(duplicate_stmt_eh_region_mapping): New function to preserve stmt EH
+ 	mapping during inlining.
+ 	(honor_protect_cleanup_actions): Use build_resx.
+ 	(lower_try_finally_onedest): Likewise.
+ 	(lower_try_finally_copy): Likewise.
+ 	(lower_try_finally_switch): Likewise.
+ 	(lower_eh_constructs): No longer static.
+ 	(make_eh_edges): If a MUST_NOT_THROW region contains a call that
+ 	throws, don't remove it.
+ 	* tree-flow.h (build_tree_cfg): New prototype.
+ 	(label_to_block): Make it a define.  Rename prototype to...
+ 	(label_to_block_fn): ... this.
+ 	(do_tree_profiling): New prototype.
+ 	* tree-inline.c: Mostly rewritten for CFG inlining.
+ 	* tree-inline.h (remap_decl_v): New prototype.
+ 	(push_cfun, pop_cfun): Likewise.
+ 	* tree-optimize.c (pass_gimple): Remove.
+ 	(pass_lower_cf, pass_lower_eh, pass_build_cfg): Disable, we do
+ 	this much earlier.  Needs to be cleaned up.
+ 	(pass_tree_profile, pass_profile): Disable for now.
+ 	(init_tree_optimization_passes): Hard-code initial properties.
+ 	(tree_rest_of_compilation): Register the tree cfg hooks.  Preserve
+ 	the CFG and EH data before optimizing.
+ 	(pass_ipa_static): Disable for now, see the comments in that pass that
+ 	need addressing.
+ 	* tree-pass.h (pass_lower_cf): Remove.
+ 	* tree-pretty-print.c: Don't include tree-iterator.h.
+ 	* tree-profile.c (do_tree_profiling): No longer static.
+ 	* tree.c (build_resx): New.
+ 	* tree.h (lower_function_body, duplicate_stmt_eh_region_mapping,
+ 	lower_eh_constructs): New prototypes.
+ 
+ 2004-11-08  Kenneth Zadeck  <Kenneth.Zadeck@NaturalBridge.com>
+ 
+ 	* Makefile.in (cgraph.h, ipa-static.h, ipa-static-vars-anal.c): 
+ 	Add dependencies.
+ 	* (ipa-static.h, ipa-static-vars-anal.c) : New files to implement
+ 	the analysis if compilation wide static variables.
+ 	* cgraph.c (cgraph_create_node, cgraph_remove_node
+ 	dump_cgraph_node): Now handles master_clone_nodes and ipa_static info.
+ 	(cgraph_is_master_clone, cgraph_master_clone,
+ 	cgraph_immortal_master_clone): Added.
+ 	(cgraph_function_body_availability): Handles inlinable and
+ 	overwrittable functions. 
+ 	* cgraph.h (availablilty):Handles inlinable and
+ 	overwrittable functions. 
+ 	(cgraph_node) Has static vars analyis info.
+ 	* cgraph_unit (cgraph_function_and_variable_visibility): Fixed
+ 	comments and removed external bit.
+ 	* regclass.c (regset_release_memory): removed call to
+ 	bitmap_release_memory which does not work with ipa reorganization.
+ 	* tree-dfa.c: (find_referenced_vars) Add initialization code for 
+ 	static vars analysis.
+ 	* tree-flow.h: (static_vars_info): Added.
+ 	* tree-gimple.c (get_base_var) Added.
+ 	* tree.h (get_base_var) Added.
+ 	* tree-pass.h (pass_ipa_static) Added.
+ 	* tree-sra.c (sra_insert_before, sra_insert_after) Made public.
+ 	(sra_type_can_be_decomposed_p) renamed from
+ 	type_can_be_decomposed_p and made public. 
+ 	(sra_init_cache): new.
+ 	(tree_sra) Added call to sra_init_cache. 
+ 	* tree-ssa-operands.c: (get_call_expr_operands,
+ 	add_call_clobber_ops, add_call_read_ops) changed to clobber fewer
+ 	static variables.
+ 	
+ 2004-11-27  Jan Hubicka  <jh@suse.cz>
+ 
+ 	Temporarily apply Zdenek Dvorak's patch:
+ 	PR tree-optimization/18040
+ 	* tree-gimple.c (is_gimple_component): New function.
+ 	(is_gimple_addressable, get_base_address): Use is_gimple_component.
+ 
  2004-11-08  Andrew Pinski  <pinskia@physics.uc.edu>
  
  	* Makefile.in: Rename ipa_static-vars-anal.o to
***************
*** 364,369 ****
--- 594,600 ----
  
  2004-06-10  Steven Bosscher  <stevenb@suse.de>
  
+ 	Based on patch by Stuart Hastings <stuart@apple.com>
  	* Makefile.in: Add function.h to BASIC_BLOCK_H.  Remove all
  	references to gt-tree-cfg.h.
  	* basic-block.h (struct basic_block_def): Don't skip rbi
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.14646.2.127.2.24
diff -c -3 -p -r1.14646.2.127.2.24 ChangeLog
*** ChangeLog	17 Nov 2004 22:06:53 -0000	1.14646.2.127.2.24
--- ChangeLog	28 Nov 2004 17:45:45 -0000
***************
*** 1,201 ****
- 2004-11-17  Stuart Hastings <stuarth@apple.com>
- 	    Dale Johannesen  <dalej@apple.com>
- 
- 	* Makefile.in (tree-inline.o): Add dependency on $(TREE_FLOW_H) and
- 	on except.h.
- 	(tree-eh.o): Don't depend on gt-tree-eh.h.
- 	(tree-pretty-print.o): Don't depend on tree-iterator.h.
- 	(except.o): Add dependency on $(TREE_FLOW_H).
- 	(cgraph.o): Likewise.
- 	(cgraphunit.o): Add dependency on except.h and coverage.h.
- 	(GTFILES): Remove $(srcdir)/except.c.  Add $(srcdir)/tree-inline.c.
- 	* basic-block.h (FOR_EACH_BB_FN, FOR_EACH_BB_REVERSE_FN): New.
- 	(FOR_EACH_BB, FOR_EACH_BB_REVERSE): Define in terms of the above.
- 	* cfg.c (init_flow): Don't clear n_edges.
- 	* cfglayout.c (flow_obstack): Don't declare.
- 	* cgraph.c: Include basic-block.h.
- 	(cgraph_create_edge): Set edge_count.
- 	(cgraph_remove_node): Remove nodes for inlined nested functions.
- 	* cgraph.h: Include tree.h and basic-block.h.
- 	(struct cgraph_node): Add the fields current_basic_block,
- 	insn_size, and most_desirable.
- 	(cgraph_node, cgraph_edge, cgraph_varpool_node, cgraph_inline_p,
- 	cgraph_mark_inline_edge, cgraph_clone_inlined_nodes,
- 	cgraph_build_static_cdtor): Cleanup prototypes.
- 	* cgraphunit.c: Include basic-block.h, tree-iterator.h, tree-flow.h,
- 	value-prof.h, coverage.h, and except.h.
- 	(cgraph_build_cfg): New.  Build the CFG for a function.
- 	(record_call_1): Don't look at STATEMENT_LIST nodes.
- 	(cgraph_create_edges): Handle FUNCTION_DECLs as special cases when
- 	looking for things to add to the call graph.
- 	(verify_cgraph_node): Use walk_tree with a pointer set instead of
- 	walk_tree_without_duplicates.
- 	(cgraph_varpool_analyze_pending_decls): Only look at DECL_INITIAL
- 	for things to add to the call graph when it is non-NULL.
- 	(cgraph_analyze_function): Build the CFG from here.
- 	(cgraph_expand_function): Make sure there is a CFG at this point.
- 	(cgraph_estimate_growth): Avoid negative size estimates.
- 	(cgraph_clone_inlined_nodes): Avoid cleating duplicate, unnecessary
- 	clones.
- 	(cgraph_clone_inlined_nodes_1): New, callback for the above.
- 	(cgraph_mark_inline_edge): Handle simple recursion.
- 	(cgraph_desirability): New, determine how "desirable" it is for
- 	some given function to be inlined.
- 	(cgraph_pick_most_desirable_edge): New, find the inline candidate
- 	most desirable to be inlined.
- 	(cgraph_profile_driven_inlining): New.
- 	(cgraph_decide_inlining_of_small_function): Don't compute max_insns
- 	from here.
- 	(cgraph_decide_inlining): Do it here.
- 	(cgraph_build_static_cdtor): If all else fails, build a CFG from here,
- 	for irregular functions such as mudflap.
- 	* except.c: Include tree-iterator.h, tree-inline.h, and tree-flow.h.
- 	(struct eh_status): Add per-function throw_stmt_table hash table.
- 	(eh_region_must_not_throw_p): New.
- 	(expand_resx_expr): Add sanity check.
- 	(current_function_has_exception_handlers):
- 	(duplicate_eh_region_1): Rewrite for trees.
- 	(duplicate_eh_region_2): Likewise.
- 	(duplicate_eh_regions): Likewise.
- 	(remove_eh_handler): No longer static.  Make sure there is EH info
- 	for the current function cfun.
- 	(change_to_nothrow): New, fixup EH statements for which we've later
- 	figured out that they don't actually throw.
- 	(set_nothrow_function_flags): Call it.
- 	(set_eh_throw_stmt_table): New.
- 	(get_eh_throw_stmt_table): New.
- 	(get_maybe_saved_eh_throw_stmt_table): New.
- 	(get_eh_last_region_number): New.
- 	(get_eh_cur_region): New.
- 	(set_eh_cur_region): New.
- 	* except.h (duplicate_eh_regions): Adjust prototype after rewrite.
- 	(add_stmt_to_eh_region_fn, remove_stmt_from_eh_region_fn,
- 	lookup_stmt_eh_region_fn): New prototypes.
- 	(struct throw_stmt_node): Moved from tree-eh.c.
- 	(remove_eh_handler, set_eh_throw_stmt_table, get_eh_throw_stmt_table,
- 	get_maybe_saved_eh_throw_stmt_table, get_eh_last_region_number,
- 	get_eh_cur_region, set_eh_cur_region, eh_region_must_not_throw_p):
- 	More new prototypes.
- 	* expr.c (expand_expr_real): Beware of MODIFY_EXPRs and RETURN_EXPRs
- 	that might throw at the end of a function.
- 	* function.c (allocate_struct_function): Clear n_edges here.
- 	* function.h (struct function): Add saved_eh and saved_cfg fields.
- 	* gengtype.c (open_base_files): Remove except.h from headers to
- 	analyze.
- 	* gimple-low.c (lower_function_body): No longer static.
- 	* integrate.c (copy_decl_for_inlining): Clear LABEL_DECL_UID for
- 	copied labels.
- 	* langhooks-def.h (lhd_tree_inlining_add_pending_fn_decls,
- 	lhd_tree_inlining_start_inlining, lhd_tree_inlining_end_inlining):
- 	Remove prototypes.
- 	(lhd_tree_inlining_copy_res_decl_for_inlining): Add prototype.
- 	(LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
- 	LANG_HOOKS_TREE_INLINING_START_INLINING,
- 	LANG_HOOKS_TREE_INLINING_END_INLINING): Remove.
- 	(LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): New hook.
- 	(lhd_tree_inlining_disregard_inline_limit):
- 	(lhd_tree_inlining_add_pending_fn_decls):
- 	(lhd_tree_inlining_auto_var_in_fn_p):
- 	(lhd_tree_inlining_copy_res_decl_for_inlining):
- 	(lhd_tree_inlining_anon_aggr_type_p):
- 	(lhd_tree_inlining_start_inlining):
- 	(lhd_tree_inlining_end_inlining):
- 	* langhooks.c (lhd_tree_inlining_add_pending_fn_decls,
- 	lhd_tree_inlining_start_inlining, lhd_tree_inlining_end_inlining):
- 	Remove.
- 	(lhd_tree_inlining_copy_res_decl_for_inlining): New default hook.
- 	* langhooks.h (struct lang_hooks_for_tree_inlining): Adjust.
- 	* passes.c: Don't include alloc-pool.h.
- 	* print-tree.c: Include tree-iterator.h.
- 	(print_node): Print STATEMENT_LIST nodes.
- 	* tree-cfg.c (build_tree_cfg): No longer static.  Create
- 	ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR here.
- 	(make_blocks): Purge basic_block_info.  Rechain split statements.
- 	Let statements in an EH region end a basic block.
- 	(make_edges): Make edges for blocks ending with an EH statement.
- 	(label_to_block): Rename to...
- 	(label_to_block_fn): ... this.  Work per function.
- 	(remove_useless_stmts_warn_notreached): Disable.
- 	(remove_useless_stmts_bind): Likewise.
- 	(remove_useless_stmts_1): Don't use them. Tighten up checks.
- 	(remove_useless_stmts): Rewrite to be basic block aware.
- 	(set_bb_for_stmt): Force the multiply to happen before the divide.
- 	(tree_forwarder_block_p): Don't forward forced labels.
- 	* tree-eh.c (struct throw_stmt_node): Removed here, moved to except.c.
- 	(add_stmt_to_eh_region_fn): New.
- 	(remove_stmt_from_eh_region_fn): New.
- 	(lookup_stmt_eh_region_fn): New.
- 	(record_stmt_eh_region): Get the table from cfun.
- 	(add_stmt_to_eh_region): Likewise.
- 	(remove_stmt_from_eh_region): Likewise.
- 	(lookup_stmt_eh_region): Likewise.
- 	(duplicate_stmt_eh_region_mapping): New function to preserve stmt EH
- 	mapping during inlining.
- 	(honor_protect_cleanup_actions): Use build_resx.
- 	(lower_try_finally_onedest): Likewise.
- 	(lower_try_finally_copy): Likewise.
- 	(lower_try_finally_switch): Likewise.
- 	(lower_eh_constructs): No longer static.
- 	(make_eh_edges): If a MUST_NOT_THROW region contains a call that
- 	throws, don't remove it.
- 	* tree-flow.h (build_tree_cfg): New prototype.
- 	(label_to_block): Make it a define.  Rename prototype to...
- 	(label_to_block_fn): ... this.
- 	(do_tree_profiling): New prototype.
- 	* tree-inline.c: Mostly rewritten for CFG inlining.
- 	* tree-inline.h (remap_decl_v): New prototype.
- 	(push_cfun, pop_cfun): Likewise.
- 	* tree-optimize.c (pass_gimple): Remove.
- 	(pass_lower_cf, pass_lower_eh, pass_build_cfg): Disable, we do
- 	this much earlier.  Needs to be cleaned up.
- 	(pass_tree_profile, pass_profile): Disable for now.
- 	(init_tree_optimization_passes): Hard-code initial properties.
- 	(tree_rest_of_compilation): Register the tree cfg hooks.  Preserve
- 	the CFG and EH data before optimizing.
- 	(pass_ipa_static): Disable for now, see the comments in that pass that
- 	need addressing.
- 	* tree-pass.h (pass_lower_cf): Remove.
- 	* tree-pretty-print.c: Don't include tree-iterator.h.
- 	* tree-profile.c (do_tree_profiling): No longer static.
- 	* tree.c (build_resx): New.
- 	* tree.h (lower_function_body, duplicate_stmt_eh_region_mapping,
- 	lower_eh_constructs): New prototypes.
- 
- 2004-11-08  Kenneth Zadeck  <Kenneth.Zadeck@NaturalBridge.com>
- 
- 	* Makefile.in (cgraph.h, ipa-static.h, ipa-static-vars-anal.c): 
- 	Add dependencies.
- 	* (ipa-static.h, ipa-static-vars-anal.c) : New files to implement
- 	the analysis if compilation wide static variables.
- 	* cgraph.c (cgraph_create_node, cgraph_remove_node
- 	dump_cgraph_node): Now handles master_clone_nodes and ipa_static info.
- 	(cgraph_is_master_clone, cgraph_master_clone,
- 	cgraph_immortal_master_clone): Added.
- 	(cgraph_function_body_availability): Handles inlinable and
- 	overwrittable functions. 
- 	* cgraph.h (availablilty):Handles inlinable and
- 	overwrittable functions. 
- 	(cgraph_node) Has static vars analyis info.
- 	* cgraph_unit (cgraph_function_and_variable_visibility): Fixed
- 	comments and removed external bit.
- 	* regclass.c (regset_release_memory): removed call to
- 	bitmap_release_memory which does not work with ipa reorganization.
- 	* tree-dfa.c: (find_referenced_vars) Add initialization code for 
- 	static vars analysis.
- 	* tree-flow.h: (static_vars_info): Added.
- 	* tree-gimple.c (get_base_var) Added.
- 	* tree.h (get_base_var) Added.
- 	* tree-pass.h (pass_ipa_static) Added.
- 	* tree-sra.c (sra_insert_before, sra_insert_after) Made public.
- 	(sra_type_can_be_decomposed_p) renamed from
- 	type_can_be_decomposed_p and made public. 
- 	(sra_init_cache): new.
- 	(tree_sra) Added call to sra_init_cache. 
- 	* tree-ssa-operands.c: (get_call_expr_operands,
- 	add_call_clobber_ops, add_call_read_ops) changed to clobber fewer
- 	static variables.
- 	
-  	
  2004-10-22  Kazu Hirata  <kazu@cs.umass.edu>
  
  	* dwarf.h, gthr-dce.h, gthr-single.h, gthr-solaris.h, gthr.h,
--- 1,3 ----
Index: cgraph.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraph.c,v
retrieving revision 1.4.4.18.2.16
diff -c -3 -p -r1.4.4.18.2.16 cgraph.c
*** cgraph.c	17 Nov 2004 22:07:30 -0000	1.4.4.18.2.16
--- cgraph.c	28 Nov 2004 17:45:45 -0000
*************** cgraph_function_body_availability (struc
*** 931,937 ****
    
    else if (!(*targetm.binds_local_p) (node->decl)
  	   && !DECL_COMDAT (node->decl) && !DECL_EXTERNAL (node->decl))
!     if (tree_inlinable_function_p (node->decl))
        avail = AVAIL_OVERWRITTABLE_BUT_INLINABLE;
      else 
        avail = AVAIL_OVERWRITTABLE;
--- 931,937 ----
    
    else if (!(*targetm.binds_local_p) (node->decl)
  	   && !DECL_COMDAT (node->decl) && !DECL_EXTERNAL (node->decl))
!     if (DECL_DECLARED_INLINE_P (node->decl))
        avail = AVAIL_OVERWRITTABLE_BUT_INLINABLE;
      else 
        avail = AVAIL_OVERWRITTABLE;
Index: cgraphunit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
retrieving revision 1.1.4.35.2.26
diff -c -3 -p -r1.1.4.35.2.26 cgraphunit.c
*** cgraphunit.c	17 Nov 2004 22:07:30 -0000	1.1.4.35.2.26
--- cgraphunit.c	28 Nov 2004 17:45:45 -0000
*************** cgraph_build_cfg (tree fn)
*** 321,334 ****
        lower_function_body ();
        lower_eh_constructs ();
        build_tree_cfg (&DECL_SAVED_TREE (fn));
-       if (flag_tree_based_profiling
- 	  && (profile_arc_flag || flag_test_coverage 
- 	      || flag_branch_probabilities))
- 	{
- 	  tree_register_profile_hooks ();
- 	  branch_prob ();
- 	  coverage_end_function ();
- 	}
        current_function_decl = saved_current_function_decl;
        pop_cfun ();
      }
--- 321,326 ----
*************** static bool
*** 799,804 ****
--- 791,797 ----
  cgraph_varpool_analyze_pending_decls (void)
  {
    bool changed = false;
+   timevar_push (TV_IPA_ANALYSIS);
  
    while (cgraph_varpool_first_unanalyzed_node)
      {
*************** cgraph_varpool_analyze_pending_decls (vo
*** 811,816 ****
--- 804,810 ----
  	cgraph_create_edges (NULL, DECL_INITIAL (decl));
        changed = true;
      }
+   timevar_pop (TV_IPA_ANALYSIS);
    return changed;
  }
  
*************** cgraph_analyze_function (struct cgraph_n
*** 851,859 ****
  {
    tree decl = node->decl;
  
    current_function_decl = decl;
  
!   cgraph_build_cfg (decl);
  
    /* First kill forward declaration so reverse inlining works properly.  */
    cgraph_create_edges (node, decl);
--- 845,855 ----
  {
    tree decl = node->decl;
  
+   timevar_push (TV_IPA_ANALYSIS);
+   push_cfun (DECL_STRUCT_FUNCTION (decl));
    current_function_decl = decl;
  
!   tree_early_local_passes (decl);
  
    /* First kill forward declaration so reverse inlining works properly.  */
    cgraph_create_edges (node, decl);
*************** cgraph_analyze_function (struct cgraph_n
*** 868,873 ****
--- 864,871 ----
  
    node->analyzed = true;
    current_function_decl = NULL;
+   pop_cfun ();
+   timevar_pop (TV_IPA_ANALYSIS);
  }
  
  /* Analyze the whole compilation unit once it is parsed completely.  */
*************** cgraph_optimize (void)
*** 2248,2259 ****
        cgraph_varpool_assemble_pending_decls ();
        return;
      }
  
    cgraph_function_and_variable_visibility ();
  
    if (flag_ipa_cp && flag_ipa_no_cloning)
      ipcp_driver ();
-   timevar_push (TV_CGRAPHOPT);
    if (!quiet_flag)
      fprintf (stderr, "Performing intraprocedural optimizations\n");
    if (cgraph_dump_file)
--- 2246,2257 ----
        cgraph_varpool_assemble_pending_decls ();
        return;
      }
+   timevar_push (TV_IPA_OPT);
  
    cgraph_function_and_variable_visibility ();
  
    if (flag_ipa_cp && flag_ipa_no_cloning)
      ipcp_driver ();
    if (!quiet_flag)
      fprintf (stderr, "Performing intraprocedural optimizations\n");
    if (cgraph_dump_file)
*************** cgraph_optimize (void)
*** 2271,2277 ****
        dump_cgraph (cgraph_dump_file);
        dump_varpool (cgraph_dump_file);
      }
!   timevar_pop (TV_CGRAPHOPT);
  
    /* Output everything.  */
    if (!quiet_flag)
--- 2269,2275 ----
        dump_cgraph (cgraph_dump_file);
        dump_varpool (cgraph_dump_file);
      }
!   timevar_pop (TV_IPA_OPT);
  
    /* Output everything.  */
    if (!quiet_flag)
*************** cgraph_build_static_cdtor (char which, t
*** 2372,2378 ****
    /* ??? We will get called LATE in the compilation process.  */
    if (cgraph_global_info_ready)
      {
!       cgraph_build_cfg (decl);
        tree_rest_of_compilation (decl);
      }
    else
--- 2370,2376 ----
    /* ??? We will get called LATE in the compilation process.  */
    if (cgraph_global_info_ready)
      {
!       tree_early_local_passes (decl);
        tree_rest_of_compilation (decl);
      }
    else
Index: ipa-static-vars-anal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/ipa-static-vars-anal.c,v
retrieving revision 1.1.2.1
diff -c -3 -p -r1.1.2.1 ipa-static-vars-anal.c
*** ipa-static-vars-anal.c	8 Nov 2004 19:17:49 -0000	1.1.2.1
--- ipa-static-vars-anal.c	28 Nov 2004 17:45:45 -0000
*************** Software Foundation, 59 Temple Place - S
*** 59,64 ****
--- 59,65 ----
  #include "cgraph.h"
  #include "output.h"
  #include "flags.h"
+ #include "timevar.h"
  
  /* FIXME -- PROFILE-RESTRUCTURE: change comment from DECL_UID to var-ann. */    
  /* This splay tree contains all of the static variables that are
*************** analyze_variable (struct cgraph_varpool_
*** 986,997 ****
  static void
  analyze_function (struct cgraph_node *fn)
  {
-   tree decl = fn->decl;
    ipa_static_vars_info_t info 
      = xcalloc (1, sizeof (struct ipa_static_vars_info_d));
    ipa_local_static_vars_info_t l
      = xcalloc (1, sizeof (struct ipa_local_static_vars_info_d));
    var_ann_t var_ann = get_var_ann (fn->decl);
  
    if (!memory_identifier_string) ipa_init();
  
--- 987,999 ----
  static void
  analyze_function (struct cgraph_node *fn)
  {
    ipa_static_vars_info_t info 
      = xcalloc (1, sizeof (struct ipa_static_vars_info_d));
    ipa_local_static_vars_info_t l
      = xcalloc (1, sizeof (struct ipa_local_static_vars_info_d));
    var_ann_t var_ann = get_var_ann (fn->decl);
+   tree step;
+   basic_block this_block;
  
    if (!memory_identifier_string) ipa_init();
  
*************** analyze_function (struct cgraph_node *fn
*** 1008,1014 ****
    if (dump_file)
      fprintf (dump_file, "\n local analysis of %s", cgraph_node_name (fn));
    
!   walk_tree (&DECL_SAVED_TREE (decl), scan_for_static_refs, fn, visited_nodes);
  }
  
  /* Produce the global information by preforming a transitive closure
--- 1010,1038 ----
    if (dump_file)
      fprintf (dump_file, "\n local analysis of %s", cgraph_node_name (fn));
    
!   /* Walk over any private statics that may take addresses of functions.  */
!   if (TREE_CODE (DECL_INITIAL (fn->decl)) == BLOCK)
!     {
!       for (step = BLOCK_VARS (DECL_INITIAL (fn->decl));
! 	   step;
! 	   step = TREE_CHAIN (step))
! 	if (DECL_INITIAL (step))
! 	  walk_tree (&DECL_INITIAL (step), scan_for_static_refs, fn, visited_nodes);
!     }
!   /* Also look here for private statics.  */
!   if (DECL_STRUCT_FUNCTION (fn->decl))
!     for (step = DECL_STRUCT_FUNCTION (fn->decl)->unexpanded_var_list;
! 	 step;
! 	 step = TREE_CHAIN (step))
!       {
! 	tree decl = TREE_VALUE (step);
! 	if (DECL_INITIAL (decl) && TREE_STATIC (decl))
! 	  walk_tree (&DECL_INITIAL (decl), scan_for_static_refs, fn, visited_nodes);
!       }
!   FOR_EACH_BB (this_block)
!     {
!       walk_tree (&this_block->stmt_list, scan_for_static_refs, fn, visited_nodes);
!     }
  }
  
  /* Produce the global information by preforming a transitive closure
*************** struct tree_opt_pass pass_ipa_static =
*** 1351,1357 ****
    NULL,					/* sub */
    NULL,					/* next */
    0,					/* static_pass_number */
!   0,				        /* tv_id */
    0,	                                /* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
--- 1375,1381 ----
    NULL,					/* sub */
    NULL,					/* next */
    0,					/* static_pass_number */
!   TV_IPA_STATIC_VAR,		        /* tv_id */
    0,	                                /* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
Index: timevar.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/timevar.def,v
retrieving revision 1.14.2.35.2.8
diff -c -3 -p -r1.14.2.35.2.8 timevar.def
*** timevar.def	25 Sep 2004 23:17:54 -0000	1.14.2.35.2.8
--- timevar.def	28 Nov 2004 17:45:45 -0000
*************** DEFTIMEVAR (TV_GC                    , "
*** 40,46 ****
  DEFTIMEVAR (TV_DUMP                  , "dump files")
  
  DEFTIMEVAR (TV_CGRAPH                , "callgraph construction")
! DEFTIMEVAR (TV_CGRAPHOPT             , "callgraph optimization")
  /* Time spent by constructing CFG.  */
  DEFTIMEVAR (TV_CFG                   , "cfg construction")
  /* Time spent by cleaning up CFG.  */
--- 40,48 ----
  DEFTIMEVAR (TV_DUMP                  , "dump files")
  
  DEFTIMEVAR (TV_CGRAPH                , "callgraph construction")
! DEFTIMEVAR (TV_IPA_OPT               , "ipa optimization")
! DEFTIMEVAR (TV_IPA_ANALYSIS          , "ipa analysis")
! DEFTIMEVAR (TV_IPA_STATIC_VAR        , "ipa static vars")
  /* Time spent by constructing CFG.  */
  DEFTIMEVAR (TV_CFG                   , "cfg construction")
  /* Time spent by cleaning up CFG.  */
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 1.1.4.267.2.29
diff -c -3 -p -r1.1.4.267.2.29 tree-cfg.c
*** tree-cfg.c	17 Nov 2004 22:07:40 -0000	1.1.4.267.2.29
--- tree-cfg.c	28 Nov 2004 17:45:45 -0000
*************** remove_useless_stmts_warn_notreached (tr
*** 1195,1201 ****
    return false;
  }
  
- #if 0
  static void
  remove_useless_stmts_cond (tree *stmt_p, struct rus_data *data)
  {
--- 1195,1200 ----
*************** remove_useless_stmts_bind (tree *stmt_p,
*** 1450,1456 ****
        data->repeat = true;
      }
  }
! #endif
  
  static void
  remove_useless_stmts_goto (tree *stmt_p, struct rus_data *data)
--- 1449,1455 ----
        data->repeat = true;
      }
  }
! 
  
  static void
  remove_useless_stmts_goto (tree *stmt_p, struct rus_data *data)
*************** remove_useless_stmts_1 (tree *tp, struct
*** 1541,1555 ****
    switch (TREE_CODE (t))
      {
      case COND_EXPR:
!       /*remove_useless_stmts_cond (tp, data);*/
!       fold_stmt (tp);
        break;
  
      case TRY_FINALLY_EXPR:
      case TRY_CATCH_EXPR:
      case BIND_EXPR:
!       /* We're gimple now.  */
!       abort ();
  
      case GOTO_EXPR:
        remove_useless_stmts_goto (tp, data);
--- 1540,1559 ----
    switch (TREE_CODE (t))
      {
      case COND_EXPR:
!       remove_useless_stmts_cond (tp, data);
        break;
  
      case TRY_FINALLY_EXPR:
+       remove_useless_stmts_tf (tp, data);
+       break;
+ 
      case TRY_CATCH_EXPR:
+       remove_useless_stmts_tc (tp, data);
+       break;
+ 
      case BIND_EXPR:
!       remove_useless_stmts_bind (tp, data);
!       break;
  
      case GOTO_EXPR:
        remove_useless_stmts_goto (tp, data);
*************** remove_useless_stmts_1 (tree *tp, struct
*** 1561,1572 ****
  
      case RETURN_EXPR:
        fold_stmt (tp);
-       op = get_call_expr_in (t);
-       if (op)
- 	{
- 	  update_call_expr_flags (op);
- 	  notice_special_calls (op);
- 	}
        data->last_goto = NULL;
        data->may_branch = true;
        break;
--- 1565,1570 ----
*************** remove_useless_stmts_1 (tree *tp, struct
*** 1593,1598 ****
--- 1591,1621 ----
  	data->may_throw = true;
        break;
  
+     case STATEMENT_LIST:
+       {
+ 	tree_stmt_iterator i = tsi_start (t);
+ 	while (!tsi_end_p (i))
+ 	  {
+ 	    t = tsi_stmt (i);
+ 	    if (IS_EMPTY_STMT (t))
+ 	      {
+ 		tsi_delink (&i);
+ 		continue;
+ 	      }
+ 	    
+ 	    remove_useless_stmts_1 (tsi_stmt_ptr (i), data);
+ 
+ 	    t = tsi_stmt (i);
+ 	    if (TREE_CODE (t) == STATEMENT_LIST)
+ 	      {
+ 		tsi_link_before (&i, t, TSI_SAME_STMT);
+ 		tsi_delink (&i);
+ 	      }
+ 	    else
+ 	      tsi_next (&i);
+ 	  }
+       }
+       break;
      case SWITCH_EXPR:
        fold_stmt (tp);
        data->last_goto = NULL;
*************** remove_useless_stmts_1 (tree *tp, struct
*** 1604,1677 ****
      }
  }
  
- /* This cleanup runs just after the inliner; it does not
-    currently do any CFG optimizations, but could be made 
-    to do this.  It will, however, remove EH edges in the 
-    case where a statement that was believed to throw becomes 
-    known not to after fold_stmt is called; that is needed for
-    correctness.
-    Tree has been gimplified and EH has been lowered.  */
- 
  static void
  remove_useless_stmts (void)
  {
    struct rus_data data;
-   basic_block bb;
  
    clear_special_calls ();
  
    do
      {
        memset (&data, 0, sizeof (data));
!       FOR_EACH_BB (bb)
! 	{
! 	  block_stmt_iterator bsi = bsi_start (bb);
! 	  tree last_t = last_stmt (bb);
! 	  while (!bsi_end_p (bsi))
! 	    {
! 	      tree *tp = bsi_stmt_ptr (bsi);
! 	      tree t = *tp;
! 	      bool could_throw = false;
! 	      if (IS_EMPTY_STMT (t))
! 		{
! 		  bsi_remove (&bsi);
! 		  continue;
! 		}
! 
! 	      if (t == last_t && tree_could_throw_p (t))
! 		could_throw = true;
! 
! 	      remove_useless_stmts_1 (tp, &data);
! 
! 	      t = bsi_stmt (bsi);
! 	      if (TREE_CODE (t) == STATEMENT_LIST)
! 		/* Don't think this can happen... */
! 		bsi_replace (&bsi, t, true);
! 	      else
! 		{
! 		  /* If this tree used to throw and we have
! 		     decided otherwise, remove the tree from its
! 		     EH region and remove any EH edges.  */
! 		  if (could_throw && !tree_could_throw_p (t))
! 		    {
! 		      edge_iterator ei;
! 		      edge e;
! 
! 		      for (ei = ei_start (bb->succs);
! 			   (e = ei_safe_edge (ei)); )
! 			{
! 			  if (e->flags & EDGE_EH)
! 			    remove_edge (e);
! 			  else
! 			    ei_next (&ei);
! 			}
! 
! 		      remove_stmt_from_eh_region (t);
! 		    }
! 		  bsi_next (&bsi);
! 		}
! 	    }
! 	}
      }
    while (data.repeat);
  }
--- 1627,1643 ----
      }
  }
  
  static void
  remove_useless_stmts (void)
  {
    struct rus_data data;
  
    clear_special_calls ();
  
    do
      {
        memset (&data, 0, sizeof (data));
!       remove_useless_stmts_1 (&DECL_SAVED_TREE (current_function_decl), &data);
      }
    while (data.repeat);
  }
*************** set_bb_for_stmt (tree t, basic_block bb)
*** 2685,2695 ****
  	    {
  	      LABEL_DECL_UID (t) = uid = cfun->last_label_uid++;
  	      if (VARRAY_SIZE (label_to_block_map) <= (unsigned) uid)
! 		{
! 		  unsigned tmp_u = 3 * MAX (uid, 2);
! 		  /* Force the multiply to happen before the divide.  */
! 		  VARRAY_GROW (label_to_block_map, tmp_u / 2);
! 		}
  	    }
  	  else
  	    /* We're moving an existing label.  Make sure that we've
--- 2651,2657 ----
  	    {
  	      LABEL_DECL_UID (t) = uid = cfun->last_label_uid++;
  	      if (VARRAY_SIZE (label_to_block_map) <= (unsigned) uid)
! 		VARRAY_GROW (label_to_block_map, 3 * uid / 2);
  	    }
  	  else
  	    /* We're moving an existing label.  Make sure that we've
*************** need_fake_edge_p (tree t)
*** 5028,5034 ****
         && (ASM_VOLATILE_P (t) || ASM_INPUT_P (t)))
      return true;
  
- 
    return false;
  }
  
--- 4990,4995 ----
Index: tree-gimple.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-gimple.c,v
retrieving revision 2.1.2.9
diff -c -3 -p -r2.1.2.9 tree-gimple.c
*** tree-gimple.c	8 Nov 2004 19:17:53 -0000	2.1.2.9
--- tree-gimple.c	28 Nov 2004 17:45:45 -0000
*************** is_gimple_condexpr (tree t)
*** 162,173 ****
    return (is_gimple_val (t) || COMPARISON_CLASS_P (t));
  }
  
  /*  Return true if T is something whose address can be taken.  */
  
  bool
  is_gimple_addressable (tree t)
  {
!   return (is_gimple_id (t) || handled_component_p (t)
  	  || TREE_CODE (t) == REALPART_EXPR
  	  || TREE_CODE (t) == IMAGPART_EXPR
  	  || INDIRECT_REF_P (t));
--- 162,192 ----
    return (is_gimple_val (t) || COMPARISON_CLASS_P (t));
  }
  
+ /* Return true if T is a gimple component reference.  */
+ 
+ static bool
+ is_gimple_component (tree t)
+ {
+   switch (TREE_CODE (t))
+     {
+     case COMPONENT_REF:
+     case ARRAY_REF:
+     case ARRAY_RANGE_REF:
+     case VIEW_CONVERT_EXPR:
+       return true;
+ 
+     default:
+       return false;;
+     }
+ }
+ 
  /*  Return true if T is something whose address can be taken.  */
  
  bool
  is_gimple_addressable (tree t)
  {
!   return (is_gimple_id (t)
! 	  || is_gimple_component (t)
  	  || TREE_CODE (t) == REALPART_EXPR
  	  || TREE_CODE (t) == IMAGPART_EXPR
  	  || INDIRECT_REF_P (t));
*************** get_base_var (tree t)
*** 457,464 ****
  tree
  get_base_address (tree t)
  {
!   while (TREE_CODE (t) == REALPART_EXPR || TREE_CODE (t) == IMAGPART_EXPR
! 	 || handled_component_p (t))
      t = TREE_OPERAND (t, 0);
    
    if (SSA_VAR_P (t)
--- 476,485 ----
  tree
  get_base_address (tree t)
  {
!   while (TREE_CODE (t) == REALPART_EXPR
! 	 || TREE_CODE (t) == IMAGPART_EXPR
! 	 || TREE_CODE (t) == BIT_FIELD_REF
! 	 || is_gimple_component (t))
      t = TREE_OPERAND (t, 0);
    
    if (SSA_VAR_P (t)
Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 1.1.4.122.2.25
diff -c -3 -p -r1.1.4.122.2.25 tree-optimize.c
*** tree-optimize.c	17 Nov 2004 22:07:44 -0000	1.1.4.122.2.25
--- tree-optimize.c	28 Nov 2004 17:45:45 -0000
*************** bitmap vars_to_rename;
*** 55,61 ****
  bool in_gimple_form;
  
  /* The root of the compilation pass tree, once constructed.  */
! static struct tree_opt_pass *all_passes, *all_ipa_passes;
  
  /* Do cleanup_cfg explicitely for first time.  */
  static void 
--- 55,82 ----
  bool in_gimple_form;
  
  /* The root of the compilation pass tree, once constructed.  */
! static struct tree_opt_pass *all_passes, *all_early_local_passes, *all_ipa_passes;
! 
! /* Pass: dump the gimplified, inlined, functions.  */
! 
! static struct tree_opt_pass pass_gimple = 
! {
!   "gimple",				/* name */
!   NULL,					/* gate */
!   NULL, NULL,				/* IPA analysis */
!   NULL,					/* execute */
!   NULL, NULL,				/* IPA modification */
!   NULL,					/* sub */
!   NULL,					/* next */
!   0,					/* static_pass_number */
!   0,					/* tv_id */
!   0,					/* properties_required */
!   PROP_gimple_any,			/* properties_provided */
!   0,					/* properties_destroyed */
!   0,					/* todo_flags_start */
!   TODO_dump_func,			/* todo_flags_finish */
!   0					/* letter */
! };
  
  /* Do cleanup_cfg explicitely for first time.  */
  static void 
*************** init_tree_optimization_passes (void)
*** 349,364 ****
    struct tree_opt_pass **p;
  
  #define NEXT_PASS(PASS)  (p = next_pass_1 (p, &PASS))
! 
!   p = &all_passes;
! /*  NEXT_PASS (pass_gimple); */
    NEXT_PASS (pass_remove_useless_stmts);
    NEXT_PASS (pass_mudflap_1);
! /*  NEXT_PASS (pass_lower_cf); */
! /*  NEXT_PASS (pass_lower_eh); */
! /*  NEXT_PASS (pass_build_cfg); */
    NEXT_PASS (pass_pre_expand);
! /*  NEXT_PASS (pass_tree_profile); */
    NEXT_PASS (pass_cleanup_cfg);
    NEXT_PASS (pass_init_datastructures);
    NEXT_PASS (pass_all_optimizations);
--- 370,387 ----
    struct tree_opt_pass **p;
  
  #define NEXT_PASS(PASS)  (p = next_pass_1 (p, &PASS))
!   p = &all_early_local_passes;
!   NEXT_PASS (pass_gimple); 
    NEXT_PASS (pass_remove_useless_stmts);
    NEXT_PASS (pass_mudflap_1);
!   NEXT_PASS (pass_lower_cf); 
!   NEXT_PASS (pass_lower_eh); 
!   NEXT_PASS (pass_build_cfg); 
    NEXT_PASS (pass_pre_expand);
!   NEXT_PASS (pass_tree_profile); 
!   NEXT_PASS (pass_cleanup_cfg);
! 
!   p = &all_passes;
    NEXT_PASS (pass_cleanup_cfg);
    NEXT_PASS (pass_init_datastructures);
    NEXT_PASS (pass_all_optimizations);
*************** init_tree_optimization_passes (void)
*** 384,390 ****
    NEXT_PASS (pass_may_alias);
    NEXT_PASS (pass_tail_recursion);
    NEXT_PASS (pass_ch);
! /*  NEXT_PASS (pass_profile); */
    NEXT_PASS (pass_sra);
    NEXT_PASS (pass_rename_ssa_copies);
    NEXT_PASS (pass_dominator);
--- 407,413 ----
    NEXT_PASS (pass_may_alias);
    NEXT_PASS (pass_tail_recursion);
    NEXT_PASS (pass_ch);
!   NEXT_PASS (pass_profile); 
    NEXT_PASS (pass_sra);
    NEXT_PASS (pass_rename_ssa_copies);
    NEXT_PASS (pass_dominator);
*************** init_tree_optimization_passes (void)
*** 430,443 ****
  
    p = &all_ipa_passes;
    NEXT_PASS (pass_ipa_inline);
! /* Disabled until this pass can work on low GIMPLE and use the CFG.
!   NEXT_PASS (pass_ipa_static);  */
    *p = NULL;
  
  #undef NEXT_PASS
  
    /* Register the passes with the tree dump code.  */
    /* HACK, PROP_* should go away.  */
    register_dump_files (all_passes, false, PROP_gimple_any
  					  | PROP_gimple_lcf
  					  | PROP_gimple_leh
--- 453,466 ----
  
    p = &all_ipa_passes;
    NEXT_PASS (pass_ipa_inline);
!   NEXT_PASS (pass_ipa_static);
    *p = NULL;
  
  #undef NEXT_PASS
  
    /* Register the passes with the tree dump code.  */
    /* HACK, PROP_* should go away.  */
+   register_dump_files (all_early_local_passes, false, 0);
    register_dump_files (all_passes, false, PROP_gimple_any
  					  | PROP_gimple_lcf
  					  | PROP_gimple_leh
*************** execute_pass_list (struct tree_opt_pass 
*** 628,633 ****
--- 651,670 ----
  }
  
  void
+ tree_early_local_passes (tree fn)
+ {
+   tree saved_current_function_decl = current_function_decl;
+ 
+   current_function_decl = fn;
+   push_cfun (DECL_STRUCT_FUNCTION (fn));
+   lower_function_body ();
+   execute_pass_list (all_early_local_passes, EXECUTE_HOOK, NULL, NULL);
+   current_function_decl = saved_current_function_decl;
+   compact_blocks ();
+   pop_cfun ();
+ }
+ 
+ void
  ipa_analyze_function (struct cgraph_node *node)
  {
     execute_pass_list (all_ipa_passes, ANALYZE_FUNCTION_HOOK, node, NULL);
Index: tree-pass.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-pass.h,v
retrieving revision 1.1.2.12.2.11
diff -c -3 -p -r1.1.2.12.2.11 tree-pass.h
*** tree-pass.h	17 Nov 2004 22:07:45 -0000	1.1.2.12.2.11
--- tree-pass.h	28 Nov 2004 17:45:45 -0000
*************** extern void ipa_analyze_variable (struct
*** 137,146 ****
--- 137,148 ----
  extern void ipa_modify_function (struct cgraph_node *node);
  extern void ipa_modify_variable (struct cgraph_varpool_node *vnode);
  extern void ipa_passes (void);
+ extern void tree_early_local_passes (tree decl);
  
  extern struct tree_opt_pass pass_mudflap_1;
  extern struct tree_opt_pass pass_mudflap_2;
  extern struct tree_opt_pass pass_remove_useless_stmts;
+ extern struct tree_opt_pass pass_lower_cf;
  extern struct tree_opt_pass pass_lower_eh;
  extern struct tree_opt_pass pass_build_cfg;
  extern struct tree_opt_pass pass_tree_profile;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]