This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/58282] g++.dg/tm/noexcept-1.C -fno-exceptions SIGSEGV in gimple_build_eh_must_not_throw
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 02 Sep 2013 10:31:25 +0000
- Subject: [Bug tree-optimization/58282] g++.dg/tm/noexcept-1.C -fno-exceptions SIGSEGV in gimple_build_eh_must_not_throw
- Auto-submitted: auto-generated
- References: <bug-58282-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58282
--- Comment #4 from vries at gcc dot gnu.org ---
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);
...