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]

Scripted pass manager


Hi all,

This patch scripts the pass manager in a way similar to the the
options.c and options.h are generated. It shows no regressions against
the current mainline on x86_64-linux.

Rob
Index: working/gcc/gcc/cgraph.c
===================================================================
--- working/gcc/gcc/cgraph.c	(revision 130406)
+++ working/gcc/gcc/cgraph.c	(working copy)
@@ -83,6 +83,7 @@
 #include "tree-gimple.h"
 #include "tree-dump.h"
 #include "tree-flow.h"
+#include "passes-defs.h"
 
 static void cgraph_node_remove_callers (struct cgraph_node *node);
 static inline void cgraph_edge_remove_caller (struct cgraph_edge *e);
Index: working/gcc/gcc/tree-pass.h
===================================================================
--- working/gcc/gcc/tree-pass.h	(revision 130406)
+++ working/gcc/gcc/tree-pass.h	(working copy)
@@ -242,218 +242,6 @@
 
 extern void tree_lowering_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_refactor_eh;
-extern struct tree_opt_pass pass_lower_eh;
-extern struct tree_opt_pass pass_build_cfg;
-extern struct tree_opt_pass pass_tree_profile;
-extern struct tree_opt_pass pass_early_tree_profile;
-extern struct tree_opt_pass pass_cleanup_cfg;
-extern struct tree_opt_pass pass_referenced_vars;
-extern struct tree_opt_pass pass_sra;
-extern struct tree_opt_pass pass_sra_early;
-extern struct tree_opt_pass pass_tail_recursion;
-extern struct tree_opt_pass pass_tail_calls;
-extern struct tree_opt_pass pass_tree_loop;
-extern struct tree_opt_pass pass_tree_loop_init;
-extern struct tree_opt_pass pass_lim;
-extern struct tree_opt_pass pass_tree_unswitch;
-extern struct tree_opt_pass pass_predcom;
-extern struct tree_opt_pass pass_iv_canon;
-extern struct tree_opt_pass pass_scev_cprop;
-extern struct tree_opt_pass pass_empty_loop;
-extern struct tree_opt_pass pass_record_bounds;
-extern struct tree_opt_pass pass_if_conversion;
-extern struct tree_opt_pass pass_vectorize;
-extern struct tree_opt_pass pass_complete_unroll;
-extern struct tree_opt_pass pass_parallelize_loops;
-extern struct tree_opt_pass pass_loop_prefetch;
-extern struct tree_opt_pass pass_iv_optimize;
-extern struct tree_opt_pass pass_tree_loop_done;
-extern struct tree_opt_pass pass_ch;
-extern struct tree_opt_pass pass_ccp;
-extern struct tree_opt_pass pass_phi_only_cprop;
-extern struct tree_opt_pass pass_build_ssa;
-extern struct tree_opt_pass pass_del_ssa;
-extern struct tree_opt_pass pass_dominator;
-extern struct tree_opt_pass pass_dce;
-extern struct tree_opt_pass pass_dce_loop;
-extern struct tree_opt_pass pass_cd_dce;
-extern struct tree_opt_pass pass_merge_phi;
-extern struct tree_opt_pass pass_split_crit_edges;
-extern struct tree_opt_pass pass_pre;
-extern struct tree_opt_pass pass_profile;
-extern struct tree_opt_pass pass_lower_complex_O0;
-extern struct tree_opt_pass pass_lower_complex;
-extern struct tree_opt_pass pass_lower_vector;
-extern struct tree_opt_pass pass_lower_vector_ssa;
-extern struct tree_opt_pass pass_lower_omp;
-extern struct tree_opt_pass pass_expand_omp;
-extern struct tree_opt_pass pass_expand_omp_ssa;
-extern struct tree_opt_pass pass_object_sizes;
-extern struct tree_opt_pass pass_fold_builtins;
-extern struct tree_opt_pass pass_stdarg;
-extern struct tree_opt_pass pass_early_warn_uninitialized;
-extern struct tree_opt_pass pass_late_warn_uninitialized;
-extern struct tree_opt_pass pass_cse_reciprocals;
-extern struct tree_opt_pass pass_cse_sincos;
-extern struct tree_opt_pass pass_convert_to_rsqrt;
-extern struct tree_opt_pass pass_warn_function_return;
-extern struct tree_opt_pass pass_warn_function_noreturn;
-extern struct tree_opt_pass pass_cselim;
-extern struct tree_opt_pass pass_phiopt;
-extern struct tree_opt_pass pass_forwprop;
-extern struct tree_opt_pass pass_phiprop;
-extern struct tree_opt_pass pass_tree_ifcombine;
-extern struct tree_opt_pass pass_dse;
-extern struct tree_opt_pass pass_simple_dse;
-extern struct tree_opt_pass pass_nrv;
-extern struct tree_opt_pass pass_mark_used_blocks;
-extern struct tree_opt_pass pass_rename_ssa_copies;
-extern struct tree_opt_pass pass_expand;
-extern struct tree_opt_pass pass_rest_of_compilation;
-extern struct tree_opt_pass pass_sink_code;
-extern struct tree_opt_pass pass_fre;
-extern struct tree_opt_pass pass_linear_transform;
-extern struct tree_opt_pass pass_check_data_deps;
-extern struct tree_opt_pass pass_copy_prop;
-extern struct tree_opt_pass pass_store_ccp;
-extern struct tree_opt_pass pass_vrp;
-extern struct tree_opt_pass pass_create_structure_vars;
-extern struct tree_opt_pass pass_uncprop;
-extern struct tree_opt_pass pass_return_slot;
-extern struct tree_opt_pass pass_reassoc;
-extern struct tree_opt_pass pass_rebuild_cgraph_edges;
-extern struct tree_opt_pass pass_build_cgraph_edges;
-extern struct tree_opt_pass pass_reset_cc_flags;
-
-/* IPA Passes */
-extern struct tree_opt_pass pass_ipa_matrix_reorg;
-extern struct tree_opt_pass pass_ipa_cp;
-extern struct tree_opt_pass pass_ipa_inline;
-extern struct tree_opt_pass pass_ipa_early_inline;
-extern struct tree_opt_pass pass_ipa_reference;
-extern struct tree_opt_pass pass_ipa_pure_const;
-extern struct tree_opt_pass pass_ipa_type_escape;
-extern struct tree_opt_pass pass_ipa_pta;
-extern struct tree_opt_pass pass_ipa_struct_reorg;
-extern struct tree_opt_pass pass_early_local_passes;
-extern struct tree_opt_pass pass_ipa_increase_alignment;
-extern struct tree_opt_pass pass_ipa_function_and_variable_visibility;
-
-extern struct tree_opt_pass pass_all_optimizations;
-extern struct tree_opt_pass pass_cleanup_cfg_post_optimizing;
-extern struct tree_opt_pass pass_free_cfg_annotations;
-extern struct tree_opt_pass pass_free_datastructures;
-extern struct tree_opt_pass pass_init_datastructures;
-extern struct tree_opt_pass pass_fixup_cfg;
-
-extern struct tree_opt_pass pass_init_function;
-extern struct tree_opt_pass pass_jump;
-extern struct tree_opt_pass pass_rtl_eh;
-extern struct tree_opt_pass pass_initial_value_sets;
-extern struct tree_opt_pass pass_unshare_all_rtl;
-extern struct tree_opt_pass pass_instantiate_virtual_regs;
-extern struct tree_opt_pass pass_rtl_fwprop;
-extern struct tree_opt_pass pass_rtl_fwprop_addr;
-extern struct tree_opt_pass pass_jump2;
-extern struct tree_opt_pass pass_lower_subreg;
-extern struct tree_opt_pass pass_cse;
-extern struct tree_opt_pass pass_fast_rtl_dce;
-extern struct tree_opt_pass pass_ud_rtl_dce;
-extern struct tree_opt_pass pass_rtl_dce;
-extern struct tree_opt_pass pass_rtl_dse1;
-extern struct tree_opt_pass pass_rtl_dse2;
-extern struct tree_opt_pass pass_rtl_dse3;
-extern struct tree_opt_pass pass_gcse;
-extern struct tree_opt_pass pass_jump_bypass;
-extern struct tree_opt_pass pass_profiling;
-extern struct tree_opt_pass pass_rtl_ifcvt;
-extern struct tree_opt_pass pass_tracer;
-
-extern struct tree_opt_pass pass_into_cfg_layout_mode;
-extern struct tree_opt_pass pass_outof_cfg_layout_mode;
-
-extern struct tree_opt_pass pass_loop2;
-extern struct tree_opt_pass pass_rtl_loop_init;
-extern struct tree_opt_pass pass_rtl_move_loop_invariants;
-extern struct tree_opt_pass pass_rtl_unswitch;
-extern struct tree_opt_pass pass_rtl_unroll_and_peel_loops;
-extern struct tree_opt_pass pass_rtl_doloop;
-extern struct tree_opt_pass pass_rtl_loop_done;
-
-extern struct tree_opt_pass pass_web;
-extern struct tree_opt_pass pass_cse2;
-extern struct tree_opt_pass pass_df_initialize_opt;
-extern struct tree_opt_pass pass_df_initialize_no_opt;
-extern struct tree_opt_pass pass_regclass_init;
-extern struct tree_opt_pass pass_subregs_of_mode_init;
-extern struct tree_opt_pass pass_subregs_of_mode_finish;
-extern struct tree_opt_pass pass_inc_dec;
-extern struct tree_opt_pass pass_stack_ptr_mod;
-extern struct tree_opt_pass pass_initialize_regs;
-extern struct tree_opt_pass pass_combine;
-extern struct tree_opt_pass pass_if_after_combine;
-extern struct tree_opt_pass pass_partition_blocks;
-extern struct tree_opt_pass pass_match_asm_constraints;
-extern struct tree_opt_pass pass_regmove;
-extern struct tree_opt_pass pass_split_all_insns;
-extern struct tree_opt_pass pass_lower_subreg2;
-extern struct tree_opt_pass pass_mode_switching;
-extern struct tree_opt_pass pass_see;
-extern struct tree_opt_pass pass_sms;
-extern struct tree_opt_pass pass_sched;
-extern struct tree_opt_pass pass_local_alloc;
-extern struct tree_opt_pass pass_global_alloc;
-extern struct tree_opt_pass pass_postreload;
-extern struct tree_opt_pass pass_clean_state;
-extern struct tree_opt_pass pass_branch_prob;
-extern struct tree_opt_pass pass_value_profile_transformations;
-extern struct tree_opt_pass pass_postreload_cse;
-extern struct tree_opt_pass pass_gcse2;
-extern struct tree_opt_pass pass_split_after_reload;
-extern struct tree_opt_pass pass_branch_target_load_optimize1;
-extern struct tree_opt_pass pass_thread_prologue_and_epilogue;
-extern struct tree_opt_pass pass_stack_adjustments;
-extern struct tree_opt_pass pass_peephole2;
-extern struct tree_opt_pass pass_if_after_reload;
-extern struct tree_opt_pass pass_regrename;
-extern struct tree_opt_pass pass_cprop_hardreg;
-extern struct tree_opt_pass pass_reorder_blocks;
-extern struct tree_opt_pass pass_branch_target_load_optimize2;
-extern struct tree_opt_pass pass_leaf_regs;
-extern struct tree_opt_pass pass_split_before_sched2;
-extern struct tree_opt_pass pass_sched2;
-extern struct tree_opt_pass pass_stack_regs;
-extern struct tree_opt_pass pass_stack_regs_run;
-extern struct tree_opt_pass pass_df_finish;
-extern struct tree_opt_pass pass_compute_alignments;
-extern struct tree_opt_pass pass_duplicate_computed_gotos;
-extern struct tree_opt_pass pass_variable_tracking;
-extern struct tree_opt_pass pass_free_cfg;
-extern struct tree_opt_pass pass_machine_reorg;
-extern struct tree_opt_pass pass_cleanup_barriers;
-extern struct tree_opt_pass pass_delay_slots;
-extern struct tree_opt_pass pass_split_for_shorten_branches;
-extern struct tree_opt_pass pass_split_before_regstack;
-extern struct tree_opt_pass pass_convert_to_eh_region_ranges;
-extern struct tree_opt_pass pass_shorten_branches;
-extern struct tree_opt_pass pass_set_nothrow_function_flags;
-extern struct tree_opt_pass pass_final;
-extern struct tree_opt_pass pass_rtl_seqabstr;
-extern struct tree_opt_pass pass_release_ssa_names;
-extern struct tree_opt_pass pass_early_inline;
-extern struct tree_opt_pass pass_inline_parameters;
-extern struct tree_opt_pass pass_apply_inline;
-extern struct tree_opt_pass pass_all_early_optimizations;
-extern struct tree_opt_pass pass_update_address_taken;
-
-/* The root of the compilation pass tree, once constructed.  */
-extern struct tree_opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes;
-
 extern void execute_pass_list (struct tree_opt_pass *);
 extern void execute_ipa_pass_list (struct tree_opt_pass *);
 extern void print_current_pass (FILE *);
