On Sat, Jun 04, 2011 at 09:40:38AM -0300, Alexandre Oliva wrote:

The following changes all look wrong to me, they make the tests totally
useless.  If both f and g are used in real code after the asm volatile, then
the both f and g will likely live in some register or memory.
The whole point of the construct in the tests is that f has at that spot
a reg or mem location, but g isn't present anywhere anymore (as the compiler
doesn't or shouldn't know that asm volatile hasn't changed f), thus it
should represent them as bswap/clz/ctz/rotate.

> --- gcc/testsuite/gcc.dg/guality/bswaptest.c.orig     2011-06-04 
> 09:35:38.954014890 -0300
> +++ gcc/testsuite/gcc.dg/guality/bswaptest.c  2011-06-04 09:35:51.345054255 
> -0300
> @@ -10,7 +10,7 @@ foo (long x)
>    long g = f;
>    asm volatile ("" : "+r" (f));
>    vv++;              /* { dg-final { gdb-test 12 "g" "f" } } */
> -  return f;
> +  return f - g;
>  }
>  
>  __attribute__((noclone, noinline)) int
> @@ -20,7 +20,7 @@ bar (int x)
>    int g = f;
>    asm volatile ("" : "+r" (f));
>    vv++;              /* { dg-final { gdb-test 22 "g" "f" } } */
> -  return f;
> +  return f - g;
>  }
>  
>  int
> Index: gcc/testsuite/gcc.dg/guality/clztest.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/guality/clztest.c.orig       2011-06-04 
> 09:35:39.202015678 -0300
> +++ gcc/testsuite/gcc.dg/guality/clztest.c    2011-06-04 09:36:17.710136856 
> -0300
> @@ -10,7 +10,7 @@ foo (long x)
>    long g = f;
>    asm volatile ("" : "+r" (f));
>    vv++;              /* { dg-final { gdb-test 12 "g" "f" } } */
> -  return f;
> +  return f - g;
>  }
>  
>  __attribute__((noinline, noclone)) long
> @@ -20,7 +20,7 @@ bar (long x)
>    long g = f;
>    asm volatile ("" : "+r" (f));
>    vv++;              /* { dg-final { gdb-test 22 "g" "f" } } */
> -  return f;
> +  return f - g;
>  }
>  
>  int
> Index: gcc/testsuite/gcc.dg/guality/ctztest.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/guality/ctztest.c.orig       2011-06-04 
> 09:35:39.463016509 -0300
> +++ gcc/testsuite/gcc.dg/guality/ctztest.c    2011-06-04 09:36:33.143184587 
> -0300
> @@ -10,7 +10,7 @@ foo (long x)
>    long g = f;
>    asm volatile ("" : "+r" (f));
>    vv++;              /* { dg-final { gdb-test 12 "g" "f" } } */
> -  return f;
> +  return f - g;
>  }
>  
>  __attribute__((noinline, noclone)) long
> @@ -20,7 +20,7 @@ bar (long x)
>    long g = f;
>    asm volatile ("" : "+r" (f));
>    vv++;              /* { dg-final { gdb-test 22 "g" "f" } } */
> -  return f;
> +  return f - g;
>  }
>  
>  int
> Index: gcc/testsuite/gcc.dg/guality/rotatetest.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/guality/rotatetest.c.orig    2011-06-04 
> 09:32:07.155300180 -0300
> +++ gcc/testsuite/gcc.dg/guality/rotatetest.c 2011-06-04 09:34:46.757846376 
> -0300
> @@ -10,7 +10,7 @@ f1 (unsigned long x)
>    long g = f;
>    asm volatile ("" : "+r" (f));
>    vv++;              /* { dg-final { gdb-test 12 "g" "f" } } */
> -  return f;
> +  return f - g;
>  }
>  
>  __attribute__((noclone, noinline)) long
> @@ -20,7 +20,7 @@ f2 (unsigned long x, int y)
>    long g = f;
>    asm volatile ("" : "+r" (f));
>    vv++;              /* { dg-final { gdb-test 22 "g" "f" } } */
> -  return f;
> +  return f - g;
>  }
>  
>  __attribute__((noclone, noinline)) long
> @@ -30,7 +30,7 @@ f3 (unsigned long x, int y)
>    long g = f;
>    asm volatile ("" : "+r" (f));
>    vv++;              /* { dg-final { gdb-test 32 "g" "f" } } */
> -  return f;
> +  return f - g;
>  }
>  
>  __attribute__((noclone, noinline)) unsigned int
> @@ -40,7 +40,7 @@ f4 (unsigned int x)
>    unsigned int g = f;
>    asm volatile ("" : "+r" (f));
>    vv++;              /* { dg-final { gdb-test 42 "g" "f" } } */
> -  return f;
> +  return f - g;
>  }
>  
>  __attribute__((noclone, noinline)) unsigned int
> @@ -50,7 +50,7 @@ f5 (unsigned int x, int y)
>    unsigned int g = f;
>    asm volatile ("" : "+r" (f));
>    vv++;              /* { dg-final { gdb-test 52 "g" "f" } } */
> -  return f;
> +  return f - g;
>  }
>  
>  __attribute__((noclone, noinline)) unsigned int
> @@ -60,7 +60,7 @@ f6 (unsigned int x, int y)
>    unsigned int g = f;
>    asm volatile ("" : "+r" (f));
>    vv++;              /* { dg-final { gdb-test 62 "g" "f" } } */
> -  return f;
> +  return f - g;
>  }
>  
>  int

        Jakub

Reply via email to