Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
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.
|
|
|
|
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.
|
|
From-SVN: r279813
|
|
From-SVN: r267494
|
|
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
|
|
From-SVN: r256169
|
|
From-SVN: r243994
|
|
From-SVN: r232055
|
|
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
|
|
From-SVN: r219188
|
|
From-SVN: r206298
|
|
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
|
|
From-SVN: r195697
|
|
2012-05-21 Patrick Marlier <patrick.marlier@gmail.com>
* eh_cpp.cc: Fix __cxa_end_catch declaration.
From-SVN: r187747
|
|
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
|
|
* libitm_i.h (_Unwind_DeleteException): Declare weak.
* eh_cpp.cc (_Unwind_DeleteException): Define for
!HAVE_ELF_STYLE_WEAKREF.
From-SVN: r183049
|
|
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
|
|
* 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
|
|
From-SVN: r181154
|