diff options
author | Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> | 2016-11-25 08:15:42 +0000 |
---|---|---|
committer | Senthil Kumar Selvaraj <saaadhu@gcc.gnu.org> | 2016-11-25 08:15:42 +0000 |
commit | 4ae35e698893dcf2b11ab6fa7b39a9f5e0973cd8 (patch) | |
tree | b6c0e028218f8b10fe10b8a57fb487796b0ef6eb | |
parent | 2131e489c9f181e3d445e8e5412407ad32a8875c (diff) | |
download | gcc-4ae35e698893dcf2b11ab6fa7b39a9f5e0973cd8.zip gcc-4ae35e698893dcf2b11ab6fa7b39a9f5e0973cd8.tar.gz gcc-4ae35e698893dcf2b11ab6fa7b39a9f5e0973cd8.tar.bz2 |
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
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr64277.c | 12 |
2 files changed, 14 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5e81768..1028191 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/gcc.dg/pr64277.c b/gcc/testsuite/gcc.dg/pr64277.c index 62f6f1c..813301f 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--) |