From: Senthil Kumar Selvaraj Date: Tue, 11 Oct 2016 10:35:57 +0000 (+0000) Subject: Fix gcc.dg/tree-ssa/pr59597.c failure for avr X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ddefad9a0845cdd0d648f3c234b1abfaa239612b;p=gcc.git Fix gcc.dg/tree-ssa/pr59597.c failure for avr Declare loop index variable j as a 32 bit int instead of assuming ints are 32 bits. The smaller int size on the avr makes prior passes optimize away the loop exit check (j < 10000000), as the constant is outside the range of a 16 bit int. gcc/testsuite/ChangeLog 2016-10-11 Senthil Kumar Selvaraj * gcc.dg/tree-ssa/pr59597.c: Typedef __INT32_TYPE__ to i32. (main): Declare j as i32 instead of int. From-SVN: r240986 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d406923c53d..1b6044c0582 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-10-11 Senthil Kumar Selvaraj + + * gcc.dg/tree-ssa/pr59597.c: Typedef __INT32_TYPE__ to i32. + (main): Declare j as i32 instead of int. + 2016-10-11 Thomas Preud'homme PR testsuite/PR77710 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c b/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c index 4ac12c8c15c..dab16abe522 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c @@ -4,6 +4,8 @@ typedef unsigned short u16; typedef unsigned char u8; typedef unsigned int u32; +__extension__ typedef __INT32_TYPE__ i32; + long int random(int); #define NNN 10 @@ -37,7 +39,7 @@ Calc_crc8 (u8 data, u16 crc) int main (int argc, char argv[]) { - int i, j; u16 crc; + int i; i32 j; u16 crc; for (j = 0; j < 10000000; j++) { for (i = 0; i < NNN; i++)