This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR50322] Fix test-case ivopts-lt.c to use int of same size as pointer.
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Tom de Vries <Tom_deVries at mentor dot com>
- Cc: Mike Stump <mrs at gcc dot gnu dot org>, Georg-Johann Lay <avr at gjlay dot de>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 14 Sep 2011 18:35:26 +0200
- Subject: Re: [PATCH, PR50322] Fix test-case ivopts-lt.c to use int of same size as pointer.
- References: <4E709480.8050601@mentor.com>
Hi,
> The attached patch fixes PR50322.
>
> The test-case is supposed to succeed if the loop counter data-type has the same
> size as a pointer. The patch defines TYPE to be an int datatype of the same size
> as a pointer, and uses it. After this fix, there's no need for the avr xfails
> anymore.
>
> tested with avr, x86_64 and x86_64 -m32.
what about using uintptr_t?
Zdenek
> Index: gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c (revision 178804)
> +++ gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c (working copy)
> @@ -1,8 +1,18 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fdump-tree-ivopts" } */
>
> +#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__)
> +#define TYPE unsigned long long int
> +#elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__)
> +#define TYPE unsigned long int
> +#elif (__SIZEOF_INT__ == __SIZEOF_POINTER__)
> +#define TYPE unsigned int
> +#else
> +#error Add target support here
> +#endif
> +
> void
> -f1 (char *p, unsigned long int i, unsigned long int n)
> +f1 (char *p, TYPE i, TYPE n)
> {
> p += i;
> do
> @@ -14,8 +24,7 @@ f1 (char *p, unsigned long int i, unsign
> while (i < n);
> }
>
> -/* For the fails on avr see PR tree-optimization/50322. */
> -/* { dg-final { scan-tree-dump-times "PHI" 1 "ivopts" { xfail { "avr-*-*" } } } } */
> +/* { dg-final { scan-tree-dump-times "PHI" 1 "ivopts" } } */
> /* { dg-final { scan-tree-dump-times "PHI <p_" 1 "ivopts"} } */
> -/* { dg-final { scan-tree-dump-times "p_\[0-9\]* <" 1 "ivopts" { xfail { "avr-*-*" } } } } */
> +/* { dg-final { scan-tree-dump-times "p_\[0-9\]* <" 1 "ivopts" } } */
> /* { dg-final { cleanup-tree-dump "ivopts" } } */