===================================================================
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O1" } */
+
+static inline void
+inline_death ()
+{
+ __asm__ (""); /* { dg-error "asm not allowed" } */
+}
+
+void
+tranfunction ()
+{
+ __transaction
+ {
+ inline_death ();
+ }
+}
===================================================================
@@ -3929,6 +3929,13 @@ ipa_tm_diagnose_transaction (struct cgra
gimple stmt = gsi_stmt (gsi);
tree fndecl;
+ if (gimple_code (stmt) == GIMPLE_ASM)
+ {
+ error_at (gimple_location (stmt),
+ "asm not allowed in atomic transaction");
+ continue;
+ }
+
if (!is_gimple_call (stmt))
continue;
fndecl = gimple_call_fndecl (stmt);