re PR c++/88482 (ICE when wrongly declaring __cxa_allocate_exception)
authorJakub Jelinek <jakub@redhat.com>
Sat, 15 Dec 2018 23:51:31 +0000 (00:51 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 15 Dec 2018 23:51:31 +0000 (00:51 +0100)
commit784417d1f808ea70f013a90aeede3b20e6013e39
treed5fb499587fc8a484ff6fc7e4c0565251f7971fb
parente310b38153d15c6d3ae9686eb38b6629f0f93393
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
15 files changed:
gcc/cp/ChangeLog
gcc/cp/except.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/eh/builtin10.C [new file with mode: 0644]
gcc/testsuite/g++.dg/eh/builtin11.C [new file with mode: 0644]
gcc/testsuite/g++.dg/eh/builtin5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/eh/builtin6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/eh/builtin7.C [new file with mode: 0644]
gcc/testsuite/g++.dg/eh/builtin8.C [new file with mode: 0644]
gcc/testsuite/g++.dg/eh/builtin9.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/crash55.C
libitm/ChangeLog
libitm/eh_cpp.cc
libitm/libitm.h
libitm/libitm.texi