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: [PATCH, x86] Use vector moves in memmove expanding


On Mon, Sep 09, 2013 at 11:42:05AM +0400, Michael V. Zolotukhin wrote:
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/i386/memcpy-2.c
> @@ -0,0 +1,22 @@
> +/* { dg-do run } */
> +/* { dg-require-effective-target ia32 } */
> +/* { dg-options "-O2 -march=pentiumpro -minline-all-stringops -fno-common" } */

I don't see anything i386 specific on the testcase, except the flags,
and don't see why you need -fno-common in there, there are no global vars.
So, I think it would be better to stick it into gcc.dg/torture/, drop
dg-require-* line and instead just add
/* { dg-additional-options "-march=pentiumpro" { target ia32 } } */
/* { dg-additional-options "-minline-all-stringops" { target { i?86-*-* x86_64-*-* } } } */
or so (and let it cycle through all the -O* options).

> +
> +static void __attribute__((noinline, noclone))
> +my_memcpy (char *dest, const char *src, int n)
> +{
> +  __builtin_memcpy (dest, src, n);
> +}
> +
> +int
> +main (void)
> +{
> +  char a1[4], a2[4];
> +  __builtin_memset (a1, 'a', 4);
> +  __builtin_memset (a2, 'b', 4);
> +  my_memcpy (a2, a1, 4);
> +  if (a2[0] != 'a')
> +    __builtin_abort ();
> +  return 0;
> +}
> +


	Jakub


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