From 7ba6572377d8cc69471fc77f37c1880e808c449c Mon Sep 17 00:00:00 2001
From: Aldy Hernandez <aldyh@redhat.com>
Date: Wed, 4 Jan 2012 14:53:30 +0000
Subject: [PATCH] re PR middle-end/51212 (ICE: verify_flow_info failed: BB 3
 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and
 transaction_callable)

        PR middle-end/51212
        * opts.c (finish_options): Sorry out when using transactional
        memory and non-call exceptions.
        * doc/invoke.texi (C Dialect Options): Document it.

From-SVN: r182877
---
 gcc/ChangeLog       | 7 +++++++
 gcc/doc/invoke.texi | 3 +++
 gcc/opts.c          | 3 +++
 3 files changed, 13 insertions(+)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fc6445649716..d01b88deeb42 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2012-01-04  Aldy Hernandez  <aldyh@redhat.com>
+
+	PR middle-end/51212
+	* opts.c (finish_options): Sorry out when using transactional
+	memory and non-call exceptions.
+	* doc/invoke.texi (C Dialect Options): Document it.
+
 2012-01-04  Aldy Hernandez  <aldyh@redhat.com>
 
 	PR middle-end/51696
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index bb05d88b55f5..1e45b616f48d 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -1742,6 +1742,9 @@ For more information on GCC's support for transactional memory,
 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
 Transactional Memory Library}.
 
+Note that the transactional memory feature is not supported with
+non-call exceptions (@option{-fnon-call-exceptions}).
+
 @item -fms-extensions
 @opindex fms-extensions
 Accept some non-standard constructs used in Microsoft header files.
diff --git a/gcc/opts.c b/gcc/opts.c
index 2ed556030eb2..121cf69304b0 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -666,6 +666,9 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
   if (opts->x_flag_tm && opts->x_flag_non_call_exceptions)
     sorry ("transactional memory is not supported with non-call exceptions");
 
+  if (opts->x_flag_tm && opts->x_flag_non_call_exceptions)
+    sorry ("transactional memory is not supported with non-call exceptions");
+
   /* -Wmissing-noreturn is alias for -Wsuggest-attribute=noreturn.  */
   if (opts->x_warn_missing_noreturn)
     opts->x_warn_suggest_attribute_noreturn = true;
-- 
GitLab