re PR middle-end/51212 (ICE: verify_flow_info failed: BB 3 can not throw but has...
authorAldy Hernandez <aldyh@redhat.com>
Thu, 22 Dec 2011 20:18:11 +0000 (20:18 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Thu, 22 Dec 2011 20:18:11 +0000 (20:18 +0000)
PR middle-end/51212
* opts.c (finish_options): Call sorry on -fgnu-tm and
-fnon-call-exceptions combination.

From-SVN: r182636

gcc/ChangeLog
gcc/opts.c
gcc/testsuite/g++.dg/tm/pr51212.C [new file with mode: 0644]

index 8e7d8e5724a48867bf541183ff28e4a09c29e685..e01b24d5da4be3f7e6cc648753df41323e011153 100644 (file)
@@ -1,3 +1,9 @@
+2011-12-22  Aldy Hernandez  <aldyh@redhat.com>
+
+       PR middle-end/51212
+       * opts.c (finish_options): Call sorry on -fgnu-tm and
+       -fnon-call-exceptions combination.
+
 2011-12-22  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        * doc/invoke.texi (C++ Dialect Options): Add missing options and
index 3153fe5027494619e8d1afbd3a3731c47675dda2..2ed556030eb26f4fffca3324f9e2d97ed1898cb0 100644 (file)
@@ -663,6 +663,9 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
       opts->x_flag_toplevel_reorder = 0;
     }
 
+  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;
diff --git a/gcc/testsuite/g++.dg/tm/pr51212.C b/gcc/testsuite/g++.dg/tm/pr51212.C
new file mode 100644 (file)
index 0000000..9d2971b
--- /dev/null
@@ -0,0 +1,19 @@
+// { dg-do compile }
+// { dg-options "-fgnu-tm -fnon-call-exceptions" }
+
+struct S
+{
+  S ()
+  {
+  }
+};
+
+__attribute__ ((transaction_callable))
+void foo (int *p)
+{
+  S s;
+  if (*p)
+    ;
+}
+
+// { dg-message "sorry, unimplemented: transactional memory is not supported with non-call exceptions" "-fnon-call-exceptions and -fgnu-tm together" { target *-*-* } 0 }