Index: working/gcc/gcc/passes-c.awk
===================================================================
--- working/gcc/gcc/passes-c.awk	(revision 0)
+++ working/gcc/gcc/passes-c.awk	(revision 0)
@@ -0,0 +1,119 @@
+#  Copyright (C) 2007 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3, or (at your option) any
+# later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# This Awk script reads in the option records generated from 
+# opt-gather.awk, combines the flags of duplicat options and generates a
+# C file.
+#
+# Usage: awk -f passes-c.awk passes.def > passes-defs.c
+
+func indent(nesting_depth)
+{
+	string = ""
+
+	while(nesting_depth > 0)
+	{
+		string = sprintf("  %s", string);
+		nesting_depth--;
+	}
+
+	return string;
+}
+
+BEGIN {
+	nesting_depth = 0
+	previous_line = ""
+
+	print "#include \"system.h\""
+	print "#include \"coretypes.h\""
+	print "#include \"tree-pass.h\""
+	print "#include \"passes.h\""
+	print "#include \"passes-defs.h\"\n"	
+	print "void\ninit_optimization_passes (void)"
+	print "{"
+	print indent(1) "struct tree_opt_pass **p;\n"
+	print indent(1) "#define NEXT_PASS(PASS)  (p = next_pass_1 (p, &PASS))\n"
+}
+
+# Print out the pass list
+{
+	if ($1 == "#" || $1 == "")
+	{
+		next # Ignore comments and blank lines
+	}
+	else if ($1 == "{")
+	{
+		if(nesting_depth > 0)
+		{
+			indent_string = indent(nesting_depth);
+			print indent_string "{"
+			print indent_string "  struct tree_opt_pass **p = &" previous_line ".sub;";
+		}
+		else
+		{	
+			print "  p = &" previous_line ";"
+		}
+
+		nesting_depth++;
+	}
+	else if($1 == "}")
+	{
+		if(nesting_depth > 1)
+		{
+			nesting_depth--;
+			indent_string = indent(nesting_depth);
+			print indent_string "}";
+		}
+		else
+		{
+			print "  *p = NULL;\n\n"
+			nesting_depth--;
+		}
+	}
+	else
+	{
+		# Record this line, in case the next line contains
+		# an opening brace.
+		previous_line = $1;
+
+		# Only make it a pass if the nesting_depth is > 0
+		if(nesting_depth > 0)
+		{
+			indent_string = indent(nesting_depth);
+			print indent_string "NEXT_PASS (" $1 ");";
+		}
+	}
+}
+
+END {
+
+print "#undef NEXT_PASS\n"
+
+indent_string = indent(1);
+
+# Register the passes with the tree dump code.
+print indent_string "register_dump_files (all_lowering_passes, false, PROP_gimple_any);"
+print indent_string "all_lowering_passes->todo_flags_start |= TODO_set_props; "
+print indent_string "register_dump_files (all_ipa_passes, true,\n\
+		       PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh \n\
+		       | PROP_cfg);"
+print indent_string "register_dump_files (all_passes, false,\n\
+		       PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh\n\
+		       | PROP_cfg);"
+
+# Print the final closing brace
+print "}"
+}
Index: working/gcc/gcc/cgraphunit.c
===================================================================
--- working/gcc/gcc/cgraphunit.c	(revision 130406)
+++ working/gcc/gcc/cgraphunit.c	(working copy)
@@ -149,6 +149,7 @@
 #include "ipa-prop.h"
 #include "tree-gimple.h"
 #include "tree-pass.h"
