From: Tom de Vries Date: Fri, 25 Oct 2013 14:20:06 +0000 (+0000) Subject: re PR c++/58282 (g++.dg/tm/noexcept-1.C -fno-exceptions SIGSEGV in gimple_build_eh_mu... X-Git-Tag: releases/gcc-4.7.4~435 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bf6dc8c9c9a772df9240a1eeb0c6184b2553222;p=thirdparty%2Fgcc.git re PR c++/58282 (g++.dg/tm/noexcept-1.C -fno-exceptions SIGSEGV in gimple_build_eh_must_not_throw) 2013-10-25 Tom de Vries PR c++/58282 * except.c (build_must_not_throw_expr): Handle flag_exceptions. * g++.dg/tm/noexcept-6.C: New test. From-SVN: r204069 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 57246b2bb884..61bb61d2d0ad 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-10-25 Tom de Vries + + PR c++/58282 + * except.c (build_must_not_throw_expr): Handle + flag_exceptions. + 2013-10-16 Paolo Carlini PR c++/58633 diff --git a/gcc/cp/except.c b/gcc/cp/except.c index f7a1c7e511a4..fbc29d0d2f97 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -383,6 +383,9 @@ build_must_not_throw_expr (tree body, tree cond) { tree type = body ? TREE_TYPE (body) : void_type_node; + if (!flag_exceptions) + return body; + if (cond && !value_dependent_expression_p (cond)) { cond = cxx_constant_value (cond); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e04942b3f6c9..fe2cd378528f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-10-25 Tom de Vries + + PR c++/58282 + * g++.dg/tm/noexcept-6.C: New test. + 2013-10-25 Eric Botcazou * gcc.c-torture/execute/pr58831.c: New test. diff --git a/gcc/testsuite/g++.dg/tm/noexcept-6.C b/gcc/testsuite/g++.dg/tm/noexcept-6.C new file mode 100644 index 000000000000..4391159e2353 --- /dev/null +++ b/gcc/testsuite/g++.dg/tm/noexcept-6.C @@ -0,0 +1,23 @@ +// { dg-do compile } +// { dg-options "-fno-exceptions -fgnu-tm -O -std=c++0x -fdump-tree-tmlower" } + +struct TrueFalse +{ + static constexpr bool v() { return true; } +}; + +int global; + +template int foo() +{ + return __transaction_atomic noexcept(T::v()) (global + 1); +} + +int f1() +{ + return foo(); +} + +/* { dg-final { scan-tree-dump-times "eh_must_not_throw" 0 "tmlower" } } */ +/* { dg-final { scan-tree-dump-times "__transaction_atomic" 1 "tmlower" } } */ +/* { dg-final { cleanup-tree-dump "tmlower" } } */