From 784417d1f808ea70f013a90aeede3b20e6013e39 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sun, 16 Dec 2018 00:51:31 +0100 Subject: re PR c++/88482 (ICE when wrongly declaring __cxa_allocate_exception) 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 --- libitm/eh_cpp.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libitm/eh_cpp.cc') diff --git a/libitm/eh_cpp.cc b/libitm/eh_cpp.cc index 7a6c376..55b0c4e 100644 --- a/libitm/eh_cpp.cc +++ b/libitm/eh_cpp.cc @@ -89,7 +89,7 @@ struct __cxa_eh_globals extern void *__cxa_allocate_exception (size_t) WEAK; extern void __cxa_free_exception (void *) WEAK; -extern void __cxa_throw (void *, void *, void *) WEAK; +extern void __cxa_throw (void *, void *, void (*) (void *)) WEAK; extern void *__cxa_begin_catch (void *) WEAK; extern void __cxa_end_catch (void) WEAK; extern void __cxa_tm_cleanup (void *, void *, unsigned int) WEAK; @@ -98,7 +98,7 @@ extern __cxa_eh_globals *__cxa_get_globals (void) WEAK; #if !defined (HAVE_ELF_STYLE_WEAKREF) void *__cxa_allocate_exception (size_t) { return NULL; } void __cxa_free_exception (void *) { return; } -void __cxa_throw (void *, void *, void *) { return; } +void __cxa_throw (void *, void *, void (*) (void *)) { return; } void *__cxa_begin_catch (void *) { return NULL; } void __cxa_end_catch (void) { return; } void __cxa_tm_cleanup (void *, void *, unsigned int) { return; } @@ -136,7 +136,7 @@ _ITM_cxa_free_exception (void *exc_ptr) } void -_ITM_cxa_throw (void *obj, void *tinfo, void *dest) +_ITM_cxa_throw (void *obj, void *tinfo, void (*dest) (void *)) { // This used to be instrumented, but does not need to be anymore. __cxa_throw (obj, tinfo, dest); -- cgit v1.1