+#include "passes-defs.h"
 #include "output.h"
 
 static void cgraph_expand_all_functions (void);
Index: working/gcc/gcc/passes.def
===================================================================
--- working/gcc/gcc/passes.def	(revision 0)
+++ working/gcc/gcc/passes.def	(revision 0)
@@ -0,0 +1,350 @@
+# This file contains definitions of the passes to be performed by
+# the compiler.
+
+#   Copyright (C) 2007 Free Software Foundation, Inc.
+
+# This file is part of GCC.
+
+# GCC is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 3, or (at your option) any later
+# version.
+
+# GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+
+# Define the structure of the passes
+
+# The sequencing of passes is driven by
+# the cgraph routines:
+
+# cgraph_finalize_compilation_unit ()
+#      for each node N in the cgraph
+#	   cgraph_analyze_function (N)
+#	       cgraph_lower_function (N) -> all_lowering_passes
+
+#  If we are optimizing, cgraph_optimize is then invoked:
+
+#  cgraph_optimize ()
+#      ipa_passes () 			-> all_ipa_passes
+#      cgraph_expand_all_functions ()
+#          for each node N in the cgraph
+#	       cgraph_expand_function (N)
+#		  tree_rest_of_compilation (DECL (N))  -> all_passes
+
+# All passes needed to lower the function into shape optimizers can
+# operate on.  These passes are always run first on the function, but
+# backend might produce already lowered functions that are not processed
+# by these passes. 
+
+all_lowering_passes
+{
+  pass_remove_useless_stmts 
+  pass_mudflap_1
+  pass_lower_omp
+  pass_lower_cf
+  pass_refactor_eh
+  pass_lower_eh
+  pass_build_cfg
+  pass_lower_complex_O0
+  pass_lower_vector
+  pass_warn_function_return
+  pass_build_cgraph_edges
+  pass_inline_parameters
+}
+
+# Interprocedural optimization passes. 
+# All these passes are ignored in -fno-unit-at-a-time
+# except for subpasses of early_local_passes. 
+
+all_ipa_passes
+{
+  pass_ipa_function_and_variable_visibility
+  pass_ipa_early_inline
+  {
+    pass_early_inline
+    pass_inline_parameters
+    pass_rebuild_cgraph_edges
+  }
+  pass_early_local_passes
+  {
+    pass_tree_profile
+    pass_cleanup_cfg
+    pass_init_datastructures
+    pass_expand_omp
+    pass_all_early_optimizations
+    {
+      pass_referenced_vars
+      pass_reset_cc_flags
+      pass_build_ssa
+      pass_expand_omp_ssa
+      pass_early_warn_uninitialized
+      pass_rebuild_cgraph_edges
+      pass_early_inline
+      pass_cleanup_cfg
+      pass_rename_ssa_copies
+      pass_ccp
+      pass_forwprop
+      pass_update_address_taken
+      pass_simple_dse
+      pass_sra_early
+      pass_copy_prop
+      pass_merge_phi
+      pass_dce
+      pass_update_address_taken
+      pass_simple_dse
+      pass_tail_recursion
+      pass_profile
+      pass_release_ssa_names
+    }
+    pass_rebuild_cgraph_edges
+    pass_inline_parameters
+  }
+  pass_ipa_increase_alignment
+  pass_ipa_matrix_reorg
+  pass_ipa_cp
+  pass_ipa_inline
+  pass_ipa_reference
+  pass_ipa_pure_const
+  pass_ipa_type_escape
+  pass_ipa_pta
+  pass_ipa_struct_reorg
+}
+
+# These passes are run after IPA passes on every function that is being
+# output to the assembler file.
+all_passes
+{
+  pass_apply_inline
+  pass_all_optimizations
+  {
+    pass_create_structure_vars
+    pass_return_slot
+    pass_rename_ssa_copies
+
+    # Initial scalar cleanups.
+    pass_ccp
+    pass_phiprop
+    pass_fre
+    pass_dce
+    pass_forwprop
+    pass_copy_prop
+    pass_merge_phi
+    pass_vrp
+    pass_dce
+    pass_cselim
+    pass_dominator
+
+    # The only const/copy propagation opportunities left after
+    # DOM should be due to degenerate PHI nodes.  So rather than
+    # run the full propagators, run a specialized pass which
+    # only examines PHIs to discover const/copy propagation
+    # opportunities.
+
+    pass_phi_only_cprop
+    pass_tree_ifcombine
+    pass_phiopt
+    pass_tail_recursion
+    pass_ch
+    pass_stdarg
+    pass_lower_complex
+    pass_sra
+    pass_rename_ssa_copies
+    pass_dominator
+
+    # The only const/copy propagation opportunities left after
+    # DOM should be due to degenerate PHI nodes.  So rather than
+    # run the full propagators, run a specialized pass which
+    # only examines PHIs to discover const/copy propagation
+    # opportunities.
+
+    pass_phi_only_cprop
+
+    pass_reassoc
+    pass_dce
+    pass_dse
+    pass_forwprop
+    pass_phiopt
+    pass_object_sizes
+    pass_store_ccp
+    pass_copy_prop
+    pass_fold_builtins
+    pass_cse_sincos
+    pass_split_crit_edges
+    pass_pre
+    pass_sink_code
+    pass_tree_loop
+    {
+      pass_tree_loop_init
+      pass_copy_prop
+      pass_dce_loop
+      pass_lim
+      pass_predcom
+      pass_tree_unswitch
+      pass_scev_cprop
+      pass_empty_loop
+      pass_record_bounds
+      pass_check_data_deps
+      pass_linear_transform
+      pass_iv_canon
+      pass_if_conversion
+      pass_vectorize
+      {
+        pass_lower_vector_ssa
+        pass_dce_loop
+      }
+      pass_complete_unroll
+      pass_parallelize_loops
+      pass_loop_prefetch
+      pass_iv_optimize
+      pass_tree_loop_done
+    }
+    pass_cse_reciprocals
+    pass_convert_to_rsqrt
+    pass_reassoc
+    pass_vrp
+    pass_dominator
+      
+    # The only const/copy propagation opportunities left after
+    # DOM should be due to degenerate PHI nodes.  So rather than
+    # run the full propagators, run a specialized pass which
+    # only examines PHIs to discover const/copy propagation
+    # opportunities.
+
+    pass_phi_only_cprop
+
+    pass_cd_dce
+    pass_tracer
+
+    # FIXME: If DCE is not run before checking for uninitialized uses,
+    # we may get false warnings (e.g., testsuite/gcc.dg/uninit-5.c).
+    # However, this also causes us to misdiagnose cases that should be
+    # real warnings (e.g., testsuite/gcc.dg/pr18501.c).
+	 
+    # To fix the false positives in uninit-5.c, we would have to
+    # account for the predicates protecting the set and the use of each
+    # variable.  Using a representation like Gated Single Assignment
+    # may help.
+
+    pass_late_warn_uninitialized
+    pass_dse
+    pass_forwprop
+    pass_phiopt
+    pass_tail_calls
+    pass_rename_ssa_copies
+    pass_uncprop
+    pass_del_ssa
+    pass_nrv
+    pass_mark_used_blocks
+    pass_cleanup_cfg_post_optimizing
+  }
+  pass_warn_function_noreturn
+  pass_free_datastructures
+  pass_mudflap_2
+  pass_free_cfg_annotations
+  pass_expand
+  pass_rest_of_compilation
+  {
+    pass_init_function
+    pass_jump
+    pass_rtl_eh
+    pass_initial_value_sets
+    pass_unshare_all_rtl
+    pass_instantiate_virtual_regs
+    pass_into_cfg_layout_mode
+    pass_jump2
+    pass_lower_subreg
+    pass_df_initialize_opt
+    pass_cse
+    pass_rtl_fwprop
+    pass_gcse
+    pass_rtl_ifcvt
+    
+    # Perform loop optimizations.  It might be better to do them a bit
+    # sooner, but we want the profile feedback to work more
+    # efficiently.
+    pass_loop2
+	{
+      pass_rtl_loop_init
+      pass_rtl_move_loop_invariants
+      pass_rtl_unswitch
+      pass_rtl_unroll_and_peel_loops
+      pass_rtl_doloop
+      pass_rtl_loop_done
+	}
+    pass_web
+    pass_jump_bypass
+    pass_cse2
+    pass_rtl_dse1
+    pass_rtl_fwprop_addr
+    pass_regclass_init
+    pass_inc_dec
+    pass_initialize_regs
+    pass_outof_cfg_layout_mode
+    pass_ud_rtl_dce
+    pass_combine
+    pass_if_after_combine
+    pass_partition_blocks
+    pass_regmove
+    pass_split_all_insns
+    pass_lower_subreg2
+    pass_df_initialize_no_opt
+    pass_stack_ptr_mod
+    pass_mode_switching
+    pass_see
+    pass_match_asm_constraints
+    pass_sms
+    pass_sched
+    pass_subregs_of_mode_init
+    pass_local_alloc
+    pass_global_alloc
+    pass_subregs_of_mode_finish
+    pass_postreload
+    {
+      pass_postreload_cse
+      pass_gcse2
+      pass_split_after_reload
+      pass_branch_target_load_optimize1
+      pass_thread_prologue_and_epilogue
+      pass_rtl_dse2
+      pass_rtl_seqabstr
+      pass_stack_adjustments
+      pass_peephole2
+      pass_if_after_reload
+      pass_regrename
+      pass_cprop_hardreg
+      pass_fast_rtl_dce
+      pass_reorder_blocks
+      pass_branch_target_load_optimize2
+      pass_leaf_regs
+      pass_split_before_sched2
+      pass_sched2
+      pass_stack_regs
+      {
+        pass_split_before_regstack
+        pass_stack_regs_run
+      }
+      pass_compute_alignments
+      pass_duplicate_computed_gotos
+      pass_variable_tracking
+      pass_free_cfg
+      pass_machine_reorg
+      pass_cleanup_barriers
+      pass_delay_slots
+      pass_split_for_shorten_branches
+      pass_convert_to_eh_region_ranges
+      pass_shorten_branches
+      pass_set_nothrow_function_flags
+      pass_final
+    }
+    pass_df_finish
+  }
+  pass_clean_state
+}
Index: working/gcc/gcc/global.c
===================================================================
--- working/gcc/gcc/global.c	(revision 130406)
+++ working/gcc/gcc/global.c	(working copy)
@@ -37,6 +37,7 @@
 #include "output.h"
 #include "toplev.h"
 #include "tree-pass.h"
