Fix broken cunroll-13.c for avr target
authorSenthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
Tue, 9 May 2017 09:59:25 +0000 (09:59 +0000)
committerSenthil Kumar Selvaraj <saaadhu@gcc.gnu.org>
Tue, 9 May 2017 09:59:25 +0000 (09:59 +0000)
The test reports bogus failures because the loop variable i is declared
as int, and the constant expected in the dump doesn't fit in an int for avr.
Fixed by explicitly using __INT32_TYPE__ for targets with __SIZEOF_INT__ < 4.

gcc/testsuite/

2017-05-09  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

* gcc.dg/tree-ssa/cunroll-13.c: Use __INT32_TYPE__ for
for targets with __SIZEOF_INT__ < 4.

From-SVN: r247782

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/cunroll-13.c

index 0207d9fa668d90fc6a3ece280fb1940f52118299..af1e6deb648a349b867bf50d9e4efacff38ca73a 100644 (file)
@@ -1,3 +1,8 @@
+2017-05-09  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
+
+       * gcc.dg/tree-ssa/cunroll-13.c: Use __INT32_TYPE__ for
+       for targets with __SIZEOF_INT__ < 4.
+
 2017-05-09  Richard Biener  <rguenther@suse.de>
 
        * gcc.dg/vect/vect-50.c: Revert last change.
index f3fe8b514687ec954633025eb734c0f29d5e4e1b..904e6dc075baf4888a3c245ee3c33972e2ccb6a6 100644 (file)
@@ -1,10 +1,17 @@
 /* { dg-do compile } */
 /* { dg-options "-O3 -fdisable-tree-evrp -fdisable-tree-cunrolli -fdisable-tree-vrp1 -fdump-tree-cunroll-blocks-details" } */
+
+#if __SIZEOF_INT__ < 4
+__extension__ typedef __INT32_TYPE__ i32;
+#else
+typedef int i32;
+#endif
+
 struct a {int a[8];int b;};
 void
 t(struct a *a)
 {
-  for (int i=0;i<123456 && a->a[i];i++)
+  for (i32 i=0;i<123456 && a->a[i];i++)
     a->a[i]++;
 }
 /* This pass relies on the fact that we do not eliminate the redundant test for i early.