Mike, Zdenek, 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. OK for trunk? Thanks, - Tom 2011-09-14 Tom de Vries <t...@codesourcery.com> PR testsuite/50322 * gcc.dg/tree-ssa/ivopts-lt.c: Define TYPE. Use TYPE in f1. Undo avr xfails.
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" } } */