aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/cp-gimplify.cc2
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/except.cc5
3 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/cp-gimplify.cc b/gcc/cp/cp-gimplify.cc
index 216a623..853b1e4 100644
--- a/gcc/cp/cp-gimplify.cc
+++ b/gcc/cp/cp-gimplify.cc
@@ -343,7 +343,7 @@ gimplify_must_not_throw_expr (tree *expr_p, gimple_seq *pre_p)
gimple *mnt;
gimplify_and_add (body, &try_);
- mnt = gimple_build_eh_must_not_throw (terminate_fn);
+ mnt = gimple_build_eh_must_not_throw (call_terminate_fn);
gimple_seq_add_stmt_without_update (&catch_, mnt);
mnt = gimple_build_try (try_, catch_, GIMPLE_TRY_CATCH);
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index ce2095c..101da35 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -217,6 +217,7 @@ enum cp_tree_index
definitions. */
CPTI_ALIGN_TYPE,
CPTI_TERMINATE_FN,
+ CPTI_CALL_TERMINATE_FN,
CPTI_CALL_UNEXPECTED_FN,
/* These are lazily inited. */
@@ -358,6 +359,7 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
/* Exception handling function declarations. */
#define terminate_fn cp_global_trees[CPTI_TERMINATE_FN]
#define call_unexpected_fn cp_global_trees[CPTI_CALL_UNEXPECTED_FN]
+#define call_terminate_fn cp_global_trees[CPTI_CALL_TERMINATE_FN]
#define get_exception_ptr_fn cp_global_trees[CPTI_GET_EXCEPTION_PTR_FN]
#define begin_catch_fn cp_global_trees[CPTI_BEGIN_CATCH_FN]
#define end_catch_fn cp_global_trees[CPTI_END_CATCH_FN]
diff --git a/gcc/cp/except.cc b/gcc/cp/except.cc
index 91a5e04..b04eb00 100644
--- a/gcc/cp/except.cc
+++ b/gcc/cp/except.cc
@@ -64,6 +64,9 @@ init_exception_processing (void)
tmp = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
call_unexpected_fn
= push_throw_library_fn (get_identifier ("__cxa_call_unexpected"), tmp);
+ call_terminate_fn
+ = push_library_fn (get_identifier ("__cxa_call_terminate"), tmp, NULL_TREE,
+ ECF_NORETURN | ECF_COLD | ECF_NOTHROW);
}
/* Returns an expression to be executed if an unhandled exception is
@@ -76,7 +79,7 @@ cp_protect_cleanup_actions (void)
When the destruction of an object during stack unwinding exits
using an exception ... void terminate(); is called. */
- return terminate_fn;
+ return call_terminate_fn;
}
static tree