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  <senthil_kumar.selvaraj@atmel.com>

	* gcc.dg/pr64277.c: Use __INT32_TYPE__ for targets
	with sizeof(int) < 4.

From-SVN: r242859
This commit is contained in:
Senthil Kumar Selvaraj 2016-11-25 08:15:42 +00:00 committed by Senthil Kumar Selvaraj
parent 2131e489c9
commit 4ae35e6988
2 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2016-11-25 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
* gcc.dg/pr64277.c: Use __INT32_TYPE__ for targets
with sizeof(int) < 4.
2016-11-24 Martin Sebor <msebor@redhat.com>
PR tree-optimization/78476

View File

@ -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--)