diff options
author | Jan Hubicka <jh@suse.cz> | 2009-03-28 20:29:35 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2009-03-28 19:29:35 +0000 |
commit | 33977f81620a3e495be87d0381544f8ad26b2782 (patch) | |
tree | 8cf78aab3664efc13cb9bc78131a15282b59ac4c /gcc/tree-eh.c | |
parent | 617f389789b78deae9670bd5d2716d8189dcde58 (diff) | |
download | gcc-33977f81620a3e495be87d0381544f8ad26b2782.zip gcc-33977f81620a3e495be87d0381544f8ad26b2782.tar.gz gcc-33977f81620a3e495be87d0381544f8ad26b2782.tar.bz2 |
attr-noinline.c: Avoid pure-const optimization.
* gcc.dg/attr-noinline.c: Avoid pure-const optimization.
* gcc.dg/pr33826.c: Update dump files.
* gcc.dg/ipa/ipa-3.c: Avoid pure-const optimization.
* gcc.dg/ipa/ipa-5.c: Avoid pure-const optimization.
Merge from pretty-ipa:
2009-03-27 Jan Hubicka <jh@suse.cz>
* cgraph.c (dump_cgraph_node): Add replace output flag by process.
* tree-pass.h (function_called_by_processed_nodes_p): Declare.
* passes.c (function_called_by_processed_nodes_p): New.
* ipa-pure-const.c (check_call): Fix handling of operands.
(analyze_function): Dump debug output for skipped bodies.
(local_pure_const): Use function_called_by_processed_nodes_p.
* dwarf2out.c (reference_to_unused): Use output.
* passes.c (do_per_function_toporder): Likewise.
2008-11-12 Jan Hubicka <jh@suse.cz>
* tree-pass.h (pass_fixup_cfg, pass_local_pure_const): Declare.
* ipa-pure-const.c (funct_state_d): Add can throw field; make
state_set_in_source enum
(check_decl): Ignore memory tags; do not set fake looping flags;
dump diagnostics.
(check_operand, check_tree, check_rhs_var, check_lhs_var,
get_asm_expr_operands, scan_function_op, scan_function_stmt): Remove.
(check_call, analyze_function): Rewrite.
(check_stmt): New.
(add_new_function): Update call of analyze_function.
(generate_summary): Add call of analyze_function.
(propagate): Propagate can_throw; handle state_set_in_source correctly.
(local_pure_const): New function.
(pass_local_pure_const): New pass.
* ipa-inline.c (inline_transform): Set after_inlining.
* tree-eh.c (stmt_can_throw_external): New.
* tree-optimize.c (execute_fixup_cfg): Do not set after_inlining;
work with aliasing built.
* tree-flow.h (stmt_can_throw_external): New.
* passes.c (init_optimization_passes): Schedule fixup_cfg pass early;
and local pure/const pass in early and late optimization queue.
From-SVN: r145204
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r-- | gcc/tree-eh.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index c992f6d..9febe5a 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -2402,6 +2402,32 @@ tree_could_throw_p (tree t) return false; } +/* Return true if STMT can throw an exception that is not caught within + the current function (CFUN). */ + +bool +stmt_can_throw_external (gimple stmt) +{ + int region_nr; + bool is_resx = false; + bool inlinable_call = false; + + if (!stmt_could_throw_p (stmt)) + return false; + + if (gimple_code (stmt) == GIMPLE_RESX) + { + region_nr = gimple_resx_region (stmt); + is_resx = true; + } + else + region_nr = lookup_stmt_eh_region (stmt); + + if (region_nr < 0) + return true; + + return can_throw_external_1 (region_nr, is_resx, inlinable_call); +} /* Return true if STMT can throw an exception that is caught within the current function (CFUN). */ |