This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [trans-mem] set _ITM_memcpyRtWt and _ITM_memmoveRtWt as pure


And this time CCing the list :).

> Thanks to Patrick (again), for reporting and fixing this.  Memcpy and
> memmove should be TM pure.
> 
> rth approved this off-list.
> 
> Committing to branch.
> 
> 	* gtm-builtins.def (_ITM_memmoveRtWt): Make TM pure.
> 	(_ITM_memcpyRtWt): Same.
> 
> Index: testsuite/c-c++-common/tm/memcpy-1.c
> ===================================================================
> --- testsuite/c-c++-common/tm/memcpy-1.c	(revision 0)
> +++ testsuite/c-c++-common/tm/memcpy-1.c	(revision 0)
> @@ -0,0 +1,9 @@
> +/* { dg-do compile } */
> +/* { dg-options "-fgnu-tm" } */
> +#include <string.h>
> +
> +__attribute__((transaction_safe))
> +void *wmemcpy(void *dest, const void *src, size_t n)
> +{
> +    return memcpy(dest, src, n);
> +}
> Index: gtm-builtins.def
> ===================================================================
> --- gtm-builtins.def	(revision 159008)
> +++ gtm-builtins.def	(working copy)
> @@ -11,9 +11,9 @@ DEF_TM_BUILTIN (BUILT_IN_TM_IRREVOCABLE,
>  		BT_FN_INT, ATTR_TM_NOTHROW_LIST)
>  
>  DEF_TM_BUILTIN (BUILT_IN_TM_MEMCPY, "_ITM_memcpyRtWt",
> -		BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_TM_NOTHROW_LIST)
> +		BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_TM_PURE_NOTHROW_LIST)
>  DEF_TM_BUILTIN (BUILT_IN_TM_MEMMOVE, "_ITM_memmoveRtWt",
> -		BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_TM_NOTHROW_LIST)
> +		BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_TM_PURE_NOTHROW_LIST)
>  
>  DEF_TM_BUILTIN (BUILT_IN_TM_GETTMCLONE_IRR, "_ITM_getTMCloneOrIrrevocable",
>  		BT_FN_PTR_PTR, ATTR_TM_CONST_NOTHROW_LIST)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]