]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/58282 (g++.dg/tm/noexcept-1.C -fno-exceptions SIGSEGV in gimple_build_eh_mu...
authorTom de Vries <tom@codesourcery.com>
Fri, 25 Oct 2013 14:20:06 +0000 (14:20 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Fri, 25 Oct 2013 14:20:06 +0000 (14:20 +0000)
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

gcc/cp/ChangeLog
gcc/cp/except.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tm/noexcept-6.C [new file with mode: 0644]

index 57246b2bb884c23c4f33e7c489215ca67d8736d2..61bb61d2d0ad9bd59567a6e9cb4b5293fb273a06 100644 (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
index f7a1c7e511a4950ff5df17306ddfb2088a51434f..fbc29d0d2f972fdf664f3236355e34bec9e77749 100644 (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);
index e04942b3f6c90cad300ce46828b55a2e9870b661..fe2cd378528fbe3b78c807107a06d845467d5976 100644 (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.
diff --git a/gcc/testsuite/g++.dg/tm/noexcept-6.C b/gcc/testsuite/g++.dg/tm/noexcept-6.C
new file mode 100644 (file)
index 0000000..4391159
--- /dev/null
@@ -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" } } */