From: Senthil Kumar Selvaraj Date: Fri, 25 Nov 2016 08:15:42 +0000 (+0000) Subject: Fix bogus pr64277.c failure for avr X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4ae35e698893dcf2b11ab6fa7b39a9f5e0973cd8;p=gcc.git Fix bogus pr64277.c failure for avr The smaller int size for the avr target breaks the test's expectation on the number of iterations. The failure goes away if 32 bit ints are used in place of a plain int. Fix by conditionally typedef int32_t to __INT32_TYPE__ for targets with int size < 4, and then use int32_t everywhere. gcc/testsuite 016-11-25 Senthil Kumar Selvaraj * gcc.dg/pr64277.c: Use __INT32_TYPE__ for targets with sizeof(int) < 4. From-SVN: r242859 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5e81768b4d0..1028191731f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-11-25 Senthil Kumar Selvaraj + + * gcc.dg/pr64277.c: Use __INT32_TYPE__ for targets + with sizeof(int) < 4. + 2016-11-24 Martin Sebor PR tree-optimization/78476 diff --git a/gcc/testsuite/gcc.dg/pr64277.c b/gcc/testsuite/gcc.dg/pr64277.c index 62f6f1cc859..813301f2d04 100644 --- a/gcc/testsuite/gcc.dg/pr64277.c +++ b/gcc/testsuite/gcc.dg/pr64277.c @@ -4,17 +4,23 @@ /* { dg-final { scan-tree-dump "loop with 5 iterations completely unrolled" "cunroll" } } */ /* { dg-final { scan-tree-dump "loop with 6 iterations completely unrolled" "cunroll" } } */ -int f1[10]; +#if __SIZEOF_INT__ < 4 + __extension__ typedef __INT32_TYPE__ int32_t; +#else + typedef int int32_t; +#endif + +int32_t f1[10]; void test1 (short a[], short m, unsigned short l) { - int i = l; + int32_t i = l; for (i = i + 5; i < m; i++) f1[i] = a[i]++; } void test2 (short a[], short m, short l) { - int i; + int32_t i; if (m > 5) m = 5; for (i = m; i > l; i--)