From patchwork Wed Sep 14 11:48:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PR50322] Fix test-case ivopts-lt.c to use int of same size as pointer. Date: Wed, 14 Sep 2011 01:48:16 -0000 From: Tom de Vries X-Patchwork-Id: 114666 Message-Id: <4E709480.8050601@mentor.com> To: Zdenek Dvorak , Mike Stump Cc: Georg-Johann Lay , "gcc-patches@gcc.gnu.org" 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 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