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  <tom@codesourcery.com>

	PR c++/58282
	* except.c (build_must_not_throw_expr): Handle
	flag_exceptions.

	* g++.dg/tm/noexcept-6.C: New test.

From-SVN: r204069
This commit is contained in:
Tom de Vries 2013-10-25 14:20:06 +00:00 committed by Tom de Vries
parent d44365e583
commit 7bf6dc8c9c
4 changed files with 37 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2013-10-25 Tom de Vries <tom@codesourcery.com>
PR c++/58282
* except.c (build_must_not_throw_expr): Handle
flag_exceptions.
2013-10-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58633

View File

@ -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);

View File

@ -1,3 +1,8 @@
2013-10-25 Tom de Vries <tom@codesourcery.com>
PR c++/58282
* g++.dg/tm/noexcept-6.C: New test.
2013-10-25 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/execute/pr58831.c: New test.

View File

@ -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<typename T> int foo()
{
return __transaction_atomic noexcept(T::v()) (global + 1);
}
int f1()
{
return foo<TrueFalse>();
}
/* { 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" } } */