+#include "passes-defs.h"
 #include "timevar.h"
 #include "df.h"
 #include "vecprim.h"
Index: working/gcc/gcc/tree-optimize.c
===================================================================
--- working/gcc/gcc/tree-optimize.c	(revision 130406)
+++ working/gcc/gcc/tree-optimize.c	(working copy)
@@ -48,6 +48,7 @@
 #include "graph.h"
 #include "cfgloop.h"
 #include "except.h"
+#include "passes-defs.h"
 
 
 /* Gate: execute, or not, all of the non-trivial optimizations.  */
Index: working/gcc/gcc/passes-h.awk
===================================================================
--- working/gcc/gcc/passes-h.awk	(revision 0)
+++ working/gcc/gcc/passes-h.awk	(revision 0)
@@ -0,0 +1,87 @@
+#  Copyright (C) 2007 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3, or (at your option) any
+# later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# This Awk script reads in the option records generated from 
+# opt-gather.awk, combines the flags of duplicat options and generates a
+# C file.
+#
+# Usage: awk -f passes-h.awk passes.def > passes-defs.h
+
+BEGIN {
+	nesting_depth = 0
+	previous_line = ""
+	pass_tree_roots = ""
+	root_node_count = 0;
+
+	print  "#ifndef GCC_PASSES_DEFS_H"
+	print "#define GCC_PASSES_DEFS_H 1\n"
+
+	print "#include \"tree-pass.h\"\n"
+}
+
+# Print out the pass list
+{
+	if ($1 == "#" || $1 == "")
+	{
+		next # Ignore comments and blank lines
+	}
+	else if ($1 == "{")
+	{
+		# If we are at the top level then the lines preceeding a
+		# brace are the nodes which will be the root of the
+		# compilation tree.
+		if(nesting_depth == 0)
+		{	
+			# If this is not the first one then add a comma before appending
+			if(pass_root_count > 0)
+			{
+				pass_tree_roots = sprintf("%s, ", pass_tree_roots);
+			}
+			
+			pass_tree_roots = sprintf("%s*%s", pass_tree_roots, previous_line);
+
+			pass_root_count++;
+		}
+
+		nesting_depth++;
+	}
+	else if($1 == "}")
+	{
+		nesting_depth--;
+	}
+	else
+	{
+		# Record this line, in case the next line contains
+		# an opening brace.
+		previous_line = $1;
+
+		if(nesting_depth > 0)
+		{
+			print "extern struct tree_opt_pass " $1 ";"
+		}
+	}
+}
+
+END {
+
+	print "\n";
+	print "extern struct tree_opt_pass " pass_tree_roots ";\n"
+
+	# Declare some functions from passes.c
+	print "struct tree_opt_pass **next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass);\n"
+
+	print "#endif"
+}
Index: working/gcc/gcc/Makefile.in
===================================================================
--- working/gcc/gcc/Makefile.in	(revision 130406)
+++ working/gcc/gcc/Makefile.in	(working copy)
@@ -1094,6 +1094,7 @@
 	opts.o \
 	params.o \
 	passes.o \
