Index: testsuite/gcc.dg/lto/trans-mem-2_0.c
===================================================================
--- testsuite/gcc.dg/lto/trans-mem-2_0.c	(revision 183474)
+++ testsuite/gcc.dg/lto/trans-mem-2_0.c	(working copy)
@@ -1,17 +1,19 @@
 /* { dg-lto-options {{-flto -fgnu-tm}} } */
 /* { dg-lto-do link } */
+/* { dg-require-effective-target stdint_types } */
+
+#include <stdint.h>
 
 extern void foobar() __attribute__((transaction_callable));
 
-#define dummy(func) \
-  __attribute__((noinline,noclone,used)) void func() { asm (""); }
+#define noinline __attribute__((noinline,noclone,used))
 
-dummy(_ITM_beginTransaction)
-dummy(_ITM_commitTransaction)
-dummy(_ITM_WU4)
-dummy(_ITM_WU8)
-dummy(_ITM_registerTMCloneTable)
-dummy(_ITM_deregisterTMCloneTable)
+noinline uint32_t _ITM_beginTransaction(uint32_t a, ...) { asm(""); }
+noinline void _ITM_commitTransaction (void) { asm(""); }
+noinline void _ITM_WU4 (void *a, uint32_t b) { asm(""); }
+noinline void _ITM_WU8 (void *a, uint64_t b) { asm(""); }
+noinline void _ITM_registerTMCloneTable (void) { asm(""); }
+noinline void _ITM_deregisterTMCloneTable (void) { asm(""); }
 
 main()
 {
Index: testsuite/gcc.dg/lto/trans-mem-4_0.c
===================================================================
--- testsuite/gcc.dg/lto/trans-mem-4_0.c	(revision 0)
+++ testsuite/gcc.dg/lto/trans-mem-4_0.c	(revision 0)
@@ -0,0 +1,12 @@
+/* { dg-lto-options {{-flto -fgnu-tm}} } */
+/* { dg-lto-do link } */
+/* { dg-require-effective-target stdint_types } */
+
+extern void foo() __attribute__((transaction_safe));
+
+int main()
+{
+  __transaction_atomic {
+      foo();
+  }
+}
Index: testsuite/gcc.dg/lto/trans-mem-4_1.c
===================================================================
--- testsuite/gcc.dg/lto/trans-mem-4_1.c	(revision 0)
+++ testsuite/gcc.dg/lto/trans-mem-4_1.c	(revision 0)
@@ -0,0 +1,14 @@
+#include <stdint.h>
+
+__attribute__((transaction_safe))
+void foo() 
+{
+}
+
+uint32_t _ITM_beginTransaction(uint32_t prop, ...)
+{
+}
+
+void __builtin__ITM_commitTransaction (void)
+{
+}
Index: testsuite/gcc.dg/lto/trans-mem-1_0.c
===================================================================
--- testsuite/gcc.dg/lto/trans-mem-1_0.c	(revision 183474)
+++ testsuite/gcc.dg/lto/trans-mem-1_0.c	(working copy)
@@ -1,5 +1,6 @@
 /* { dg-lto-options {{-flto -fgnu-tm}} } */
 /* { dg-lto-do link } */
+/* { dg-require-effective-target stdint_types } */
 
 int i;
 
Index: testsuite/gcc.dg/lto/trans-mem-3_0.c
===================================================================
--- testsuite/gcc.dg/lto/trans-mem-3_0.c	(revision 183474)
+++ testsuite/gcc.dg/lto/trans-mem-3_0.c	(working copy)
@@ -1,5 +1,6 @@
 /* { dg-lto-options {{-flto}} } */
 /* { dg-lto-do link } */
+/* { dg-require-effective-target stdint_types } */
 
 /* Test that we can build one object file with -fgnu-tm
    (trans-mem-3_1.c), but do the final link of all objects without
Index: testsuite/gcc.dg/lto/trans-mem-1_1.c
===================================================================
--- testsuite/gcc.dg/lto/trans-mem-1_1.c	(revision 183474)
+++ testsuite/gcc.dg/lto/trans-mem-1_1.c	(working copy)
@@ -1,9 +1,10 @@
-#define dummy(func) \
-  __attribute__((noinline,noclone,used)) void func() { asm (""); }
+#include <stdint.h>
 
-dummy(_ITM_beginTransaction)
-dummy(_ITM_commitTransaction)
-dummy(_ITM_WU4)
-dummy(_ITM_WU8)
-dummy(_ITM_registerTMCloneTable)
-dummy(_ITM_deregisterTMCloneTable)
+#define noinline __attribute__((noinline,noclone,used))
+
+noinline uint32_t _ITM_beginTransaction(uint32_t a, ...) { asm(""); }
+noinline void _ITM_commitTransaction (void) { asm(""); }
+noinline void _ITM_WU4 (void *a, uint32_t b) { asm(""); }
+noinline void _ITM_WU8 (void *a, uint64_t b) { asm(""); }
+noinline void _ITM_registerTMCloneTable (void) { asm(""); }
+noinline void _ITM_deregisterTMCloneTable (void) { asm(""); }
Index: testsuite/gcc.dg/lto/trans-mem-3_1.c
===================================================================
--- testsuite/gcc.dg/lto/trans-mem-3_1.c	(revision 183474)
+++ testsuite/gcc.dg/lto/trans-mem-3_1.c	(working copy)
@@ -1,5 +1,7 @@
 /* { dg-options "-fgnu-tm" } */
 
+#include <stdint.h>
+
 extern int i;
 
 main()
@@ -7,12 +9,11 @@ main()
   __transaction_atomic { i = 0; }
 }
 
