gcc_assert (num != 0);
- n = GGC_NEW (struct throw_stmt_node);
+ n = ggc_alloc_throw_stmt_node ();
n->stmt = t;
n->lp_nr = num;
return label;
}
-/* A subroutine of lower_try_finally. If lang_protect_cleanup_actions
- returns non-null, then the language requires that the exception path out
- of a try_finally be treated specially. To wit: the code within the
- finally block may not itself throw an exception. We have two choices here.
- First we can duplicate the finally block and wrap it in a must_not_throw
- region. Second, we can generate code like
+/* A subroutine of lower_try_finally. If the eh_protect_cleanup_actions
+ langhook returns non-null, then the language requires that the exception
+ path out of a try_finally be treated specially. To wit: the code within
+ the finally block may not itself throw an exception. We have two choices
+ here. First we can duplicate the finally block and wrap it in a
+ must_not_throw region. Second, we can generate code like
try {
finally_block;
gimple x;
/* First check for nothing to do. */
- if (lang_protect_cleanup_actions == NULL)
+ if (lang_hooks.eh_protect_cleanup_actions == NULL)
return;
- protect_cleanup_actions = lang_protect_cleanup_actions ();
+ protect_cleanup_actions = lang_hooks.eh_protect_cleanup_actions ();
if (protect_cleanup_actions == NULL)
return;
return false;
return !in_array_bounds_p (expr);
+ case MEM_REF:
+ if (TREE_CODE (TREE_OPERAND (expr, 0)) == ADDR_EXPR)
+ return false;
+ /* Fallthru. */
case INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
return !TREE_THIS_NOTRAP (expr);
*/
static unsigned int
-execute_cleanup_eh (void)
+execute_cleanup_eh_1 (void)
{
/* Do this first: unsplit_all_eh and cleanup_all_empty_eh can die
looking up unreachable landing pads. */
return 0;
}
+static unsigned int
+execute_cleanup_eh (void)
+{
+ int ret = execute_cleanup_eh_1 ();
+
+ /* If the function no longer needs an EH personality routine
+ clear it. This exposes cross-language inlining opportunities
+ and avoids references to a never defined personality routine. */
+ if (DECL_FUNCTION_PERSONALITY (current_function_decl)
+ && function_needs_eh_personality (cfun) != eh_personality_lang)
+ DECL_FUNCTION_PERSONALITY (current_function_decl) = NULL_TREE;
+
+ return ret;
+}
+
static bool
gate_cleanup_eh (void)
{
/* Verify that BB containing STMT as the last statement, has precisely the
edge that make_eh_edges would create. */
-bool
+DEBUG_FUNCTION bool
verify_eh_edges (gimple stmt)
{
basic_block bb = gimple_bb (stmt);
/* Similarly, but handle GIMPLE_EH_DISPATCH specifically. */
-bool
+DEBUG_FUNCTION bool
verify_eh_dispatch_edge (gimple stmt)
{
eh_region r;