===================================================================
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-ipa-tmipa" } */
+
+extern void bark(void);
+
+__attribute__((transaction_callable))
+int foo()
+{
+ bark();
+}
+
+/* { dg-final { scan-ipa-dump-times "changeTransactionMode \\(0\\)" 1 "tmipa" } } */
+/* { dg-final { cleanup-ipa-dump "tmipa" } } */
===================================================================
@@ -11,7 +11,7 @@ foo()
{
__transaction [[relaxed]] {
global++;
- __builtin__ITM_changeTransactionMode ();
+ __builtin__ITM_changeTransactionMode (0);
george++;
}
}
===================================================================
@@ -55,7 +55,7 @@
#define AR_EXCEPTIONBLOCKABORT 0x0008
#define AR_OUTERABORT 0x0010
-#define MODE_SERIALIRREVOCABLE 0x0001
+#define MODE_SERIALIRREVOCABLE 0x0000
/* The representation of a transaction changes several times during the
@@ -4186,7 +4186,8 @@ ipa_tm_insert_irr_call (struct cgraph_no
transaction_subcode_ior (region, GTMA_MAY_ENTER_IRREVOCABLE);
- g = gimple_build_call (built_in_decls[BUILT_IN_TM_IRREVOCABLE], 0);
+ g = gimple_build_call (built_in_decls[BUILT_IN_TM_IRREVOCABLE],
+ 1, build_int_cst (NULL_TREE, MODE_SERIALIRREVOCABLE));
split_block_after_labels (bb);
gsi = gsi_after_labels (bb);
===================================================================
@@ -8,7 +8,7 @@ DEF_TM_BUILTIN (BUILT_IN_TM_COMMIT_EH, "
DEF_TM_BUILTIN (BUILT_IN_TM_ABORT, "_ITM_abortTransaction",
BT_FN_INT, ATTR_TM_NORETURN_NOTHROW_LIST)
DEF_TM_BUILTIN (BUILT_IN_TM_IRREVOCABLE, "_ITM_changeTransactionMode",
- BT_FN_INT, ATTR_TM_NOTHROW_LIST)
+ BT_FN_INT_INT, ATTR_TM_NOTHROW_LIST)
DEF_TM_BUILTIN (BUILT_IN_TM_MEMCPY, "_ITM_memcpyRtWt",
BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_TM_TMPURE_NOTHROW_LIST)