+	passes-defs.o \
 	pointer-set.o \
 	postreload-gcse.o \
 	postreload.o \
@@ -2214,7 +2215,7 @@
    $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \
    $(FLAGS_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) toplev.h \
    $(FUNCTION_H) langhooks.h $(FLAGS_H) $(CGRAPH_H) $(TREE_INLINE_H) \
-   tree-mudflap.h $(GGC_H) $(CGRAPH_H) tree-pass.h $(CFGLOOP_H) \
+   tree-mudflap.h $(GGC_H) $(CGRAPH_H) tree-pass.h passes-defs.h $(CFGLOOP_H) \
    $(BASIC_BLOCK_H) graph.h hard-reg-set.h
 c-gimplify.o : c-gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
    $(C_TREE_H) $(C_COMMON_H) $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(VARRAY_H) \
@@ -2333,6 +2334,15 @@
 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
 	  -c $(srcdir)/toplev.c $(OUTPUT_OPTION)
 
+passes-defs.o : passes-defs.c passes-defs.h
+	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(OUTPUT_OPTION) -c passes-defs.c
+
+passes-defs.c : $(srcdir)/passes.def $(srcdir)/passes-c.awk passes-defs.h
+	$(AWK) -f $(srcdir)/passes-c.awk  < $< > $@
+
+passes-defs.h : $(srcdir)/passes.def $(srcdir)/passes-h.awk
+	$(AWK) -f $(srcdir)/passes-h.awk  < $< > $@
+
 passes.o : passes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
    $(RTL_H) $(FUNCTION_H) $(FLAGS_H) xcoffout.h input.h $(INSN_ATTR_H) output.h \
    $(DIAGNOSTIC_H) debug.h insn-config.h intl.h $(RECOG_H) toplev.h \
@@ -2340,9 +2350,9 @@
    graph.h except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \
    $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
    langhooks.h insn-flags.h $(CFGLAYOUT_H) $(REAL_H) $(CFGLOOP_H) \
-   hosthooks.h $(CGRAPH_H) $(COVERAGE_H) tree-pass.h $(TREE_DUMP_H) \
+   hosthooks.h $(CGRAPH_H) $(COVERAGE_H) tree-pass.h passes-defs.h $(TREE_DUMP_H) \
    $(GGC_H) $(INTEGRATE_H) $(CPPLIB_H) opts.h $(TREE_FLOW_H) $(TREE_INLINE_H) \
-   gt-passes.h $(DF_H) $(PREDICT_H)
+   gt-passes.h $(DF_H) $(PREDICT_H) passes.h
 
 main.o : main.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h
 
@@ -2468,13 +2478,13 @@
 cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
    langhooks.h toplev.h $(FLAGS_H) $(GGC_H) $(TARGET_H) $(CGRAPH_H) \
    gt-cgraph.h output.h intl.h $(BASIC_BLOCK_H) debug.h $(HASHTAB_H) \
-   $(TREE_INLINE_H) $(VARRAY_H) $(TREE_DUMP_H) $(TREE_FLOW_H)
+   $(TREE_INLINE_H) $(VARRAY_H) $(TREE_DUMP_H) $(TREE_FLOW_H) passes-defs.h
 cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(TREE_H) langhooks.h $(TREE_INLINE_H) toplev.h $(FLAGS_H) $(GGC_H) \
    $(TARGET_H) $(CGRAPH_H) intl.h pointer-set.h $(FUNCTION_H) $(TREE_GIMPLE_H) \
    $(TREE_FLOW_H) tree-pass.h $(C_COMMON_H) debug.h $(DIAGNOSTIC_H) \
    $(FIBHEAP_H) output.h $(PARAMS_H) $(RTL_H) $(TIMEVAR_H) ipa-prop.h \
