This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [trans-mem] set _ITM_memcpyRtWt and _ITM_memmoveRtWt as pure
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Patrick Marlier <patrick dot marlier at unine dot ch>
- Cc: Richard Henderson <rth at redhat dot com>, FELBER Pascal <pascal dot felber at unine dot ch>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 19 May 2010 17:42:34 -0400
- Subject: Re: [trans-mem] set _ITM_memcpyRtWt and _ITM_memmoveRtWt as pure
- References: <4BF3E317.1060704@unine.ch> <20100519214141.GA27047@redhat.com>
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)