Skip to content
Snippets Groups Projects
  1. Jan 03, 2024
  2. Jan 16, 2023
  3. Jan 03, 2022
  4. Nov 26, 2021
    • Iain Sandoe's avatar
      libitm: Fix bootstrap for targets without HAVE_ELF_STYLE_WEAKREF. · caa04517
      Iain Sandoe authored
      
      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: default avatarIain 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.
      caa04517
  5. Jan 04, 2021
  6. May 12, 2020
    • Nathan Sidwell's avatar
      Fix throw specifiers on interface. · f0de5d83
      Nathan Sidwell authored
      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.
      f0de5d83
  7. Jan 01, 2020
  8. Jan 01, 2019
  9. Dec 15, 2018
    • Jakub Jelinek's avatar
      re PR c++/88482 (ICE when wrongly declaring __cxa_allocate_exception) · 784417d1
      Jakub Jelinek authored
      	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
      784417d1
  10. Jan 03, 2018
  11. Jan 01, 2017
  12. Jan 04, 2016
  13. Nov 20, 2015
    • Torvald Riegel's avatar
      Support __cxa_free_exception and fix exception handling. · 258c1d07
      Torvald Riegel authored
      	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
      258c1d07
  14. Jan 05, 2015
  15. Jan 02, 2014
  16. Feb 11, 2013
    • Iain Sandoe's avatar
      re PR libitm/55693 (libitm.c++/eh-1.C execution test fails on darwin from r193271) · 6c59ffd1
      Iain Sandoe authored
      
      /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: default avatarJack Howarth <howarth@bromo.med.uc.edu>
      Co-Authored-By: default avatarPatrick Marlier <patrick.marlier@gmail.com>
      
      From-SVN: r195960
      6c59ffd1
  17. Feb 03, 2013
  18. May 21, 2012
  19. Feb 15, 2012
  20. Jan 10, 2012
  21. Nov 22, 2011
    • Iain Sandoe's avatar
      weakref.m4: New file. · 8cf36bb3
      Iain Sandoe authored
      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
      8cf36bb3
  22. Nov 17, 2011
    • Rainer Orth's avatar
      Provide all dummy functions in alloc_cpp.cc, eh_cpp.cc · d846e425
      Rainer Orth authored
      	* 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
      d846e425
  23. Nov 08, 2011
Loading