-#define dummy(func)							\
-  __attribute__((noinline,noclone,used)) void func() { asm (""); }
+#define noinline __attribute__((noinline,noclone,used))
 
-dummy(_ITM_beginTransaction)
-dummy(_ITM_commitTransaction)
-dummy(_ITM_WU4)
-dummy(_ITM_WU8)
-dummy(_ITM_registerTMCloneTable)
-dummy(_ITM_deregisterTMCloneTable)
+noinline uint32_t _ITM_beginTransaction(uint32_t a, ...) { asm(""); }
+noinline void _ITM_commitTransaction (void) { asm(""); }
+noinline void _ITM_WU4 (void *a, uint32_t b) { asm(""); }
+noinline void _ITM_WU8 (void *a, uint64_t b) { asm(""); }
+noinline void _ITM_registerTMCloneTable (void) { asm(""); }
+noinline void _ITM_deregisterTMCloneTable (void) { asm(""); }
Index: builtin-types.def
===================================================================
--- builtin-types.def	(revision 183474)
+++ builtin-types.def	(working copy)
@@ -103,6 +103,10 @@ DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_h
 DEF_PRIMITIVE_TYPE (BT_INT_PTR, integer_ptr_type_node)
 DEF_PRIMITIVE_TYPE (BT_FLOAT_PTR, float_ptr_type_node)
 DEF_PRIMITIVE_TYPE (BT_DOUBLE_PTR, double_ptr_type_node)
+DEF_PRIMITIVE_TYPE (BT_CONST_DOUBLE_PTR,
+		    build_pointer_type
+		     (build_qualified_type (double_type_node,
+		     			    TYPE_QUAL_CONST)))
 DEF_PRIMITIVE_TYPE (BT_LONGDOUBLE_PTR, long_double_ptr_type_node)
 DEF_PRIMITIVE_TYPE (BT_PID, pid_type_node)
 DEF_PRIMITIVE_TYPE (BT_SIZE, size_type_node)
@@ -342,10 +346,14 @@ DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_STR
 		     BT_INT, BT_CONST_STRING, BT_CONST_STRING, BT_SIZE)
 DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_CONST_PTR_SIZE,
 		     BT_PTR, BT_PTR, BT_CONST_PTR, BT_SIZE)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_PTR_CONST_PTR_SIZE,
+		     BT_VOID, BT_PTR, BT_CONST_PTR, BT_SIZE)
 DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
 		     BT_INT, BT_CONST_PTR, BT_CONST_PTR, BT_SIZE)
 DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_INT_SIZE,
 		     BT_PTR, BT_PTR, BT_INT, BT_SIZE)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_PTR_INT_SIZE,
+		     BT_VOID, BT_PTR, BT_INT, BT_SIZE)
 DEF_FUNCTION_TYPE_3 (BT_FN_VOID_PTR_INT_INT,
 		     BT_VOID, BT_PTR, BT_INT, BT_INT)
 DEF_FUNCTION_TYPE_3 (BT_FN_VOID_CONST_PTR_PTR_SIZE,
@@ -498,8 +506,8 @@ DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_CONS
 			 BT_VOID, BT_CONST_PTR)
 DEF_FUNCTION_TYPE_VAR_1 (BT_FN_INT_CONST_STRING_VAR,
 			 BT_INT, BT_CONST_STRING)
-DEF_FUNCTION_TYPE_VAR_1 (BT_FN_UINT_UINT_VAR,
-			 BT_UINT, BT_UINT)
+DEF_FUNCTION_TYPE_VAR_1 (BT_FN_UINT32_UINT32_VAR,
+			 BT_UINT32, BT_UINT32)
 
 DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_FILEPTR_CONST_STRING_VAR,
 			 BT_INT, BT_FILEPTR, BT_CONST_STRING)
@@ -539,7 +547,7 @@ DEF_FUNCTION_TYPE_1 (BT_FN_I2_VPTR, BT_I
 DEF_FUNCTION_TYPE_1 (BT_FN_I4_VPTR, BT_I4, BT_VOLATILE_PTR)
 DEF_FUNCTION_TYPE_1 (BT_FN_I8_VPTR, BT_I8, BT_VOLATILE_PTR)
 DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_VPTR, BT_FLOAT, BT_VOLATILE_PTR)
-DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_VPTR, BT_DOUBLE, BT_VOLATILE_PTR)
+DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_CONST_DOUBLE_PTR, BT_DOUBLE, BT_DOUBLE_PTR)
 DEF_FUNCTION_TYPE_1 (BT_FN_LDOUBLE_VPTR, BT_LONGDOUBLE, BT_VOLATILE_PTR)
 
 DEF_FUNCTION_TYPE_2 (BT_FN_VOID_VPTR_I1, BT_VOID, BT_VOLATILE_PTR, BT_I1)
Index: builtins.def
===================================================================
--- builtins.def	(revision 183474)
+++ builtins.def	(working copy)
@@ -147,7 +147,7 @@ along with GCC; see the file COPYING3.
 #undef DEF_TM_BUILTIN
 #define DEF_TM_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
   DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,    \
-	       false, true, true, ATTRS, false, flag_tm)
+	       true, true, true, ATTRS, false, flag_tm)
 
 /* Define an attribute list for math functions that are normally
    "impure" because some of them may write into global memory for
Index: gtm-builtins.def
===================================================================
--- gtm-builtins.def	(revision 183474)
+++ gtm-builtins.def	(working copy)
@@ -1,21 +1,21 @@
 DEF_TM_BUILTIN (BUILT_IN_TM_START, "_ITM_beginTransaction",
-		BT_FN_UINT_UINT_VAR, ATTR_TM_NOTHROW_RT_LIST)
+		BT_FN_UINT32_UINT32_VAR, ATTR_TM_NOTHROW_RT_LIST)
 
 DEF_TM_BUILTIN (BUILT_IN_TM_COMMIT, "_ITM_commitTransaction",
 		BT_FN_VOID, ATTR_TM_NOTHROW_LIST)
 DEF_TM_BUILTIN (BUILT_IN_TM_COMMIT_EH, "_ITM_commitTransactionEH",
 		BT_FN_VOID_PTR, ATTR_TM_NOTHROW_LIST)
 DEF_TM_BUILTIN (BUILT_IN_TM_ABORT, "_ITM_abortTransaction",
-		BT_FN_INT, ATTR_TM_NORETURN_NOTHROW_LIST)
+		BT_FN_VOID_INT, ATTR_TM_NORETURN_NOTHROW_LIST)
 DEF_TM_BUILTIN (BUILT_IN_TM_IRREVOCABLE, "_ITM_changeTransactionMode",
-		BT_FN_INT_INT, ATTR_TM_NOTHROW_LIST)
+		BT_FN_VOID_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)
+		BT_FN_VOID_PTR_CONST_PTR_SIZE, ATTR_TM_TMPURE_NOTHROW_LIST)
 DEF_TM_BUILTIN (BUILT_IN_TM_MEMMOVE, "_ITM_memmoveRtWt",
-		BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_TM_TMPURE_NOTHROW_LIST)
+		BT_FN_VOID_PTR_CONST_PTR_SIZE, ATTR_TM_TMPURE_NOTHROW_LIST)
 DEF_TM_BUILTIN (BUILT_IN_TM_MEMSET, "_ITM_memsetW",
-	       	BT_FN_PTR_PTR_INT_SIZE, ATTR_TM_TMPURE_NOTHROW_LIST)
+	       	BT_FN_VOID_PTR_INT_SIZE, ATTR_TM_TMPURE_NOTHROW_LIST)
 
 DEF_TM_BUILTIN (BUILT_IN_TM_GETTMCLONE_IRR, "_ITM_getTMCloneOrIrrevocable",
 		BT_FN_PTR_PTR, ATTR_TM_CONST_NOTHROW_LIST)
@@ -172,13 +172,13 @@ DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RFW_FLO
 		BT_FN_FLOAT_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
 
 DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_DOUBLE, "_ITM_RD",
-		BT_FN_DOUBLE_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
+		BT_FN_DOUBLE_CONST_DOUBLE_PTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
 DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAR_DOUBLE, "_ITM_RaRD",
-		BT_FN_FLOAT_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
+		BT_FN_DOUBLE_CONST_DOUBLE_PTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
 DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAW_DOUBLE, "_ITM_RaWD",
-		BT_FN_FLOAT_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
+		BT_FN_DOUBLE_CONST_DOUBLE_PTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
 DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RFW_DOUBLE, "_ITM_RfWD",
-		BT_FN_FLOAT_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
+		BT_FN_DOUBLE_CONST_DOUBLE_PTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
 
 /* These stubs should get defined in the backend if applicable.  */
 DEF_BUILTIN_STUB (BUILT_IN_TM_LOAD_M64, "__builtin__ITM_RM64")
