Commit ddefad9a by Senthil Kumar Selvaraj Committed by Senthil Kumar Selvaraj

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

	* gcc.dg/tree-ssa/pr59597.c: Typedef  __INT32_TYPE__ to i32.
	(main): Declare j as i32 instead of int.

From-SVN: r240986
parent 656b0311
2016-10-11 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
* 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 <thomas.preudhomme@arm.com> 2016-10-11 Thomas Preud'homme <thomas.preudhomme@arm.com>
PR testsuite/PR77710 PR testsuite/PR77710
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
typedef unsigned short u16; typedef unsigned short u16;
typedef unsigned char u8; typedef unsigned char u8;
typedef unsigned int u32; typedef unsigned int u32;
__extension__ typedef __INT32_TYPE__ i32;
long int random(int); long int random(int);
#define NNN 10 #define NNN 10
...@@ -37,7 +39,7 @@ Calc_crc8 (u8 data, u16 crc) ...@@ -37,7 +39,7 @@ Calc_crc8 (u8 data, u16 crc)
int int
main (int argc, char argv[]) main (int argc, char argv[])
{ {
int i, j; u16 crc; int i; i32 j; u16 crc;
for (j = 0; j < 10000000; j++) for (j = 0; j < 10000000; j++)
{ {
for (i = 0; i < NNN; i++) for (i = 0; i < NNN; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment