$ arm-none-linux-gnueabi-g++ gcc/testsuite/g++.dg/tm/noexcept-1.C -fno-diagnostics-show-caret -fdiagnostics-color=never -fno-exceptions -fmessage-length=0 -fgnu-tm -O -std=c++0x -fdump-tree-tmmark -fdump-tree-tmlower -S -o noexcept-1.s gcc/testsuite/g++.dg/tm/noexcept-1.C: In function 'int foo() [with T = TrueFalse]':^M gcc/testsuite/g++.dg/tm/noexcept-1.C:13:43: internal compiler error: Segmentation fault^M 0x8951d05 crash_signal^M gcc/toplev.c:335^M 0x8707b50 gimple_build_eh_must_not_throw(tree_node*)^M gcc/gimple.c:730^M 0x8448b8a gimplify_must_not_throw_expr^M gcc/cp/cp-gimplify.c:503^M 0x844917a cp_gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**)^M gcc/cp/cp-gimplify.c:571^M 0x874de93 gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int)^M gcc/gimplify.c:7241^M 0x87470ba gimplify_stmt(tree_node**, gimple_statement_d**)^M gcc/gimplify.c:5699^M 0x87351b9 gimplify_bind_expr^M gcc/gimplify.c:1213^M 0x874eb0e gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int)^M gcc/gimplify.c:7493^M 0x87470ba gimplify_stmt(tree_node**, gimple_statement_d**)^M gcc/gimplify.c:5699^M 0x8732bfe gimplify_and_add(tree_node*, gimple_statement_d**)^M gcc/gimplify.c:329^M 0x8732c2d gimplify_and_return_first^M gcc/gimplify.c:341^M 0x874d8cf gimplify_transaction^M gcc/gimplify.c:7042^M 0x874fcb6 gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int)^M gcc/gimplify.c:7803^M 0x87470ba gimplify_stmt(tree_node**, gimple_statement_d**)^M gcc/gimplify.c:5699^M 0x87363fe gimplify_statement_list^M gcc/gimplify.c:1525^M 0x874f95d gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int)^M gcc/gimplify.c:7711^M 0x87470ba gimplify_stmt(tree_node**, gimple_statement_d**)^M gcc/gimplify.c:5699^M 0x8751d46 gimplify_body(tree_node*, bool)^M gcc/gimplify.c:8356^M 0x87524b2 gimplify_function_tree(tree_node*)^M gcc/gimplify.c:8488^M 0x8572c9a analyze_function^M gcc/cgraphunit.c:630^M Please submit a full bug report,^M with preprocessed source if appropriate.^M Please include the complete backtrace with any bug report.^M See <http://gcc.gnu.org/bugs.html> for instructions.^M compiler exited with status 1
svn revision 202105 Configured with: src/gcc-mainline/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++,fortran --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_atexit --disable-nls --prefix=install --with-sysroot=install/arm-none-linux-gnueabi/libc --with-gmp=obj/pkg-mainline-0-arm-none-linux-gnueabi/fsf-mainline-0-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-mpfr=obj/pkg-mainline-0-arm-none-linux-gnueabi/fsf-mainline-0-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-mpc=obj/pkg-mainline-0-arm-none-linux-gnueabi/fsf-mainline-0-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-isl=obj/pkg-mainline-0-arm-none-linux-gnueabi/fsf-mainline-0-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-cloog=obj/pkg-mainline-0-arm-none-linux-gnueabi/fsf-mainline-0-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-libelf=obj/pkg-mainline-0-arm-none-linux-gnueabi/fsf-mainline-0-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --disable-libgomp --disable-libitm --enable-poison-system-directories --with-build-time-tools=install/arm-none-linux-gnueabi/bin --with-build-time-tools=install/arm-none-linux-gnueabi/bin SED=sed
It seems terminate_node is NULL ... Program received signal SIGSEGV, Segmentation fault. 0x08707b50 in gimple_build_eh_must_not_throw (decl=0x0) at /home/vries/local/fsf_gcc_mainline_arm_none_linux_gnueabi/src/gcc-mainline/gcc/gimple.c:730 730 gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); (gdb) up #1 0x08448b8b in gimplify_must_not_throw_expr (expr_p=0xf7dd8030, pre_p=0xffffc73c) at /home/vries/local/fsf_gcc_mainline_arm_none_linux_gnueabi/src/gcc-mainline/gcc/cp/cp-gimplify.c:503 503 mnt = gimple_build_eh_must_not_throw (terminate_node); ...
also reproduces with x86_64
Tentative fix: ... diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index ee3503c..c8b328c 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -5189,7 +5189,7 @@ finish_transaction_stmt (tree stmt, tree compound_stmt, int flags, tree noex) /* noexcept specifications are not allowed for function transactions. */ gcc_assert (!(noex && compound_stmt)); - if (noex) + if (noex && flag_exceptions) { tree body = build_must_not_throw_expr (TRANSACTION_EXPR_BODY (stmt), noex); @@ -5210,7 +5210,7 @@ tree build_transaction_expr (location_t loc, tree expr, int flags, tree noex) { tree ret; - if (noex) + if (noex && flag_exceptions) { expr = build_must_not_throw_expr (expr, noex); SET_EXPR_LOCATION (expr, loc); ...
http://gcc.gnu.org/ml/gcc-patches/2013-09/msg00119.html
Author: vries Date: Sat Sep 7 23:31:48 2013 New Revision: 202359 URL: http://gcc.gnu.org/viewcvs?rev=202359&root=gcc&view=rev Log: Handle noexcept on transactions with -fno-exceptions 2013-09-08 Tom de Vries <tom@codesourcery.com> PR c++/58282 * except.c (build_must_not_throw_expr): Handle flag_exceptions. Modified: trunk/gcc/ChangeLog trunk/gcc/cp/except.c
Author: vries Date: Sat Sep 7 23:31:58 2013 New Revision: 202360 URL: http://gcc.gnu.org/viewcvs?rev=202360&root=gcc&view=rev Log: Testcase for PR58282 2013-09-08 Tom de Vries <tom@codesourcery.com> PR c++/58282 * g++.dg/tm/noexcept-6.C: New test. Added: trunk/gcc/testsuite/g++.dg/tm/noexcept-6.C Modified: trunk/gcc/testsuite/ChangeLog
Also required for 4.7 and 4.8.
Author: vries Date: Fri Oct 25 13:49:48 2013 New Revision: 204067 URL: http://gcc.gnu.org/viewcvs?rev=204067&root=gcc&view=rev Log: 2013-10-25 Tom de Vries <tom@codesourcery.com> PR c++/58282 * except.c (build_must_not_throw_expr): Handle flag_exceptions. * g++.dg/tm/noexcept-6.C: New test. Added: branches/gcc-4_8-branch/gcc/testsuite/g++.dg/tm/noexcept-6.C Modified: branches/gcc-4_8-branch/gcc/cp/ChangeLog branches/gcc-4_8-branch/gcc/cp/except.c branches/gcc-4_8-branch/gcc/testsuite/ChangeLog
Author: vries Date: Fri Oct 25 14:20:06 2013 New Revision: 204069 URL: http://gcc.gnu.org/viewcvs?rev=204069&root=gcc&view=rev Log: 2013-10-25 Tom de Vries <tom@codesourcery.com> PR c++/58282 * except.c (build_must_not_throw_expr): Handle flag_exceptions. * g++.dg/tm/noexcept-6.C: New test. Added: branches/gcc-4_7-branch/gcc/testsuite/g++.dg/tm/noexcept-6.C Modified: branches/gcc-4_7-branch/gcc/cp/ChangeLog branches/gcc-4_7-branch/gcc/cp/except.c branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
Fixed in trunk, and 4.7 and 4.8 branches.