public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, testsuite, committed] Fix cunroll-13.c failure for avr
@ 2017-05-09 10:09 Senthil Kumar Selvaraj
  0 siblings, 0 replies; only message in thread
From: Senthil Kumar Selvaraj @ 2017-05-09 10:09 UTC (permalink / raw)
  To: gcc-patches

Hi,

  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.

  Committed to trunk as obvious.

Regards
Senthil

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.


diff --git gcc/testsuite/gcc.dg/tree-ssa/cunroll-13.c gcc/testsuite/gcc.dg/tree-ssa/cunroll-13.c
index f3fe8b51468..904e6dc075b 100644
--- gcc/testsuite/gcc.dg/tree-ssa/cunroll-13.c
+++ gcc/testsuite/gcc.dg/tree-ssa/cunroll-13.c
@@ -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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-09 10:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-09 10:09 [Patch, testsuite, committed] Fix cunroll-13.c failure for avr Senthil Kumar Selvaraj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).