aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorTorvald Riegel <triegel@redhat.com>2015-11-20 00:10:08 +0000
committerTorvald Riegel <torvald@gcc.gnu.org>2015-11-20 00:10:08 +0000
commit258c1d072225bac0a5063ce486907c9b6eb357e2 (patch)
treea5f0213fc60fbb82a4c54b886984d2979e44646d /gcc/cp
parent9afebea2d5e12b574d70497a87f0d2fd1b1d7f90 (diff)
downloadgcc-258c1d072225bac0a5063ce486907c9b6eb357e2.zip
gcc-258c1d072225bac0a5063ce486907c9b6eb357e2.tar.gz
gcc-258c1d072225bac0a5063ce486907c9b6eb357e2.tar.bz2
Support __cxa_free_exception and fix exception handling.
gcc/cp/ * except.c (do_free_exception): Use transactional wrapper. libitm/ * testsuite/libitm.c++/eh-5.C: New. * libitm.h (_ITM_cxa_free_exception): New. * libitm.map (_ITM_cxa_free_exception): Add it. * libitm.texi: Update ABI docs. * libitm_i.h (gtm_transaction_cp::cxa_unthrown): Remove. (gtm_transaction_cp::cxa_uncaught_count): Add. (gtm_thread::cxa_unthrown): Remove. (gtm_thread::cxa_uncaught_count_ptr): Add. (gtm_thread::cxa_uncaught_count): Add. (gtm_thread::drop_references_allocations): Rename to... (gtm_thread::discard_allocation): ... this and adapt. (gtm_thread::init_cpp_exceptions): New. * beginend.cc (gtm_thread::gtm_thread): Adapt EH handling. (gtm_thread::begin_transaction): Likewise. (gtm_transaction_cp::save): Likewise. (gtm_thread::trycommit): Likewise. * eh_cpp.cc: Add overview comments. (__cxa_eh_globals, __cxa_get_globals, __cxa_free_exception): Declare. (free_any_exception, _ITM_cxa_free_exception): New. (gtm_thread::init_cpp_exceptions): Define. (_ITM_cxa_allocate_exception, _ITM_cxa_throw): Adapt. (_ITM_cxa_begin_catch, _ITM_cxa_end_catch): Likewise. (gtm_thread::revert_cpp_exceptions): Likewise. From-SVN: r230634
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/except.c10
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c4b7614..92b1d28 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2015-11-19 Torvald Riegel <triegel@redhat.com>
+
+ * except.c (do_free_exception): Use transactional wrapper.
+
2015-11-19 Jason Merrill <jason@redhat.com>
PR c++/68422
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 9b2450d..ad40436 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -662,6 +662,16 @@ do_free_exception (tree ptr)
/* Declare void __cxa_free_exception (void *) throw(). */
fn = declare_library_fn (fn, void_type_node, ptr_type_node,
ECF_NOTHROW | ECF_LEAF);
+
+ if (flag_tm)
+ {
+ tree fn2 = get_identifier ("_ITM_cxa_free_exception");
+ if (!get_global_value_if_present (fn2, &fn2))
+ fn2 = declare_library_fn (fn2, void_type_node,
+ ptr_type_node,
+ ECF_NOTHROW | ECF_LEAF | ECF_TM_PURE);
+ record_tm_replacement (fn, fn2);
+ }
}
return cp_build_function_call_nary (fn, tf_warning_or_error, ptr, NULL_TREE);