aboutsummaryrefslogtreecommitdiff
path: root/libitm/eh_cpp.cc
AgeCommit message (Collapse)AuthorFilesLines
2022-01-03Update copyright years.Jakub Jelinek1-1/+1
2021-11-26libitm: Fix bootstrap for targets without HAVE_ELF_STYLE_WEAKREF.Iain Sandoe1-1/+5
Recent improvements to null address warnings notice that for targets that do not support HAVE_ELF_STYLE_WEAKREF the dummy stub implementation of __cxa_get_globals() means that the address can never be null. Fixed by removing the test for such targets. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> libitm/ChangeLog: * eh_cpp.cc (GTM::gtm_thread::init_cpp_exceptions): If the target does not support HAVE_ELF_STYLE_WEAKREF then do not try to test the __cxa_get_globals against NULL.
2021-01-04Update copyright years.Jakub Jelinek1-1/+1
2020-05-12Fix throw specifiers on interface.Nathan Sidwell1-13/+13
I discovered that libitm: (a) declares __cxa_allocate_exception and friends directly, (b) doesn't mark them as 'throw()' (c) doesn't mark the replacment fns _ITM_$foo as nothrow either We happen to get away with it because of code in the compiler that, although it checks the parameter types, doesn't check the exception specification. (One reason being they used to not be part of the language's type system, but now they are.) I suspect this can lead us to generate pessimal code later, if we've seen one of these decls earlier. Anyway, with modules it becomes trickier[*], so I'm trying to clean it up and not be a problem. I see Jakub fixed part of the problem (https://gcc.gnu.org/pipermail/gcc-patches/2018-December/513302.html) AFAICT, he did fix libitm's decls, but left the lax parm-type checking in the compiler. libitm.h is not very informative about specification: in version 1 of http://www.intel.com/some/path/here.pdf. */ Anyway, it was too fiddly to have libitm pick up the declarations from libsupc++. Besides it makes them weak declarations, and then provides definitions for non-elf systems. So this patch adds the expected 'throw()' * libitm/libitm.h (_ITM_NOTHROW): Define. (_ITM_cxa_allocate_exception, _ITM_cxa_free_exception) (_ITM_cxa_begin_catch): Use it. * eh_cpp.cc: Add throw() to __cxa_allocate_exception, __cxa_free_exception, __cxa_begin_catch, __cxa_tm_cleanup, __cxa_get_globals. (_ITM_cxa_allocate_exception, _ITM_cxa_free_exception) (_ITM_cxa_begin_catch): Likewise.
2020-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r279813
2019-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r267494
2018-12-16re PR c++/88482 (ICE when wrongly declaring __cxa_allocate_exception)Jakub Jelinek1-3/+3
PR c++/88482 * except.c (verify_library_fn): New function. (declare_library_fn): Use it. Initialize TM even if the non-TM library function has been user declared. (do_end_catch): Don't set TREE_NOTHROW on error_mark_node. (expand_start_catch_block): Don't call initialize_handler_parm for error_mark_node. (build_throw): Use verify_library_fn. Initialize TM even if the non-TM library function has been user declared. Don't crash if any library fn is error_mark_node. * g++.dg/eh/builtin5.C: New test. * g++.dg/eh/builtin6.C: New test. * g++.dg/eh/builtin7.C: New test. * g++.dg/eh/builtin8.C: New test. * g++.dg/eh/builtin9.C: New test. * g++.dg/eh/builtin10.C: New test. * g++.dg/eh/builtin11.C: New test. * g++.dg/parse/crash55.C: Adjust expected diagnostics. * eh_cpp.cc (__cxa_throw): Change DEST argument type from void * to void (*) (void *). (_ITM_cxa_throw): Likewise. * libitm.h (_ITM_cxa_throw): Likewise. * libitm.texi (_ITM_cxa_throw): Likewise. From-SVN: r267179
2018-01-03Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r256169
2017-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r243994
2016-01-04Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r232055
2015-11-20Support __cxa_free_exception and fix exception handling.Torvald Riegel1-19/+121
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
2015-01-05Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r219188
2014-01-02Update copyright years in libitm/Richard Sandiford1-1/+1
From-SVN: r206298
2013-02-11re PR libitm/55693 (libitm.c++/eh-1.C execution test fails on darwin from ↵Iain Sandoe1-1/+1
r193271) /libgcc 2013-02-11 Iain Sandoe <iain@codesourcery.com> Jack Howarth <howarth@bromo.med.uc.edu> Patrick Marlier <patrick.marlier@gmail.com> PR libitm/55693 * config/darwin-crt-tm.c: Remove dummy functions hack. /gcc 2013-02-11 Iain Sandoe <iain@codesourcery.com> Jack Howarth <howarth@bromo.med.uc.edu> Patrick Marlier <patrick.marlier@gmail.com> PR libitm/55693 * config/darwin.h: Replace ENDFILE_SPEC with TM_DESTRUCTOR and define ENDFILE_SPEC as TM_DESTRUCTOR. * config/i386/darwin.h (ENDFILE_SPEC): Use TM_DESTRUCTOR. /libitm 2013-02-11 Iain Sandoe <iain@codesourcery.com> Jack Howarth <howarth@bromo.med.uc.edu> Patrick Marlier <patrick.marlier@gmail.com> PR libitm/55693 * alloc_cpp.cc: Enable function declarations on darwin. * eh_cpp.cc: Likewise. Co-Authored-By: Jack Howarth <howarth@bromo.med.uc.edu> Co-Authored-By: Patrick Marlier <patrick.marlier@gmail.com> From-SVN: r195960
2013-02-03Update copyright in libitm.Richard Sandiford1-1/+1
From-SVN: r195697
2012-05-21eh_cpp.cc: Fix __cxa_end_catch declaration.Patrick Marlier1-2/+2
2012-05-21 Patrick Marlier <patrick.marlier@gmail.com> * eh_cpp.cc: Fix __cxa_end_catch declaration. From-SVN: r187747
2012-02-15re PR libitm/52220 (FAIL: libitm.c++/eh-1.C execution test due to Xcode 4 ↵Iain Sandoe1-1/+1
weakref linker bug) libitm/ 2012-02-15 Iain Sandoe <iains@gcc.gnu.org> Patrick Marlier <patrick.marlier@gmail.com> PR libitm/52220 * alloc_cpp.cc: No dummy definitions for darwin. * eh_cpp.cc: Likewise. libgcc/ 2012-02-15 Iain Sandoe <iains@gcc.gnu.org> Patrick Marlier <patrick.marlier@gmail.com> PR libitm/52220 * config/darwin-crt-tm.c: Generate dummy functions. Co-Authored-By: Patrick Marlier <patrick.marlier@gmail.com> From-SVN: r184293
2012-01-09libitm_i.h (_Unwind_DeleteException): Declare weak.Richard Henderson1-1/+2
* libitm_i.h (_Unwind_DeleteException): Declare weak. * eh_cpp.cc (_Unwind_DeleteException): Define for !HAVE_ELF_STYLE_WEAKREF. From-SVN: r183049
2011-11-22weakref.m4: New file.Iain Sandoe1-2/+2
config: * weakref.m4: New file. libitm: * configure.ac: Use GCC_CHECK_ELF_STYLE_WEAKREF. * alloc_cpp.cc: Generate dummy functions if we don't HAVE_ELF_STYLE_WEAKREF. * eh_cpp.cc: Likewise. * configure: Regenerate. * aclocal.m4: Likewise. * config.h.in: Likewise. * Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. From-SVN: r181618
2011-11-17Provide all dummy functions in alloc_cpp.cc, eh_cpp.ccRainer Orth1-0/+8
* alloc_cpp.cc [__osf__] (_ZnwX, _ZdlPv, _ZnaX, _ZdaPv, _ZnwXRKSt9nothrow_t, _ZdlPvRKSt9nothrow_t, _ZdaPvRKSt9nothrow_t): Dummy functions. * eh_cpp.cc [__osf__] (__cxa_allocate_exception, __cxa_throw, __cxa_begin_catch, __cxa_end_catch, __cxa_tm_cleanup): Likewise. From-SVN: r181442
2011-11-08Merge from transactional-memory branch.Aldy Hernandez1-0/+108
From-SVN: r181154