-void
-init_tree_optimization_passes (void)
-{
- struct tree_opt_pass **p;
-
-#define NEXT_PASS(PASS) (p = next_pass_1 (p, &PASS))
- /* Intraprocedural optimization passes. */
- p = &all_ipa_passes;
- NEXT_PASS (pass_ipa_inline);
- *p = NULL;
-
- /* All passes needed to lower the function into shape optimizers can operate
- on. These passes are performed before interprocedural passes, unlike rest
- of local passes (all_passes). */
- p = &all_lowering_passes;
- 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_warn_function_return);
- *p = NULL;
-
- p = &all_passes;
- NEXT_PASS (pass_fixup_cfg);
- NEXT_PASS (pass_tree_profile);
- NEXT_PASS (pass_init_datastructures);
- NEXT_PASS (pass_all_optimizations);
- NEXT_PASS (pass_warn_function_noreturn);
- NEXT_PASS (pass_mudflap_2);
- NEXT_PASS (pass_free_datastructures);
- NEXT_PASS (pass_expand);
- NEXT_PASS (pass_rest_of_compilation);
- *p = NULL;
-
- p = &pass_all_optimizations.sub;
- NEXT_PASS (pass_referenced_vars);
- NEXT_PASS (pass_create_structure_vars);
- NEXT_PASS (pass_build_ssa);
- NEXT_PASS (pass_may_alias);
- NEXT_PASS (pass_rename_ssa_copies);
- NEXT_PASS (pass_early_warn_uninitialized);
-
- /* Initial scalar cleanups. */
- NEXT_PASS (pass_ccp);
- NEXT_PASS (pass_fre);
- NEXT_PASS (pass_dce);
- NEXT_PASS (pass_forwprop);
- NEXT_PASS (pass_vrp);
- NEXT_PASS (pass_copy_prop);
- NEXT_PASS (pass_dce);
- NEXT_PASS (pass_merge_phi);
- NEXT_PASS (pass_dominator);
-
- NEXT_PASS (pass_phiopt);
- NEXT_PASS (pass_may_alias);
- NEXT_PASS (pass_tail_recursion);
- NEXT_PASS (pass_profile);
- NEXT_PASS (pass_ch);
- NEXT_PASS (pass_stdarg);
- NEXT_PASS (pass_sra);
- /* FIXME: SRA may generate arbitrary gimple code, exposing new
- aliased and call-clobbered variables. As mentioned below,
- pass_may_alias should be a TODO item. */
- NEXT_PASS (pass_may_alias);
- NEXT_PASS (pass_rename_ssa_copies);
- NEXT_PASS (pass_dominator);
- NEXT_PASS (pass_copy_prop);
- NEXT_PASS (pass_dce);
- NEXT_PASS (pass_dse);
- NEXT_PASS (pass_may_alias);
- NEXT_PASS (pass_forwprop);
- NEXT_PASS (pass_phiopt);
- NEXT_PASS (pass_store_ccp);
- NEXT_PASS (pass_store_copy_prop);
- NEXT_PASS (pass_fold_builtins);
- /* FIXME: May alias should a TODO but for 4.0.0,
- we add may_alias right after fold builtins
- which can create arbitrary GIMPLE. */
- NEXT_PASS (pass_may_alias);
- NEXT_PASS (pass_cse_reciprocals);
- NEXT_PASS (pass_split_crit_edges);
- NEXT_PASS (pass_pre);
- NEXT_PASS (pass_sink_code);
- NEXT_PASS (pass_loop);
- NEXT_PASS (pass_dominator);
- NEXT_PASS (pass_copy_prop);
- NEXT_PASS (pass_cd_dce);
- /* 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_remove_useless_vars);
- NEXT_PASS (pass_mark_used_blocks);
- NEXT_PASS (pass_cleanup_cfg_post_optimizing);
- *p = NULL;
-
- p = &pass_loop.sub;
- NEXT_PASS (pass_loop_init);
- NEXT_PASS (pass_copy_prop);
- NEXT_PASS (pass_lim);
- NEXT_PASS (pass_unswitch);
- NEXT_PASS (pass_scev_cprop);
- NEXT_PASS (pass_record_bounds);
- NEXT_PASS (pass_linear_transform);
- NEXT_PASS (pass_iv_canon);
- NEXT_PASS (pass_if_conversion);
- NEXT_PASS (pass_vectorize);
- NEXT_PASS (pass_lower_vector_ssa);
- NEXT_PASS (pass_complete_unroll);
- NEXT_PASS (pass_iv_optimize);
- NEXT_PASS (pass_loop_done);
- *p = NULL;
-
-#undef NEXT_PASS
-
- register_dump_files (all_lowering_passes, false, 0);
- register_dump_files (all_passes, false, PROP_gimple_any
- | PROP_gimple_lcf
- | PROP_gimple_leh
- | PROP_cfg);
- register_dump_files (all_ipa_passes, true, PROP_gimple_any
- | PROP_gimple_lcf
- | PROP_gimple_leh
- | PROP_cfg);
-}
-
-static unsigned int last_verified;
-
-static void
-execute_todo (struct tree_opt_pass *pass, unsigned int flags, bool use_required)
-{
- int properties
- = use_required ? pass->properties_required : pass->properties_provided;
-
-#if defined ENABLE_CHECKING
- if (need_ssa_update_p ())
- gcc_assert (flags & TODO_update_ssa_any);
-#endif
-
- if (flags & TODO_update_ssa_any)