-   gt-cgraphunit.h 
+   gt-cgraphunit.h  passes-defs.h
 cgraphbuild.o : cgraphbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(TREE_H) langhooks.h $(CGRAPH_H) intl.h pointer-set.h $(TREE_GIMPLE_H) \
    $(TREE_FLOW_H) tree-pass.h
@@ -2713,7 +2723,7 @@
 global.o : global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    $(FLAGS_H) reload.h $(FUNCTION_H) $(RECOG_H) $(REGS_H) hard-reg-set.h \
    insn-config.h output.h toplev.h $(TM_P_H) $(MACHMODE_H) tree-pass.h \
-   $(TIMEVAR_H) vecprim.h $(DF_H) $(DBGCNT_H) $(RA_H)
+   $(TIMEVAR_H) vecprim.h $(DF_H) $(DBGCNT_H) $(RA_H) passes-defs.h
 ra-conflict.o : ra-conflict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    $(FLAGS_H) reload.h $(FUNCTION_H) $(RECOG_H) $(REGS_H) hard-reg-set.h \
    insn-config.h output.h toplev.h $(TM_P_H) $(MACHMODE_H) tree-pass.h \
Index: working/gcc/gcc/passes.c
===================================================================
--- working/gcc/gcc/passes.c	(revision 130406)
+++ working/gcc/gcc/passes.c	(working copy)
@@ -84,6 +84,8 @@
 #include "tree-dump.h"
 #include "df.h"
 #include "predict.h"
+#include "passes-defs.h"
+#include "passes.h"
 
 #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
 #include "dwarf2out.h"
@@ -397,7 +399,7 @@
    properties that are guaranteed to be available at the beginning of
    the pipeline.  */
 
