diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-03-29 13:32:13 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-03-29 13:32:13 +0000 |
commit | 4c5fcca622ac108db1d93965d1d11701d85e70e5 (patch) | |
tree | 1577a1a0b3cbaa114690527d99170c1034533481 | |
parent | b8c0c8668e11fc6af6bc4debceeed05510849846 (diff) | |
download | gcc-4c5fcca622ac108db1d93965d1d11701d85e70e5.tar.gz |
PR middle-end/28850
* tree-pass.h (pass_cleanup_eh): New function.
(remove_unreachable_regions): Break code handling RTL
to rtl_remove_unreachable_regions; remove ERT_MUST_NOT_THROW
that can not be reached by runtime.
(can_be_reached_by_runtime): New function.
(label_to_region_map): New function.
(num_eh_regions): New function.
(rtl_remove_unreachable_regions): New function.
(convert_from_eh_region_ranges): Call rtl_remove_unreachable_regions.
(remove_eh_region): New function.
* except.h: Include sbitmap and vecprim.
(remove_eh_region, remove_unreachable_regions, label_to_region_map,
num_eh_regions): Declare.
* passes.c (init_optimization_passes): Schedule cleanup_eh.
* Makefile.in (EXCEPT_H): New; replace all uses of except.h
by it.
* tree-eh.c (tree_remove_unreachable_handlers): New function.
(tree_empty_eh_handler_p): New function.
(cleanup_empty_eh): New function.
(cleanup_eh): New function.
(pass_cleanup_eh): New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145233 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 25 | ||||
-rw-r--r-- | gcc/Makefile.in | 123 | ||||
-rw-r--r-- | gcc/except.c | 241 | ||||
-rw-r--r-- | gcc/except.h | 6 | ||||
-rw-r--r-- | gcc/passes.c | 3 | ||||
-rw-r--r-- | gcc/tree-eh.c | 271 | ||||
-rw-r--r-- | gcc/tree-pass.h | 1 |
7 files changed, 571 insertions, 99 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 738c87effb3..b8b75474880 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,30 @@ 2009-03-29 Jan Hubicka <jh@suse.cz> + PR middle-end/28850 + * tree-pass.h (pass_cleanup_eh): New function. + (remove_unreachable_regions): Break code handling RTL + to rtl_remove_unreachable_regions; remove ERT_MUST_NOT_THROW + that can not be reached by runtime. + (can_be_reached_by_runtime): New function. + (label_to_region_map): New function. + (num_eh_regions): New function. + (rtl_remove_unreachable_regions): New function. + (convert_from_eh_region_ranges): Call rtl_remove_unreachable_regions. + (remove_eh_region): New function. + * except.h: Include sbitmap and vecprim. + (remove_eh_region, remove_unreachable_regions, label_to_region_map, + num_eh_regions): Declare. + * passes.c (init_optimization_passes): Schedule cleanup_eh. + * Makefile.in (EXCEPT_H): New; replace all uses of except.h + by it. + * tree-eh.c (tree_remove_unreachable_handlers): New function. + (tree_empty_eh_handler_p): New function. + (cleanup_empty_eh): New function. + (cleanup_eh): New function. + (pass_cleanup_eh): New function. + +2009-03-29 Jan Hubicka <jh@suse.cz> + * except.c (verify_eh_tree): Fix handling of fun!=cfun; be ready for removed regions. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index aa7a95d4f8c..7464d3ec617 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -780,6 +780,7 @@ REVISION_s := endif # Shorthand variables for dependency lists. +EXCEPT_H = except.h sbitmap.h vecprim.h TOPLEV_H = toplev.h input.h TARGET_H = $(TM_H) target.h insn-modes.h MACHMODE_H = machmode.h mode-classes.def insn-modes.h @@ -1810,7 +1811,7 @@ c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(RTL_H) $(C_TREE_H) $(GGC_H) $(TARGET_H) $(FLAGS_H) $(FUNCTION_H) output.h \ $(EXPR_H) debug.h $(TOPLEV_H) intl.h $(TM_P_H) $(TREE_INLINE_H) $(TIMEVAR_H) \ opts.h $(C_PRAGMA_H) gt-c-decl.h $(CGRAPH_H) $(HASHTAB_H) libfuncs.h \ - except.h $(LANGHOOKS_DEF_H) $(TREE_DUMP_H) $(C_COMMON_H) $(CPPLIB_H) \ + $(EXCEPT_H) $(LANGHOOKS_DEF_H) $(TREE_DUMP_H) $(C_COMMON_H) $(CPPLIB_H) \ $(DIAGNOSTIC_H) $(INPUT_H) langhooks.h $(GIMPLE_H) tree-mudflap.h \ pointer-set.h $(BASIC_BLOCK_H) $(GIMPLE_H) tree-iterator.h c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ @@ -1894,7 +1895,7 @@ c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ c-cppbuiltin.o : c-cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) version.h $(C_COMMON_H) $(C_PRAGMA_H) $(FLAGS_H) \ - $(TOPLEV_H) output.h except.h $(REAL_H) $(TARGET_H) $(TM_P_H) \ + $(TOPLEV_H) output.h $(EXCEPT_H) $(REAL_H) $(TARGET_H) $(TM_P_H) \ $(BASEVER) debug.h $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) -DBASEVER=$(BASEVER_s) \ $< $(OUTPUT_OPTION) @@ -1911,7 +1912,7 @@ c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) la c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) $(FLAGS_H) $(TOPLEV_H) output.h $(RTL_H) $(GGC_H) \ - $(PREDICT_H) $(TREE_INLINE_H) $(C_COMMON_H) except.h $(FUNCTION_H) \ + $(PREDICT_H) $(TREE_INLINE_H) $(C_COMMON_H) $(EXCEPT_H) $(FUNCTION_H) \ langhooks.h $(SPLAY_TREE_H) $(TIMEVAR_H) $(GIMPLE_H) \ $(VARRAY_H) tree-iterator.h @@ -2008,7 +2009,7 @@ gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ input.h $(TREE_H) $(RTL_H) $(FUNCTION_H) insn-config.h $(EXPR_H) \ hard-reg-set.h $(BASIC_BLOCK_H) cselib.h $(INSN_ADDR_H) $(OPTABS_H) \ libfuncs.h debug.h $(GGC_H) $(CGRAPH_H) $(TREE_FLOW_H) reload.h \ - $(CPP_ID_DATA_H) tree-chrec.h $(CFGLAYOUT_H) except.h output.h \ + $(CPP_ID_DATA_H) tree-chrec.h $(CFGLAYOUT_H) $(EXCEPT_H) output.h \ $(CFGLOOP_H) ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \ @@ -2054,7 +2055,7 @@ tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) $(RTL_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) $(INPUT_H) insn-config.h \ $(VARRAY_H) $(HASHTAB_H) $(TOPLEV_H) langhooks.h $(TREE_INLINE_H) $(CGRAPH_H) \ intl.h $(FUNCTION_H) $(GGC_H) $(GIMPLE_H) \ - debug.h $(DIAGNOSTIC_H) except.h $(TREE_FLOW_H) tree-iterator.h tree-mudflap.h \ + debug.h $(DIAGNOSTIC_H) $(EXCEPT_H) $(TREE_FLOW_H) tree-iterator.h tree-mudflap.h \ $(IPA_PROP_H) value-prof.h tree-pass.h $(TARGET_H) $(INTEGRATE_H) print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(GGC_H) langhooks.h $(REAL_H) tree-iterator.h fixed-value.h \ @@ -2177,13 +2178,13 @@ tree-vrp.o : tree-vrp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ tree-cfg.o : tree-cfg.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(FLAGS_H) output.h \ $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ - $(TREE_DUMP_H) except.h langhooks.h $(CFGLOOP_H) tree-pass.h \ + $(TREE_DUMP_H) $(EXCEPT_H) langhooks.h $(CFGLOOP_H) tree-pass.h \ $(CFGLAYOUT_H) $(BASIC_BLOCK_H) hard-reg-set.h $(TOPLEV_H) \ value-prof.h tree-ssa-propagate.h $(TREE_INLINE_H) tree-cfgcleanup.o : tree-cfgcleanup.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(FLAGS_H) output.h \ $(DIAGNOSTIC_H) $(TOPLEV_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ - $(TREE_DUMP_H) except.h langhooks.h $(CFGLOOP_H) tree-pass.h \ + $(TREE_DUMP_H) $(EXCEPT_H) langhooks.h $(CFGLOOP_H) tree-pass.h \ $(CFGLAYOUT_H) $(BASIC_BLOCK_H) hard-reg-set.h $(HASHTAB_H) $(TOPLEV_H) \ tree-ssa-propagate.h tree-scalar-evolution.h rtl-factoring.o : rtl-factoring.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ @@ -2192,7 +2193,7 @@ rtl-factoring.o : rtl-factoring.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ $(TIMEVAR_H) output.h $(DF_H) tree-tailcall.o : tree-tailcall.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(RTL_H) $(TREE_H) $(TM_P_H) $(FUNCTION_H) $(TM_H) coretypes.h \ - $(TREE_DUMP_H) $(DIAGNOSTIC_H) except.h tree-pass.h $(FLAGS_H) langhooks.h \ + $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(EXCEPT_H) tree-pass.h $(FLAGS_H) langhooks.h \ $(BASIC_BLOCK_H) hard-reg-set.h $(DBGCNT_H) tree-ssa-sink.o : tree-ssa-sink.c $(TREE_FLOW_H) $(CONFIG_H) \ $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \ @@ -2221,7 +2222,7 @@ tree-ssa-operands.o : tree-ssa-operands.c $(TREE_FLOW_H) $(CONFIG_H) \ $(FLAGS_H) $(FUNCTION_H) $(TM_H) $(TIMEVAR_H) tree-pass.h $(TOPLEV_H) \ coretypes.h langhooks.h $(IPA_REFERENCE_H) tree-eh.o : tree-eh.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_H) $(FLAGS_H) $(FUNCTION_H) except.h langhooks.h \ + $(RTL_H) $(TREE_H) $(TM_H) $(FLAGS_H) $(FUNCTION_H) $(EXCEPT_H) langhooks.h \ $(GGC_H) tree-pass.h coretypes.h $(TIMEVAR_H) $(TM_P_H) pointer-set.h \ $(TREE_DUMP_H) $(TREE_INLINE_H) tree-iterator.h $(TOPLEV_H) tree-ssa-loop.o : tree-ssa-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ @@ -2301,7 +2302,7 @@ tree-optimize.o : tree-optimize.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(DIAGNOSTIC_H) $(BASIC_BLOCK_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) graph.h $(CGRAPH_H) tree-pass.h \ - $(CFGLOOP_H) except.h + $(CFGLOOP_H) $(EXCEPT_H) c-gimplify.o : c-gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ $(C_TREE_H) $(C_COMMON_H) $(DIAGNOSTIC_H) $(GIMPLE_H) $(VARRAY_H) \ @@ -2311,7 +2312,7 @@ c-gimplify.o : c-gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ gimplify.o : gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(GIMPLE_H) \ $(DIAGNOSTIC_H) $(GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) langhooks.h \ $(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(CGRAPH_H) $(TIMEVAR_H) $(TM_H) \ - coretypes.h except.h $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) output.h \ + coretypes.h $(EXCEPT_H) $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) output.h \ $(GGC_H) gt-gimplify.h $(HASHTAB_H) $(TARGET_H) $(TOPLEV_H) $(OPTABS_H) \ $(REAL_H) $(SPLAY_TREE_H) vec.h tree-iterator.h gimple-iterator.o : gimple-iterator.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ @@ -2319,12 +2320,12 @@ gimple-iterator.o : gimple-iterator.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ gimple-low.o : gimple-low.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ $(DIAGNOSTIC_H) $(GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) langhooks.h \ $(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ - except.h $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) tree-pass.h \ + $(EXCEPT_H) $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) tree-pass.h \ $(HASHTAB_H) $(TOPLEV.H) tree-iterator.h omp-low.o : omp-low.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(RTL_H) $(GIMPLE_H) $(TREE_INLINE_H) langhooks.h $(DIAGNOSTIC_H) \ $(TREE_FLOW_H) $(TIMEVAR_H) $(FLAGS_H) $(EXPR_H) $(TOPLEV_H) tree-pass.h \ - $(GGC_H) except.h $(SPLAY_TREE_H) $(OPTABS_H) $(CFGLOOP_H) \ + $(GGC_H) $(EXCEPT_H) $(SPLAY_TREE_H) $(OPTABS_H) $(CFGLOOP_H) \ tree-iterator.h tree-browser.o : tree-browser.c tree-browser.def $(CONFIG_H) $(SYSTEM_H) \ $(TREE_H) $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) \ @@ -2429,7 +2430,7 @@ toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ version.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) Makefile $(TOPLEV_H) dwarf2out.h sdbout.h dbxout.h $(EXPR_H) \ - hard-reg-set.h $(BASIC_BLOCK_H) graph.h except.h $(REGS_H) $(TIMEVAR_H) \ + hard-reg-set.h $(BASIC_BLOCK_H) graph.h $(EXCEPT_H) $(REGS_H) $(TIMEVAR_H) \ value-prof.h $(PARAMS_H) $(TM_P_H) reload.h ira.h dwarf2asm.h $(TARGET_H) \ langhooks.h insn-flags.h $(CFGLAYOUT_H) $(CFGLOOP_H) hosthooks.h \ $(CGRAPH_H) $(COVERAGE_H) alloc-pool.h $(GGC_H) $(INTEGRATE_H) \ @@ -2442,7 +2443,7 @@ 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) \ dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \ - graph.h except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \ + 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) \ @@ -2477,26 +2478,26 @@ varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(CFGLAYOUT_H) $(GIMPLE_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) \ $(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \ - output.h $(TOPLEV_H) except.h $(HASHTAB_H) $(GGC_H) $(TM_P_H) langhooks.h \ + output.h $(TOPLEV_H) $(EXCEPT_H) $(HASHTAB_H) $(GGC_H) $(TM_P_H) langhooks.h \ gt-function.h $(TARGET_H) $(BASIC_BLOCK_H) $(INTEGRATE_H) $(PREDICT_H) \ tree-pass.h $(DF_H) $(TIMEVAR_H) vecprim.h statistics.o : statistics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ tree-pass.h $(TREE_DUMP_H) $(HASHTAB_H) statistics.h $(TM_H) $(FUNCTION_H) stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(FLAGS_H) $(FUNCTION_H) insn-config.h hard-reg-set.h $(EXPR_H) \ - libfuncs.h except.h $(RECOG_H) $(TOPLEV_H) output.h $(GGC_H) $(TM_P_H) \ + libfuncs.h $(EXCEPT_H) $(RECOG_H) $(TOPLEV_H) output.h $(GGC_H) $(TM_P_H) \ langhooks.h $(PREDICT_H) $(OPTABS_H) $(TARGET_H) $(MACHMODE_H) \ $(REGS_H) alloc-pool.h except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FLAGS_H) except.h $(FUNCTION_H) $(EXPR_H) libfuncs.h \ + $(TREE_H) $(FLAGS_H) $(EXCEPT_H) $(FUNCTION_H) $(EXPR_H) libfuncs.h \ langhooks.h insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \ dwarf2asm.h dwarf2out.h $(TOPLEV_H) $(HASHTAB_H) intl.h $(GGC_H) \ - gt-except.h $(CGRAPH_H) $(INTEGRATE_H) $(DIAGNOSTIC_H) dwarf2.h \ + gt-$(EXCEPT_H) $(CGRAPH_H) $(INTEGRATE_H) $(DIAGNOSTIC_H) dwarf2.h \ $(TARGET_H) $(TM_P_H) tree-pass.h $(TIMEVAR_H) expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) $(EXPR_H) $(OPTABS_H) \ libfuncs.h $(INSN_ATTR_H) insn-config.h $(RECOG_H) output.h \ - typeclass.h hard-reg-set.h $(TOPLEV_H) hard-reg-set.h except.h reload.h \ + typeclass.h hard-reg-set.h $(TOPLEV_H) hard-reg-set.h $(EXCEPT_H) reload.h \ $(GGC_H) langhooks.h intl.h $(TM_P_H) $(REAL_H) $(TARGET_H) \ tree-iterator.h gt-expr.h $(MACHMODE_H) $(TIMEVAR_H) $(TREE_FLOW_H) \ tree-pass.h $(DF_H) $(DIAGNOSTIC_H) vecprim.h @@ -2506,23 +2507,23 @@ dojump.o : dojump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_ builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(GIMPLE_H) $(FLAGS_H) $(TARGET_H) $(FUNCTION_H) $(REGS_H) \ $(EXPR_H) $(OPTABS_H) insn-config.h $(RECOG_H) output.h typeclass.h \ - hard-reg-set.h $(TOPLEV_H) hard-reg-set.h except.h $(TM_P_H) $(PREDICT_H) \ + hard-reg-set.h $(TOPLEV_H) hard-reg-set.h $(EXCEPT_H) $(TM_P_H) $(PREDICT_H) \ libfuncs.h $(REAL_H) langhooks.h $(BASIC_BLOCK_H) tree-mudflap.h \ $(BUILTINS_DEF) $(MACHMODE_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) value-prof.h calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) langhooks.h $(TARGET_H) \ libfuncs.h $(REGS_H) $(TOPLEV_H) output.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_P_H) \ - $(CGRAPH_H) except.h sbitmap.h $(DBGCNT_H) $(TREE_FLOW_H) + $(CGRAPH_H) $(EXCEPT_H) sbitmap.h $(DBGCNT_H) $(TREE_FLOW_H) expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) $(REAL_H) \ $(TOPLEV_H) $(TM_P_H) langhooks.h $(DF_H) $(TARGET_H) explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ $(FLAGS_H) hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \ - $(TOPLEV_H) except.h $(FUNCTION_H) $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h \ + $(TOPLEV_H) $(EXCEPT_H) $(FUNCTION_H) $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h \ $(TARGET_H) output.h optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h \ - $(RECOG_H) reload.h $(TOPLEV_H) $(GGC_H) $(REAL_H) $(TM_P_H) except.h \ + $(RECOG_H) reload.h $(TOPLEV_H) $(GGC_H) $(REAL_H) $(TM_P_H) $(EXCEPT_H) \ gt-optabs.h $(BASIC_BLOCK_H) $(TARGET_H) $(FUNCTION_H) dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(RTL_H) $(FLAGS_H) $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) $(FUNCTION_H) \ @@ -2536,7 +2537,7 @@ sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) debug.h \ dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) version.h $(RTL_H) dwarf2.h debug.h $(FLAGS_H) insn-config.h \ output.h $(DIAGNOSTIC_H) $(REAL_H) hard-reg-set.h $(REGS_H) $(EXPR_H) \ - libfuncs.h $(TOPLEV_H) dwarf2out.h reload.h $(GGC_H) except.h dwarf2asm.h \ + libfuncs.h $(TOPLEV_H) dwarf2out.h reload.h $(GGC_H) $(EXCEPT_H) dwarf2asm.h \ $(TM_P_H) langhooks.h $(HASHTAB_H) gt-dwarf2out.h $(TARGET_H) $(CGRAPH_H) \ $(MD5_H) $(INPUT_H) $(FUNCTION_H) $(VARRAY_H) dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ @@ -2561,11 +2562,11 @@ fixed-value.o: fixed-value.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(TREE_H) $(FLAGS_H) debug.h $(INTEGRATE_H) insn-config.h \ $(EXPR_H) $(REAL_H) $(REGS_H) intl.h $(FUNCTION_H) output.h $(RECOG_H) \ - except.h $(TOPLEV_H) $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h \ + $(EXCEPT_H) $(TOPLEV_H) $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h \ gt-integrate.h $(GGC_H) tree-pass.h $(DF_H) jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(FLAGS_H) hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) \ - $(REAL_H) except.h $(FUNCTION_H) tree-pass.h $(DIAGNOSTIC_H) \ + $(REAL_H) $(EXCEPT_H) $(FUNCTION_H) tree-pass.h $(DIAGNOSTIC_H) \ $(TOPLEV_H) $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) \ $(TIMEVAR_H) $(TARGET_H) simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ @@ -2648,7 +2649,7 @@ cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ hard-reg-set.h $(FLAGS_H) insn-config.h $(RECOG_H) $(EXPR_H) $(TOPLEV_H) \ output.h $(FUNCTION_H) $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) \ - except.h $(TARGET_H) $(PARAMS_H) rtlhooks-def.h tree-pass.h $(REAL_H) \ + $(EXCEPT_H) $(TARGET_H) $(PARAMS_H) rtlhooks-def.h tree-pass.h $(REAL_H) \ $(DF_H) $(DBGCNT_H) dce.o : dce.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) $(DF_H) cselib.h \ @@ -2671,11 +2672,11 @@ see.o : see.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(REGS_H) hard-reg-set.h $(FLAGS_H) $(REAL_H) insn-config.h $(GGC_H) \ $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) \ - $(TM_P_H) $(PARAMS_H) except.h gt-gcse.h $(TREE_H) cselib.h $(TIMEVAR_H) \ + $(TM_P_H) $(PARAMS_H) $(EXCEPT_H) gt-gcse.h $(TREE_H) cselib.h $(TIMEVAR_H) \ intl.h $(OBSTACK_H) tree-pass.h $(DF_H) $(DBGCNT_H) resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) \ coretypes.h $(TM_H) $(REGS_H) $(FLAGS_H) output.h $(RESOURCE_H) $(DF_H) \ - $(FUNCTION_H) $(TOPLEV_H) $(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H) + $(FUNCTION_H) $(TOPLEV_H) $(INSN_ATTR_H) $(EXCEPT_H) $(PARAMS_H) $(TM_P_H) lcm.o : lcm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ hard-reg-set.h $(FLAGS_H) insn-config.h $(INSN_ATTR_H) $(RECOG_H) \ $(BASIC_BLOCK_H) $(TM_P_H) $(FUNCTION_H) output.h $(REAL_H) @@ -2722,7 +2723,7 @@ df-core.o : df-core.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ df-problems.o : df-problems.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) insn-config.h $(RECOG_H) $(FUNCTION_H) $(REGS_H) alloc-pool.h \ hard-reg-set.h $(BASIC_BLOCK_H) $(DF_H) $(BITMAP_H) sbitmap.h $(TIMEVAR_H) \ - $(TM_P_H) $(FLAGS_H) output.h except.h dce.h vecprim.h + $(TM_P_H) $(FLAGS_H) output.h $(EXCEPT_H) dce.h vecprim.h df-scan.o : df-scan.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ insn-config.h $(RECOG_H) $(FUNCTION_H) $(REGS_H) alloc-pool.h \ hard-reg-set.h $(BASIC_BLOCK_H) $(DF_H) $(BITMAP_H) sbitmap.h $(TIMEVAR_H) \ @@ -2731,7 +2732,7 @@ df-scan.o : df-scan.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ df-byte-scan.o : df-byte-scan.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ tm_p.h $(DF_H) output.h $(DBGCNT_H) regstat.o : regstat.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TM_P_H) $(FLAGS_H) $(REGS_H) output.h except.h hard-reg-set.h \ + $(TM_P_H) $(FLAGS_H) $(REGS_H) output.h $(EXCEPT_H) hard-reg-set.h \ $(BASIC_BLOCK_H) $(TIMEVAR_H) $(DF_H) var-tracking.o : var-tracking.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(TREE_H) hard-reg-set.h insn-config.h reload.h $(FLAGS_H) \ @@ -2758,22 +2759,22 @@ loop-doloop.o : loop-doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ alloc-pool.o : alloc-pool.c $(CONFIG_H) $(SYSTEM_H) alloc-pool.h $(HASHTAB_H) auto-inc-dec.o : auto-inc-dec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) $(RTL_H) $(TM_P_H) hard-reg-set.h $(BASIC_BLOCK_H) insn-config.h \ - $(REGS_H) $(FLAGS_H) output.h $(FUNCTION_H) except.h $(TOPLEV_H) $(RECOG_H) \ + $(REGS_H) $(FLAGS_H) output.h $(FUNCTION_H) $(EXCEPT_H) $(TOPLEV_H) $(RECOG_H) \ $(EXPR_H) $(TIMEVAR_H) tree-pass.h $(DF_H) $(DBGCNT_H) cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \ - $(REGS_H) hard-reg-set.h output.h $(TOPLEV_H) $(FUNCTION_H) except.h $(GGC_H) \ + $(REGS_H) hard-reg-set.h output.h $(TOPLEV_H) $(FUNCTION_H) $(EXCEPT_H) $(GGC_H) \ $(TM_P_H) $(TIMEVAR_H) $(OBSTACK_H) $(TREE_H) alloc-pool.h \ $(HASHTAB_H) $(DF_H) $(CFGLOOP_H) $(TREE_FLOW_H) tree-pass.h cfghooks.o: cfghooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TOPLEV_H) $(CFGLOOP_H) cfgexpand.o : cfgexpand.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) \ - coretypes.h $(TREE_DUMP_H) except.h langhooks.h tree-pass.h $(RTL_H) \ + coretypes.h $(TREE_DUMP_H) $(EXCEPT_H) langhooks.h tree-pass.h $(RTL_H) \ $(DIAGNOSTIC_H) $(TOPLEV_H) $(BASIC_BLOCK_H) $(FLAGS_H) debug.h $(PARAMS_H) \ value-prof.h $(TREE_INLINE_H) $(TARGET_H) cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h \ - output.h $(TOPLEV_H) $(FUNCTION_H) except.h $(TM_P_H) insn-config.h $(EXPR_H) \ + output.h $(TOPLEV_H) $(FUNCTION_H) $(EXCEPT_H) $(TM_P_H) insn-config.h $(EXPR_H) \ $(CFGLAYOUT_H) $(CFGLOOP_H) $(OBSTACK_H) $(TARGET_H) $(TREE_H) \ tree-pass.h $(DF_H) $(GGC_H) cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ @@ -2781,7 +2782,7 @@ cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TIMEVAR_H) $(OBSTACK_H) $(TOPLEV_H) vecprim.h cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(TOPLEV_H) \ - $(FUNCTION_H) except.h $(TIMEVAR_H) $(TREE_H) + $(FUNCTION_H) $(EXCEPT_H) $(TIMEVAR_H) $(TREE_H) cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(TIMEVAR_H) hard-reg-set.h output.h $(FLAGS_H) $(RECOG_H) \ $(TOPLEV_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H) $(PARAMS_H) \ @@ -2802,7 +2803,7 @@ loop-iv.o : loop-iv.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) \ loop-invariant.o : loop-invariant.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) $(RECOG_H) coretypes.h \ $(TM_H) $(TM_P_H) $(FUNCTION_H) $(FLAGS_H) $(DF_H) $(OBSTACK_H) output.h \ - $(HASHTAB_H) except.h $(PARAMS_H) + $(HASHTAB_H) $(EXCEPT_H) $(PARAMS_H) cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) output.h \ coretypes.h $(TM_H) cfghooks.h $(OBSTACK_H) $(TREE_FLOW_H) @@ -2844,31 +2845,31 @@ reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \ $(BASIC_BLOCK_H) $(RECOG_H) output.h $(FUNCTION_H) $(TOPLEV_H) $(TM_P_H) \ - addresses.h except.h $(TREE_H) $(REAL_H) $(FLAGS_H) $(MACHMODE_H) \ + addresses.h $(EXCEPT_H) $(TREE_H) $(REAL_H) $(FLAGS_H) $(MACHMODE_H) \ $(OBSTACK_H) $(DF_H) $(TARGET_H) $(EMIT_RTL_H) ira.h rtlhooks.o : rtlhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ rtlhooks-def.h $(EXPR_H) $(RECOG_H) postreload.o : postreload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(REAL_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) \ hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) output.h \ - $(FUNCTION_H) $(TOPLEV_H) cselib.h $(TM_P_H) except.h $(TREE_H) $(MACHMODE_H) \ + $(FUNCTION_H) $(TOPLEV_H) cselib.h $(TM_P_H) $(EXCEPT_H) $(TREE_H) $(MACHMODE_H) \ $(OBSTACK_H) $(TIMEVAR_H) tree-pass.h $(DF_H) $(DBGCNT_H) postreload-gcse.o : postreload-gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) \ - $(TM_P_H) except.h $(TREE_H) $(TARGET_H) $(HASHTAB_H) intl.h $(OBSTACK_H) \ + $(TM_P_H) $(EXCEPT_H) $(TREE_H) $(TARGET_H) $(HASHTAB_H) intl.h $(OBSTACK_H) \ $(PARAMS_H) $(TIMEVAR_H) tree-pass.h $(REAL_H) $(DBGCNT_H) caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(FLAGS_H) $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) $(FUNCTION_H) \ addresses.h $(RECOG_H) reload.h $(EXPR_H) $(TOPLEV_H) $(TM_P_H) $(DF_H) \ output.h ira.h gt-caller-save.h $(GGC_H) -bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) except.h \ +bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(EXCEPT_H) \ $(RTL_H) hard-reg-set.h $(REGS_H) $(TM_P_H) $(FIBHEAP_H) output.h $(EXPR_H) \ $(TARGET_H) $(FLAGS_H) $(INSN_ATTR_H) $(FUNCTION_H) tree-pass.h $(TOPLEV_H) \ $(DF_H) vecprim.h $(RECOG_H) reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ conditions.h hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h \ - $(INSN_ATTR_H) except.h $(RECOG_H) $(FUNCTION_H) $(FLAGS_H) output.h \ + $(INSN_ATTR_H) $(EXCEPT_H) $(RECOG_H) $(FUNCTION_H) $(FLAGS_H) output.h \ $(EXPR_H) $(TOPLEV_H) $(PARAMS_H) $(TM_P_H) $(OBSTACK_H) $(RESOURCE_H) \ $(TIMEVAR_H) $(TARGET_H) tree-pass.h alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ @@ -2904,7 +2905,7 @@ ira-emit.o: ira-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(PARAMS_H) \ $(IRA_INT_H) ira-lives.o: ira-lives.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TARGET_H) $(RTL_H) $(REGS_H) except.h hard-reg-set.h $(FLAGS_H) \ + $(TARGET_H) $(RTL_H) $(REGS_H) $(EXCEPT_H) hard-reg-set.h $(FLAGS_H) \ insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(PARAMS_H) \ $(DF_H) sparseset.h $(IRA_INT_H) ira.o: ira.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ @@ -2916,62 +2917,62 @@ ira.o: ira.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ insn-config.h $(TIMEVAR_H) tree-pass.h $(DF_H)\ $(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \ - $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) except.h reload.h + $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(EXCEPT_H) reload.h combine-stack-adj.o : combine-stack-adj.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(RTL_H) insn-config.h $(TIMEVAR_H) tree-pass.h \ $(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \ - $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(DF_H) except.h reload.h + $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(DF_H) $(EXCEPT_H) reload.h ddg.o : ddg.c $(DDG_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TARGET_H) \ $(TOPLEV_H) $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \ - $(FLAGS_H) insn-config.h $(INSN_ATTR_H) except.h $(RECOG_H) \ + $(FLAGS_H) insn-config.h $(INSN_ATTR_H) $(EXCEPT_H) $(RECOG_H) \ $(SCHED_INT_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) $(BITMAP_H) \ hard-reg-set.h sbitmap.h $(TM_H) modulo-sched.o : modulo-sched.c $(DDG_H) $(CONFIG_H) $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TARGET_H) $(TOPLEV_H) $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \ - $(FLAGS_H) insn-config.h $(INSN_ATTR_H) except.h $(RECOG_H) \ + $(FLAGS_H) insn-config.h $(INSN_ATTR_H) $(EXCEPT_H) $(RECOG_H) \ $(SCHED_INT_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) $(PARAMS_H) \ cfghooks.h $(GCOV_IO_H) hard-reg-set.h $(TM_H) $(TIMEVAR_H) tree-pass.h \ $(DF_H) $(DBGCNT_H) haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h $(FUNCTION_H) \ - $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) except.h $(TM_P_H) $(TARGET_H) output.h \ + $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) $(TM_P_H) $(TARGET_H) output.h \ $(PARAMS_H) $(DBGCNT_H) sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ - $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) except.h cselib.h \ + $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) cselib.h \ $(PARAMS_H) $(TM_P_H) sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ - $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) except.h $(PARAMS_H) \ + $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \ $(TM_P_H) $(TARGET_H) $(CFGLAYOUT_H) $(TIMEVAR_H) tree-pass.h \ $(DBGCNT_H) sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ - $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) except.h $(TM_P_H) \ + $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) $(TM_P_H) \ $(PARAMS_H) $(CFGLAYOUT_H) $(TARGET_H) output.h sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(SCHED_INT_H) hard-reg-set.h $(BASIC_BLOCK_H) $(OBSTACK_H) \ $(REAL_H) tree-pass.h $(INSN_ATTR_H) sel-sched.o : sel-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ - $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(PARAMS_H) \ + $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \ $(TM_P_H) $(TARGET_H) $(CFGLAYOUT_H) $(TIMEVAR_H) tree-pass.h \ $(SCHED_INT_H) $(GGC_H) $(TREE_H) $(LANGHOOKS_DEF_H) \ $(SEL_SCHED_IR_H) $(SEL_SCHED_DUMP_H) sel-sched.h sel-sched-dump.o : sel-sched-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ - $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(PARAMS_H) \ + $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \ $(TM_P_H) $(TARGET_H) $(CFGLAYOUT_H) $(TIMEVAR_H) tree-pass.h \ $(SEL_SCHED_DUMP_H) $(GGC_H) $(TREE_H) $(LANGHOOKS_DEF_H) $(SEL_SCHED_IR_H) sel-sched-ir.o : sel-sched-ir.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ - $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(PARAMS_H) \ + $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \ $(TM_P_H) $(TARGET_H) $(CFGLAYOUT_H) $(TIMEVAR_H) tree-pass.h \ $(SCHED_INT_H) $(GGC_H) $(TREE_H) $(LANGHOOKS_DEF_H) $(SEL_SCHED_IR_H) final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(FLAGS_H) intl.h $(REGS_H) $(RECOG_H) conditions.h \ insn-config.h $(INSN_ATTR_H) $(FUNCTION_H) output.h hard-reg-set.h \ - except.h debug.h xcoffout.h $(TOPLEV_H) reload.h dwarf2out.h tree-pass.h \ + $(EXCEPT_H) debug.h xcoffout.h $(TOPLEV_H) reload.h dwarf2out.h tree-pass.h \ $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) $(EXPR_H) $(CFGLAYOUT_H) dbxout.h \ $(TIMEVAR_H) $(CGRAPH_H) $(COVERAGE_H) $(REAL_H) $(DF_H) vecprim.h $(GGC_H) \ $(CFGLOOP_H) $(PARAMS_H) @@ -2988,7 +2989,7 @@ reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sreal.h predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) \ - hard-reg-set.h output.h $(TOPLEV_H) $(RECOG_H) $(FUNCTION_H) except.h \ + hard-reg-set.h output.h $(TOPLEV_H) $(RECOG_H) $(FUNCTION_H) $(EXCEPT_H) \ $(TM_P_H) $(PREDICT_H) sreal.h $(PARAMS_H) $(TARGET_H) $(CFGLOOP_H) \ $(COVERAGE_H) $(SCEV_H) $(GGC_H) predict.def $(TIMEVAR_H) $(TREE_DUMP_H) \ $(TREE_FLOW_H) tree-pass.h $(EXPR_H) pointer-set.h @@ -3015,7 +3016,7 @@ regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ addresses.h reload.h $(TOPLEV_H) $(TIMEVAR_H) tree-pass.h $(DF_H) ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(REGS_H) $(TOPLEV_H) $(FLAGS_H) insn-config.h $(FUNCTION_H) $(RECOG_H) \ - $(TARGET_H) $(BASIC_BLOCK_H) $(EXPR_H) output.h except.h $(TM_P_H) \ + $(TARGET_H) $(BASIC_BLOCK_H) $(EXPR_H) output.h $(EXCEPT_H) $(TM_P_H) \ $(REAL_H) $(OPTABS_H) $(CFGLOOP_H) hard-reg-set.h $(TIMEVAR_H) tree-pass.h \ $(DF_H) $(DBGCNT_H) lambda-mat.o : lambda-mat.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ @@ -3038,7 +3039,7 @@ dbgcnt.o: dbgcnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h errors.h $(DBGCNT_H) \ lower-subreg.o : lower-subreg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(MACHMODE_H) $(TM_H) $(RTL_H) $(TM_P_H) $(TIMEVAR_H) $(FLAGS_H) \ insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) $(OBSTACK_H) $(BITMAP_H) \ - $(EXPR_H) except.h $(REGS_H) tree-pass.h $(DF_H) + $(EXPR_H) $(EXCEPT_H) $(REGS_H) tree-pass.h $(DF_H) $(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \ $(RTL_H) $(REGS_H) hard-reg-set.h insn-config.h conditions.h \ @@ -3121,7 +3122,7 @@ insn-output.o : insn-output.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TARGET_H) tm-constrs.h insn-peep.o : insn-peep.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ insn-config.h $(RTL_H) $(TM_P_H) $(REGS_H) output.h $(REAL_H) \ - $(RECOG_H) except.h $(FUNCTION_H) $(TOPLEV_H) $(FLAGS_H) tm-constrs.h + $(RECOG_H) $(EXCEPT_H) $(FUNCTION_H) $(TOPLEV_H) $(FLAGS_H) tm-constrs.h insn-preds.o : insn-preds.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(RTL_H) $(TREE_H) insn-config.h $(RECOG_H) output.h \ $(FLAGS_H) $(FUNCTION_H) hard-reg-set.h $(RESOURCE_H) $(TM_P_H) \ @@ -3358,7 +3359,7 @@ build/vec.o : vec.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h vec.h \ build/gencondmd.o : build/gencondmd.c $(BCONFIG_H) $(SYSTEM_H) \ coretypes.h $(GTM_H) insn-constants.h $(RTL_H) $(TM_P_H) \ $(FUNCTION_H) $(REGS_H) $(RECOG_H) $(REAL_H) output.h $(FLAGS_H) \ - $(RESOURCE_H) $(TOPLEV_H) reload.h except.h tm-constrs.h + $(RESOURCE_H) $(TOPLEV_H) reload.h $(EXCEPT_H) tm-constrs.h # This pulls in tm-pred.h which contains inline functions wrapping up # predicates from the back-end so those functions must be discarded. # No big deal since gencondmd.c is a dummy file for non-GCC compilers. diff --git a/gcc/except.c b/gcc/except.c index c6a5ca51c1c..41f799af07e 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -227,8 +227,6 @@ static hashval_t t2r_hash (const void *); static void add_type_for_runtime (tree); static tree lookup_type_for_runtime (tree); -static void remove_unreachable_regions (rtx); - static int ttypes_filter_eq (const void *, const void *); static hashval_t ttypes_filter_hash (const void *); static int ehspec_filter_eq (const void *, const void *); @@ -622,69 +620,145 @@ collect_eh_region_array (void) } } -/* Remove all regions whose labels are not reachable from insns. */ +/* R is MUST_NOT_THROW region that is not reachable via local + RESX instructions. It still must be kept in the tree in case runtime + can unwind through it, or we will eliminate out terminate call + runtime would do otherwise. Return TRUE if R contains throwing statements + or some of the exceptions in inner regions can be unwound up to R. + + CONTAINS_STMT is bitmap of all regions that contains some throwing + statements. + + Function looks O(^3) at first sight. In fact the function is called at most + once for every MUST_NOT_THROW in EH tree from remove_unreachable_regions + Because the outer loop walking subregions does not dive in MUST_NOT_THROW, + the outer loop examines every region at most once. The inner loop + is doing unwinding from the throwing statement same way as we do during + CFG construction, so it is O(^2) in size of EH tree, but O(n) in size + of CFG. In practice Eh trees are wide, not deep, so this is not + a problem. */ -static void -remove_unreachable_regions (rtx insns) +static bool +can_be_reached_by_runtime (sbitmap contains_stmt, struct eh_region *r) { - int i, *uid_region_num; - bool *reachable; - struct eh_region *r; - rtx insn; + struct eh_region *i = r->inner; + unsigned n; + bitmap_iterator bi; - uid_region_num = XCNEWVEC (int, get_max_uid ()); - reachable = XCNEWVEC (bool, cfun->eh->last_region_number + 1); - - for (i = cfun->eh->last_region_number; i > 0; --i) + if (TEST_BIT (contains_stmt, r->region_number)) + return true; + if (r->aka) + EXECUTE_IF_SET_IN_BITMAP (r->aka, 0, n, bi) + if (TEST_BIT (contains_stmt, n)) + return true; + if (!i) + return false; + while (1) { - r = VEC_index (eh_region, cfun->eh->region_array, i); - if (!r || r->region_number != i) - continue; - - if (r->resume) + /* It is pointless to look into MUST_NOT_THROW + or dive into subregions. They never unwind up. */ + if (i->type != ERT_MUST_NOT_THROW) { - gcc_assert (!uid_region_num[INSN_UID (r->resume)]); - uid_region_num[INSN_UID (r->resume)] = i; + bool found = TEST_BIT (contains_stmt, i->region_number); + if (!found) + EXECUTE_IF_SET_IN_BITMAP (i->aka, 0, n, bi) + if (TEST_BIT (contains_stmt, n)) + { + found = true; + break; + } + /* We have nested region that contains throwing statement. + See if resuming might lead up to the resx or we get locally + caught sooner. If we get locally caught sooner, we either + know region R is not reachable or it would have direct edge + from the EH resx and thus consider region reachable at + firest place. */ + if (found) + { + struct eh_region *i1 = i; + tree type_thrown = NULL_TREE; + + if (i1->type == ERT_THROW) + { + type_thrown = i1->u.eh_throw.type; + i1 = i1->outer; + } + for (; i1 != r; i1 = i1->outer) + if (reachable_next_level (i1, type_thrown, NULL, + false) >= RNL_CAUGHT) + break; + if (i1 == r) + return true; + } } - if (r->label) + /* If there are sub-regions, process them. */ + if (i->type != ERT_MUST_NOT_THROW && i->inner) + i = i->inner; + /* If there are peers, process them. */ + else if (i->next_peer) + i = i->next_peer; + /* Otherwise, step back up the tree to the next peer. */ + else { - gcc_assert (!uid_region_num[INSN_UID (r->label)]); - uid_region_num[INSN_UID (r->label)] = i; + do + { + i = i->outer; + if (i == r) + return false; + } + while (i->next_peer == NULL); + i = i->next_peer; } } +} - for (insn = insns; insn; insn = NEXT_INSN (insn)) - reachable[uid_region_num[INSN_UID (insn)]] = true; +/* Remove all regions whose labels are not reachable. + REACHABLE is bitmap of all regions that are used by the function + CONTAINS_STMT is bitmap of all regions that contains stmt (or NULL). */ +void +remove_unreachable_regions (sbitmap reachable, sbitmap contains_stmt) +{ + int i; + struct eh_region *r; for (i = cfun->eh->last_region_number; i > 0; --i) { r = VEC_index (eh_region, cfun->eh->region_array, i); - if (r && r->region_number == i && !reachable[i]) + if (!r) + continue; + if (r->region_number == i && !TEST_BIT (reachable, i) && !r->resume) { bool kill_it = true; + + r->tree_label = NULL; switch (r->type) { case ERT_THROW: /* Don't remove ERT_THROW regions if their outer region - is reachable. */ - if (r->outer && reachable[r->outer->region_number]) + is reachable. */ + if (r->outer && TEST_BIT (reachable, r->outer->region_number)) kill_it = false; break; - case ERT_MUST_NOT_THROW: /* MUST_NOT_THROW regions are implementable solely in the - runtime, but their existence continues to affect calls - within that region. Never delete them here. */ - kill_it = false; + runtime, but we need them when inlining function. + + Keep them if outer region is not MUST_NOT_THROW a well + and if they contain some statement that might unwind through + them. */ + if ((!r->outer || r->outer->type != ERT_MUST_NOT_THROW) + && (!contains_stmt + || can_be_reached_by_runtime (contains_stmt, r))) + kill_it = false; break; - case ERT_TRY: { /* TRY regions are reachable if any of its CATCH regions are reachable. */ struct eh_region *c; - for (c = r->u.eh_try.eh_catch; c ; c = c->u.eh_catch.next_catch) - if (reachable[c->region_number]) + for (c = r->u.eh_try.eh_catch; c; + c = c->u.eh_catch.next_catch) + if (TEST_BIT (reachable, c->region_number)) { kill_it = false; break; @@ -697,11 +771,91 @@ remove_unreachable_regions (rtx insns) } if (kill_it) - remove_eh_handler (r); + { + if (dump_file) + fprintf (dump_file, "Removing unreachable eh region %i\n", + r->region_number); + remove_eh_handler (r); + } } } +#ifdef ENABLE_CHECKING + verify_eh_tree (cfun); +#endif +} + +/* Return array mapping LABEL_DECL_UID to region such that region's tree_label + is identical to label. */ + +VEC(int,heap) * +label_to_region_map (void) +{ + VEC(int,heap) * label_to_region = NULL; + int i; + + VEC_safe_grow_cleared (int, heap, label_to_region, + cfun->cfg->last_label_uid + 1); + for (i = cfun->eh->last_region_number; i > 0; --i) + { + struct eh_region *r = VEC_index (eh_region, cfun->eh->region_array, i); + if (r && r->tree_label && LABEL_DECL_UID (r->tree_label) >= 0) + { + if ((unsigned) LABEL_DECL_UID (r->tree_label) > + VEC_length (int, label_to_region)) + VEC_safe_grow_cleared (int, heap, label_to_region, + LABEL_DECL_UID (r->tree_label)); + VEC_replace (int, label_to_region, LABEL_DECL_UID (r->tree_label), + i); + } + } + return label_to_region; +} + +/* Return number of EH regions. */ +int +num_eh_regions (void) +{ + return cfun->eh->last_region_number + 1; +} + +/* Remove all regions whose labels are not reachable from insns. */ + +static void +rtl_remove_unreachable_regions (rtx insns) +{ + int i, *uid_region_num; + sbitmap reachable; + struct eh_region *r; + rtx insn; + + uid_region_num = XCNEWVEC (int, get_max_uid ()); + reachable = sbitmap_alloc (cfun->eh->last_region_number + 1); + sbitmap_zero (reachable); - free (reachable); + for (i = cfun->eh->last_region_number; i > 0; --i) + { + r = VEC_index (eh_region, cfun->eh->region_array, i); + if (!r || r->region_number != i) + continue; + + if (r->resume) + { + gcc_assert (!uid_region_num[INSN_UID (r->resume)]); + uid_region_num[INSN_UID (r->resume)] = i; + } + if (r->label) + { + gcc_assert (!uid_region_num[INSN_UID (r->label)]); + uid_region_num[INSN_UID (r->label)] = i; + } + } + + for (insn = insns; insn; insn = NEXT_INSN (insn)) + SET_BIT (reachable, uid_region_num[INSN_UID (insn)]); + + remove_unreachable_regions (reachable, NULL); + + sbitmap_free (reachable); free (uid_region_num); } @@ -726,7 +880,7 @@ convert_from_eh_region_ranges (void) region->label = DECL_RTL_IF_SET (region->tree_label); } - remove_unreachable_regions (insns); + rtl_remove_unreachable_regions (insns); } static void @@ -2324,6 +2478,17 @@ maybe_remove_eh_handler (rtx label) remove_eh_handler (region); } +/* Remove Eh region R that has turned out to have no code in its handler. */ + +void +remove_eh_region (int r) +{ + struct eh_region *region; + + region = VEC_index (eh_region, cfun->eh->region_array, r); + remove_eh_handler (region); +} + /* Invokes CALLBACK for every exception handler label. Only used by old loop hackery; should not be used by new code. */ diff --git a/gcc/except.h b/gcc/except.h index b32312ea373..e407ec2c7f8 100644 --- a/gcc/except.h +++ b/gcc/except.h @@ -19,6 +19,8 @@ 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/>. */ +#include "sbitmap.h" +#include "vecprim.h" struct function; @@ -61,6 +63,7 @@ extern void init_eh_for_function (void); extern rtx reachable_handlers (rtx); extern void maybe_remove_eh_handler (rtx); +void remove_eh_region (int); extern void convert_from_eh_region_ranges (void); extern unsigned int convert_to_eh_region_ranges (void); @@ -174,3 +177,6 @@ struct throw_stmt_node GTY(()) extern struct htab *get_eh_throw_stmt_table (struct function *); extern void set_eh_throw_stmt_table (struct function *, struct htab *); +extern void remove_unreachable_regions (sbitmap, sbitmap); +extern VEC(int,heap) * label_to_region_map (void); +extern int num_eh_regions (void); diff --git a/gcc/passes.c b/gcc/passes.c index 5913464e404..41904a9ce6b 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -562,6 +562,7 @@ init_optimization_passes (void) NEXT_PASS (pass_simple_dse); NEXT_PASS (pass_tail_recursion); NEXT_PASS (pass_convert_switch); + NEXT_PASS (pass_cleanup_eh); NEXT_PASS (pass_profile); NEXT_PASS (pass_local_pure_const); } @@ -589,6 +590,7 @@ init_optimization_passes (void) /* Initial scalar cleanups before alias computation. They ensure memory accesses are not indirect wherever possible. */ NEXT_PASS (pass_strip_predict_hints); + NEXT_PASS (pass_cleanup_eh); NEXT_PASS (pass_update_address_taken); NEXT_PASS (pass_rename_ssa_copies); NEXT_PASS (pass_complete_unrolli); @@ -686,6 +688,7 @@ init_optimization_passes (void) NEXT_PASS (pass_phi_only_cprop); NEXT_PASS (pass_cd_dce); NEXT_PASS (pass_tracer); + NEXT_PASS (pass_cleanup_eh); /* FIXME: If DCE is not run before checking for uninitialized uses, we may get false warnings (e.g., testsuite/gcc.dg/uninit-5.c). diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 9febe5a1288..20e62edbf05 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -2639,3 +2639,274 @@ struct gimple_opt_pass pass_refactor_eh = TODO_dump_func /* todo_flags_finish */ } }; + +/* Walk statements, see what regions are really references and remove unreachable ones. */ + +static void +tree_remove_unreachable_handlers (void) +{ + sbitmap reachable, contains_stmt; + VEC(int,heap) * label_to_region; + basic_block bb; + + label_to_region = label_to_region_map (); + reachable = sbitmap_alloc (num_eh_regions ()); + sbitmap_zero (reachable); + contains_stmt = sbitmap_alloc (num_eh_regions ()); + sbitmap_zero (contains_stmt); + + FOR_EACH_BB (bb) + { + gimple_stmt_iterator gsi; + int region; + bool has_eh_preds = false; + edge e; + edge_iterator ei; + + FOR_EACH_EDGE (e, ei, bb->preds) if (e->flags & EDGE_EH) + has_eh_preds = true; + + for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) + { + gimple stmt = gsi_stmt (gsi); + + if (gimple_code (stmt) == GIMPLE_LABEL && has_eh_preds) + { + int uid = LABEL_DECL_UID (gimple_label_label (stmt)); + if (uid <= cfun->cfg->last_label_uid) + { + int region = VEC_index (int, label_to_region, uid); + SET_BIT (reachable, region); + } + } + if (gimple_code (stmt) == RESX) + SET_BIT (reachable, gimple_resx_region (stmt)); + if ((region = lookup_stmt_eh_region (stmt)) >= 0) + SET_BIT (contains_stmt, region); + } + } + + if (dump_file) + { + fprintf (dump_file, "Before removal of unreachable regions:\n"); + dump_eh_tree (dump_file, cfun); + fprintf (dump_file, "Reachable regions: "); + dump_sbitmap_file (dump_file, reachable); + fprintf (dump_file, "Regions containing insns: "); + dump_sbitmap_file (dump_file, contains_stmt); + } + + remove_unreachable_regions (reachable, contains_stmt); + sbitmap_free (reachable); + sbitmap_free (contains_stmt); + VEC_free (int, heap, label_to_region); + if (dump_file) + { + fprintf (dump_file, "\n\nAfter removal of unreachable regions:\n"); + dump_eh_tree (dump_file, cfun); + fprintf (dump_file, "\n\n"); + } +} + +/* Pattern match emtpy EH receiver looking like: + + save_filt.6352_662 = [filter_expr] <<<filter object>>>; + save_eptr.6351_663 = [exc_ptr_expr] <<<exception object>>>; + <<<exception object>>> = save_eptr.6351_663; + <<<filter object>>> = save_filt.6352_662; + resx 1 + */ + +static int +tree_empty_eh_handler_p (basic_block bb) +{ + gimple_stmt_iterator gsi; + int region; + + gsi = gsi_last_bb (bb); + + /* RESX */ + if (gsi_end_p (gsi)) + return 0; + if (gimple_code (gsi_stmt (gsi)) != GIMPLE_RESX) + return 0; + region = gimple_resx_region (gsi_stmt (gsi)); + + /* filter_object set. */ + gsi_prev (&gsi); + if (gsi_end_p (gsi)) + return 0; + if (gimple_code (gsi_stmt (gsi)) != GIMPLE_ASSIGN) + return 0; + if (TREE_CODE (gimple_assign_lhs (gsi_stmt (gsi))) != FILTER_EXPR) + return 0; + + /* filter_object set. */ + gsi_prev (&gsi); + if (gsi_end_p (gsi)) + return 0; + if (gimple_code (gsi_stmt (gsi)) != GIMPLE_ASSIGN) + return 0; + if (TREE_CODE (gimple_assign_lhs (gsi_stmt (gsi))) != EXC_PTR_EXPR) + return 0; + + /* filter_object get. */ + gsi_prev (&gsi); + if (gsi_end_p (gsi)) + return 0; + if (gimple_code (gsi_stmt (gsi)) != GIMPLE_ASSIGN) + return 0; + if (TREE_CODE (gimple_assign_rhs1 (gsi_stmt (gsi))) != EXC_PTR_EXPR) + return 0; + + /* filter_object get. */ + gsi_prev (&gsi); + if (gsi_end_p (gsi)) + return 0; + if (gimple_code (gsi_stmt (gsi)) != GIMPLE_ASSIGN) + return 0; + if (TREE_CODE (gimple_assign_rhs1 (gsi_stmt (gsi))) != FILTER_EXPR) + return 0; + + /* label. */ + gsi_prev (&gsi); + if (gsi_end_p (gsi)) + return 0; + if (gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL) + return region; + else + return 0; +} + +static bool dominance_info_invalidated; + +/* Look for basic blocks containing empty exception handler and remove them. + This is similar to jump forwarding, just across EH edges. */ + +static bool +cleanup_empty_eh (basic_block bb) +{ + int region; + + /* When handler of EH region winds up to be empty, we can safely + remove it. This leads to inner EH regions to be redirected + to outer one, if present in function. So we need to rebuild + EH edges in all sources. */ + if ((region = tree_empty_eh_handler_p (bb))) + { + edge_iterator ei; + edge e; + gimple_stmt_iterator si; + + remove_eh_region (region); + + /* It is safe to mark symbol for renaming because we have abnormal PHI + here. Once EH edges are made redirectable we might need to add here + similar updating as jump threading does. */ + + for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si)) + mark_sym_for_renaming (SSA_NAME_VAR (PHI_RESULT (gsi_stmt (si)))); + + while ((e = ei_safe_edge (ei_start (bb->preds)))) + { + basic_block src = e->src; + gcc_assert (e->flags & EDGE_EH); + for (ei = ei_start (src->succs); (e = ei_safe_edge (ei));) + { + if (e->flags & EDGE_EH) + { + remove_edge (e); + dominance_info_invalidated = true; + } + else + ei_next (&ei); + } + if (!stmt_can_throw_internal (last_stmt (src))) + continue; + make_eh_edges (last_stmt (src)); + FOR_EACH_EDGE (e, ei, src->succs) if (e->flags & EDGE_EH) + { + dominance_info_invalidated = true; + for (si = gsi_start_phis (e->dest); !gsi_end_p (si); + gsi_next (&si)) + mark_sym_for_renaming (SSA_NAME_VAR + (PHI_RESULT (gsi_stmt (si)))); + } + } + if (dump_file) + fprintf (dump_file, "Empty EH handler %i removed\n", region); + delete_basic_block (bb); + return true; + } + return false; +} + + +/* Perform cleanups and lowering of exception handling + 1) cleanups regions with handlers doing nothing are optimized out + 2) MUST_NOT_THROW regions that became dead because of 1) are optimized out + 3) Info about regions that are containing instructions, and regions + reachable via local EH edges is collected + 4) Eh tree is pruned for regions no longer neccesary. + */ + +static unsigned int +cleanup_eh (void) +{ + bool changed = false; + basic_block bb; + int i; + + if (!cfun->eh) + return 0; + if (dump_file) + { + fprintf (dump_file, "Before cleanups:\n"); + dump_eh_tree (dump_file, cfun); + } + + dominance_info_invalidated = false; + /* We cannot use FOR_EACH_BB, since the basic blocks may get removed. */ + for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++) + { + bb = BASIC_BLOCK (i); + if (bb) + changed |= cleanup_empty_eh (bb); + } + if (dominance_info_invalidated) + { + free_dominance_info (CDI_DOMINATORS); + free_dominance_info (CDI_POST_DOMINATORS); + } + + /* Removing contained cleanup can render MUST_NOT_THROW regions empty. */ + if (changed) + delete_unreachable_blocks (); + + tree_remove_unreachable_handlers (); + if (dump_file) + { + fprintf (dump_file, "After cleanups:\n"); + dump_eh_tree (dump_file, cfun); + } + + return (changed ? TODO_cleanup_cfg | TODO_update_ssa : 0); +} + +struct gimple_opt_pass pass_cleanup_eh = { + { + GIMPLE_PASS, + "ehcleanup", /* name */ + NULL, /* gate */ + cleanup_eh, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_TREE_EH, /* tv_id */ + PROP_gimple_lcf, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_dump_func /* todo_flags_finish */ + } +}; diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index e8f06264eb4..77896725ae3 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -309,6 +309,7 @@ extern struct gimple_opt_pass pass_tree_profile; extern struct gimple_opt_pass pass_early_tree_profile; extern struct gimple_opt_pass pass_cleanup_cfg; extern struct gimple_opt_pass pass_referenced_vars; +extern struct gimple_opt_pass pass_cleanup_eh; extern struct gimple_opt_pass pass_fixup_cfg; extern struct gimple_opt_pass pass_sra; extern struct gimple_opt_pass pass_sra_early; |