===================================================================
@@ -1476,6 +1476,7 @@ copy_bb (copy_body_data *id, basic_block
basic_block copy_basic_block;
tree decl;
gcov_type freq;
+ bool dst_fn_is_tm_pure = is_tm_pure (id->dst_fn);
/* create_basic_block() will append every new block to
basic_block_info automatically. */
@@ -1504,6 +1505,9 @@ copy_bb (copy_body_data *id, basic_block
if (gimple_nop_p (stmt))
continue;
+ if (dst_fn_is_tm_pure && gimple_code (stmt) == GIMPLE_ASM)
+ gimple_asm_set_tm_safe (stmt, true);
+
gimple_duplicate_stmt_histograms (cfun, stmt, id->src_cfun, orig_stmt);
seq_gsi = copy_gsi;
> Which then immediately fails for one layer of indirection: Well, this we can fix with a small change to the inliner, by propagating the ASM_TM_SAFE bit through the inlined copies. See patch below. I'm worried the tm_waiver approach will require changes to TM sources. But I'll gladly let you play around with it. Thanks.