-static void 
+void
 register_dump_files (struct tree_opt_pass *pass, bool ipa, int properties)
 {
   pass->properties_required |= properties;
@@ -407,7 +409,7 @@
 /* Add a pass to the pass list. Duplicate the pass if it's already
    in the list.  */
 
-static struct tree_opt_pass **
+struct tree_opt_pass **
 next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass)
 {
   /* A nonzero static_pass_number indicates that the
@@ -446,354 +448,9 @@
 }
 
 
-/* Construct the pass tree.  The sequencing of passes is driven by
-   the cgraph routines:
 
-   cgraph_finalize_compilation_unit ()
-       for each node N in the cgraph
-	   cgraph_analyze_function (N)
-	       cgraph_lower_function (N) -> all_lowering_passes
 
-   If we are optimizing, cgraph_optimize is then invoked:
 
-   cgraph_optimize ()
-       ipa_passes () 			-> all_ipa_passes
-       cgraph_expand_all_functions ()
-           for each node N in the cgraph
-	       cgraph_expand_function (N)
-		  tree_rest_of_compilation (DECL (N))  -> all_passes
-*/
-
-void
-init_optimization_passes (void)
-{
-  struct tree_opt_pass **p;
-
-#define NEXT_PASS(PASS)  (p = next_pass_1 (p, &PASS))
-
- /* All passes needed to lower the function into shape optimizers can
-    operate on.  These passes are always run first on the function, but
-    backend might produce already lowered functions that are not processed
-    by these passes.  */
-  p = &all_lowering_passes;
-  NEXT_PASS (pass_remove_useless_stmts);
-  NEXT_PASS (pass_mudflap_1);
-  NEXT_PASS (pass_lower_omp);
-  NEXT_PASS (pass_lower_cf);
-  NEXT_PASS (pass_refactor_eh);
-  NEXT_PASS (pass_lower_eh);
-  NEXT_PASS (pass_build_cfg);
-  NEXT_PASS (pass_lower_complex_O0);
-  NEXT_PASS (pass_lower_vector);
-  NEXT_PASS (pass_warn_function_return);
-  NEXT_PASS (pass_build_cgraph_edges);
-  NEXT_PASS (pass_inline_parameters);
-  *p = NULL;
-
-  /* Interprocedural optimization passes. 
-     All these passes are ignored in -fno-unit-at-a-time
-     except for subpasses of early_local_passes.  */
-  p = &all_ipa_passes;
-  NEXT_PASS (pass_ipa_function_and_variable_visibility);
-  NEXT_PASS (pass_ipa_early_inline);
-    {
-      struct tree_opt_pass **p = &pass_ipa_early_inline.sub;
-      NEXT_PASS (pass_early_inline);
-      NEXT_PASS (pass_inline_parameters);
-      NEXT_PASS (pass_rebuild_cgraph_edges);
-    }
-  NEXT_PASS (pass_early_local_passes);
-    {
-      struct tree_opt_pass **p = &pass_early_local_passes.sub;
-      NEXT_PASS (pass_tree_profile);
-      NEXT_PASS (pass_cleanup_cfg);
-      NEXT_PASS (pass_init_datastructures);
-      NEXT_PASS (pass_expand_omp);
-      NEXT_PASS (pass_all_early_optimizations);
-	{
-	  struct tree_opt_pass **p = &pass_all_early_optimizations.sub;
-	  NEXT_PASS (pass_referenced_vars);
-	  NEXT_PASS (pass_reset_cc_flags);
-	  NEXT_PASS (pass_build_ssa);
-	  NEXT_PASS (pass_expand_omp_ssa);
-	  NEXT_PASS (pass_early_warn_uninitialized);
-	  NEXT_PASS (pass_rebuild_cgraph_edges);
-	  NEXT_PASS (pass_early_inline);
-	  NEXT_PASS (pass_cleanup_cfg);
-	  NEXT_PASS (pass_rename_ssa_copies);
-	  NEXT_PASS (pass_ccp);
-	  NEXT_PASS (pass_forwprop);
-	  NEXT_PASS (pass_update_address_taken);
-	  NEXT_PASS (pass_simple_dse);
-	  NEXT_PASS (pass_sra_early);
-	  NEXT_PASS (pass_copy_prop);
-	  NEXT_PASS (pass_merge_phi);
-	  NEXT_PASS (pass_dce);
-	  NEXT_PASS (pass_update_address_taken);
-	  NEXT_PASS (pass_simple_dse);
-	  NEXT_PASS (pass_tail_recursion);
-          NEXT_PASS (pass_profile);
-	  NEXT_PASS (pass_release_ssa_names);
-	}
-      NEXT_PASS (pass_rebuild_cgraph_edges);
-      NEXT_PASS (pass_inline_parameters);
-    }
-  NEXT_PASS (pass_ipa_increase_alignment);
-  NEXT_PASS (pass_ipa_matrix_reorg);
-  NEXT_PASS (pass_ipa_cp);
-  NEXT_PASS (pass_ipa_inline);
-  NEXT_PASS (pass_ipa_reference);
-  NEXT_PASS (pass_ipa_pure_const); 
-  NEXT_PASS (pass_ipa_type_escape);
-  NEXT_PASS (pass_ipa_pta);
-  NEXT_PASS (pass_ipa_struct_reorg);  
-  *p = NULL;
-
-  /* These passes are run after IPA passes on every function that is being
-     output to the assembler file.  */
-  p = &all_passes;
-  NEXT_PASS (pass_apply_inline);
-  NEXT_PASS (pass_all_optimizations);
-    {
-      struct tree_opt_pass **p = &pass_all_optimizations.sub;
-      NEXT_PASS (pass_create_structure_vars);
-      NEXT_PASS (pass_return_slot);
-      NEXT_PASS (pass_rename_ssa_copies);
-
-      /* Initial scalar cleanups.  */
-      NEXT_PASS (pass_ccp);
-      NEXT_PASS (pass_phiprop);
-      NEXT_PASS (pass_fre);
-      NEXT_PASS (pass_dce);
-      NEXT_PASS (pass_forwprop);
-      NEXT_PASS (pass_copy_prop);
-      NEXT_PASS (pass_merge_phi);
-      NEXT_PASS (pass_vrp);
-      NEXT_PASS (pass_dce);
-      NEXT_PASS (pass_cselim);
-      NEXT_PASS (pass_dominator);
-      /* The only const/copy propagation opportunities left after
-	 DOM should be due to degenerate PHI nodes.  So rather than
-	 run the full propagators, run a specialized pass which
-	 only examines PHIs to discover const/copy propagation
-	 opportunities.  */
-      NEXT_PASS (pass_phi_only_cprop);
-      NEXT_PASS (pass_tree_ifcombine);
-      NEXT_PASS (pass_phiopt);
-      NEXT_PASS (pass_tail_recursion);
-      NEXT_PASS (pass_ch);
-      NEXT_PASS (pass_stdarg);
-      NEXT_PASS (pass_lower_complex);
-      NEXT_PASS (pass_sra);
-      NEXT_PASS (pass_rename_ssa_copies);
-      NEXT_PASS (pass_dominator);
-
-      /* The only const/copy propagation opportunities left after
-	 DOM should be due to degenerate PHI nodes.  So rather than
-	 run the full propagators, run a specialized pass which
-	 only examines PHIs to discover const/copy propagation
-	 opportunities.  */
-      NEXT_PASS (pass_phi_only_cprop);
-
-      NEXT_PASS (pass_reassoc);
-      NEXT_PASS (pass_dce);
-      NEXT_PASS (pass_dse);
-      NEXT_PASS (pass_forwprop);
-      NEXT_PASS (pass_phiopt);
-      NEXT_PASS (pass_object_sizes);
-      NEXT_PASS (pass_store_ccp);
-      NEXT_PASS (pass_copy_prop);
-      NEXT_PASS (pass_fold_builtins);
-      NEXT_PASS (pass_cse_sincos);
-      NEXT_PASS (pass_split_crit_edges);
-      NEXT_PASS (pass_pre);
-      NEXT_PASS (pass_sink_code);
-      NEXT_PASS (pass_tree_loop);
-	{
-	  struct tree_opt_pass **p = &pass_tree_loop.sub;
-	  NEXT_PASS (pass_tree_loop_init);
-	  NEXT_PASS (pass_copy_prop);
-	  NEXT_PASS (pass_dce_loop);
-	  NEXT_PASS (pass_lim);
-	  NEXT_PASS (pass_predcom);
-	  NEXT_PASS (pass_tree_unswitch);
-	  NEXT_PASS (pass_scev_cprop);
-	  NEXT_PASS (pass_empty_loop);
-	  NEXT_PASS (pass_record_bounds);
-	  NEXT_PASS (pass_check_data_deps);
-	  NEXT_PASS (pass_linear_transform);
-	  NEXT_PASS (pass_iv_canon);
-	  NEXT_PASS (pass_if_conversion);
-	  NEXT_PASS (pass_vectorize);
-	    {
-	      struct tree_opt_pass **p = &pass_vectorize.sub;
-	      NEXT_PASS (pass_lower_vector_ssa);
-	      NEXT_PASS (pass_dce_loop);
-	    }
-	  NEXT_PASS (pass_complete_unroll);
-	  NEXT_PASS (pass_parallelize_loops);
-	  NEXT_PASS (pass_loop_prefetch);
-	  NEXT_PASS (pass_iv_optimize);
-	  NEXT_PASS (pass_tree_loop_done);
-	}
-      NEXT_PASS (pass_cse_reciprocals);
-      NEXT_PASS (pass_convert_to_rsqrt);
-      NEXT_PASS (pass_reassoc);
-      NEXT_PASS (pass_vrp);
-      NEXT_PASS (pass_dominator);
-      
-      /* The only const/copy propagation opportunities left after
-	 DOM should be due to degenerate PHI nodes.  So rather than
-	 run the full propagators, run a specialized pass which
-	 only examines PHIs to discover const/copy propagation
-	 opportunities.  */
-      NEXT_PASS (pass_phi_only_cprop);
-
-      NEXT_PASS (pass_cd_dce);
-      NEXT_PASS (pass_tracer);
-
-      /* FIXME: If DCE is not run before checking for uninitialized uses,
-	 we may get false warnings (e.g., testsuite/gcc.dg/uninit-5.c).
-	 However, this also causes us to misdiagnose cases that should be
-	 real warnings (e.g., testsuite/gcc.dg/pr18501.c).
-	 
-	 To fix the false positives in uninit-5.c, we would have to
-	 account for the predicates protecting the set and the use of each
-	 variable.  Using a representation like Gated Single Assignment
-	 may help.  */
-      NEXT_PASS (pass_late_warn_uninitialized);
-      NEXT_PASS (pass_dse);
-      NEXT_PASS (pass_forwprop);
-      NEXT_PASS (pass_phiopt);
-      NEXT_PASS (pass_tail_calls);
-      NEXT_PASS (pass_rename_ssa_copies);
-      NEXT_PASS (pass_uncprop);
-      NEXT_PASS (pass_del_ssa);
-      NEXT_PASS (pass_nrv);
-      NEXT_PASS (pass_mark_used_blocks);
-      NEXT_PASS (pass_cleanup_cfg_post_optimizing);
-    }
-  NEXT_PASS (pass_warn_function_noreturn);
-  NEXT_PASS (pass_free_datastructures);
-  NEXT_PASS (pass_mudflap_2);
-  NEXT_PASS (pass_free_cfg_annotations);
-  NEXT_PASS (pass_expand);
-  NEXT_PASS (pass_rest_of_compilation);
-    {
-      struct tree_opt_pass **p = &pass_rest_of_compilation.sub;
-      NEXT_PASS (pass_init_function);
-      NEXT_PASS (pass_jump);
-      NEXT_PASS (pass_rtl_eh);
-      NEXT_PASS (pass_initial_value_sets);
-      NEXT_PASS (pass_unshare_all_rtl);
-      NEXT_PASS (pass_instantiate_virtual_regs);
-      NEXT_PASS (pass_into_cfg_layout_mode);
-      NEXT_PASS (pass_jump2);
-      NEXT_PASS (pass_lower_subreg);
-      NEXT_PASS (pass_df_initialize_opt);
-      NEXT_PASS (pass_cse);
-      NEXT_PASS (pass_rtl_fwprop);
-      NEXT_PASS (pass_gcse);
-      NEXT_PASS (pass_rtl_ifcvt);
-      /* Perform loop optimizations.  It might be better to do them a bit
-	 sooner, but we want the profile feedback to work more
-	 efficiently.  */
-      NEXT_PASS (pass_loop2);
-	{
-	  struct tree_opt_pass **p = &pass_loop2.sub;
-	  NEXT_PASS (pass_rtl_loop_init);
-	  NEXT_PASS (pass_rtl_move_loop_invariants);
-	  NEXT_PASS (pass_rtl_unswitch);
-	  NEXT_PASS (pass_rtl_unroll_and_peel_loops);
-	  NEXT_PASS (pass_rtl_doloop);
-	  NEXT_PASS (pass_rtl_loop_done);
-	  *p = NULL;
-	}
-      NEXT_PASS (pass_web);
-      NEXT_PASS (pass_jump_bypass);
-      NEXT_PASS (pass_cse2);
-      NEXT_PASS (pass_rtl_dse1);
-      NEXT_PASS (pass_rtl_fwprop_addr);
-      NEXT_PASS (pass_regclass_init);
-      NEXT_PASS (pass_inc_dec);
-      NEXT_PASS (pass_initialize_regs);
-      NEXT_PASS (pass_outof_cfg_layout_mode);
-      NEXT_PASS (pass_ud_rtl_dce);
-      NEXT_PASS (pass_combine);
-      NEXT_PASS (pass_if_after_combine);
-      NEXT_PASS (pass_partition_blocks);
-      NEXT_PASS (pass_regmove);
-      NEXT_PASS (pass_split_all_insns);
-      NEXT_PASS (pass_lower_subreg2);
-      NEXT_PASS (pass_df_initialize_no_opt);
-      NEXT_PASS (pass_stack_ptr_mod);
-      NEXT_PASS (pass_mode_switching);
-      NEXT_PASS (pass_see);
-      NEXT_PASS (pass_match_asm_constraints);
-      NEXT_PASS (pass_sms);
-      NEXT_PASS (pass_sched);
-      NEXT_PASS (pass_subregs_of_mode_init);
-      NEXT_PASS (pass_local_alloc);
-      NEXT_PASS (pass_global_alloc);
-      NEXT_PASS (pass_subregs_of_mode_finish);
-      NEXT_PASS (pass_postreload);
-	{
-	  struct tree_opt_pass **p = &pass_postreload.sub;
-	  NEXT_PASS (pass_postreload_cse);
-	  NEXT_PASS (pass_gcse2);
-	  NEXT_PASS (pass_split_after_reload);
-	  NEXT_PASS (pass_branch_target_load_optimize1);
-	  NEXT_PASS (pass_thread_prologue_and_epilogue);
-	  NEXT_PASS (pass_rtl_dse2);
-	  NEXT_PASS (pass_rtl_seqabstr);
-	  NEXT_PASS (pass_stack_adjustments);
-	  NEXT_PASS (pass_peephole2);
-	  NEXT_PASS (pass_if_after_reload);
-	  NEXT_PASS (pass_regrename);
-	  NEXT_PASS (pass_cprop_hardreg);
-	  NEXT_PASS (pass_fast_rtl_dce);
-	  NEXT_PASS (pass_reorder_blocks);
-	  NEXT_PASS (pass_branch_target_load_optimize2);
-	  NEXT_PASS (pass_leaf_regs);
-	  NEXT_PASS (pass_split_before_sched2);
-	  NEXT_PASS (pass_sched2);
-	  NEXT_PASS (pass_stack_regs);
-	    {
-	      struct tree_opt_pass **p = &pass_stack_regs.sub;
-	      NEXT_PASS (pass_split_before_regstack);
-	      NEXT_PASS (pass_stack_regs_run);
-	    }
-	  NEXT_PASS (pass_compute_alignments);
-	  NEXT_PASS (pass_duplicate_computed_gotos);
-	  NEXT_PASS (pass_variable_tracking);
-	  NEXT_PASS (pass_free_cfg);
-	  NEXT_PASS (pass_machine_reorg);
-	  NEXT_PASS (pass_cleanup_barriers);
-	  NEXT_PASS (pass_delay_slots);
-	  NEXT_PASS (pass_split_for_shorten_branches);
-	  NEXT_PASS (pass_convert_to_eh_region_ranges);
-	  NEXT_PASS (pass_shorten_branches);
-	  NEXT_PASS (pass_set_nothrow_function_flags);
-	  NEXT_PASS (pass_final);
-	}
-      NEXT_PASS (pass_df_finish);
-    }
-  NEXT_PASS (pass_clean_state);
-  *p = NULL;
-
-#undef NEXT_PASS
-
-  /* Register the passes with the tree dump code.  */
-  register_dump_files (all_lowering_passes, false, PROP_gimple_any);
-  all_lowering_passes->todo_flags_start |= TODO_set_props;
-  register_dump_files (all_ipa_passes, true,
-		       PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
-		       | PROP_cfg);
-  register_dump_files (all_passes, false,
-		       PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
-		       | PROP_cfg);
-}
-
 /* If we are in IPA mode (i.e., current_function_decl is NULL), call
    function CALLBACK for every function in the call graph.  Otherwise,
    call CALLBACK on the current function.  */ 
Index: working/gcc/gcc/passes.h
===================================================================
--- working/gcc/gcc/passes.h	(revision 0)
+++ working/gcc/gcc/passes.h	(revision 0)
@@ -0,0 +1,8 @@
+#ifndef GCC_PASSES_H
+#define GCC_PASSES_H 1
+
+struct tree_opt_pass **next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass);
+void register_dump_files (struct tree_opt_pass *pass, bool ipa, int properties);
+void init_optimization_passes (void);
+
+#endif

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