This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fit testcases to soft-fp targets


Hello,

A couple of new in GCC 4.3 tests use uninitialized memory as source for FP values. On soft-fp targets this causes the tests to fail because of handling of NaNs.

Specifically, the tests use uninitialized fp values to initialize int values; the attached patch reverses that and makes the tests use uninitialized integers to initialize fp values.

For reference p[i].a is int and p[i].b is float.

OK for trunk and 4.3 branch?


-- Maxim Kuvyrkov
2008-08-26  Maxim Kuvyrkov  <maxim@codesourcery.com>

	* gcc.gd/struct/wo_prof_global_var.c: Use uninitialized integer
	values instead of uninitialized FP values to avoid NaNs.
	* gcc.dg/struct/wo_prof_local_var.c: Same.
Index: testsuite/gcc.dg/struct/wo_prof_global_var.c
===================================================================
--- testsuite/gcc.dg/struct/wo_prof_global_var.c	(revision 218802)
+++ testsuite/gcc.dg/struct/wo_prof_global_var.c	(working copy)
@@ -19,10 +19,10 @@ main ()
 
   p = malloc (N * sizeof (str_t));
   for (i = 0; i < N; i++)
-    p[i].a = p[i].b + 1;
+    p[i].b = p[i].a + 1;
 
   for (i = 0; i < N; i++)
-    if (p[i].a != p[i].b + 1)
+    if (p[i].b != p[i].a + 1)
       abort ();
 
   return 0;
Index: testsuite/gcc.dg/struct/wo_prof_local_var.c
===================================================================
--- testsuite/gcc.dg/struct/wo_prof_local_var.c	(revision 218802)
+++ testsuite/gcc.dg/struct/wo_prof_local_var.c	(working copy)
@@ -17,10 +17,10 @@ main ()
 
   str_t * p = malloc (N * sizeof (str_t));
   for (i = 0; i < N; i++)
-    p[i].a = p[i].b + 1;
+    p[i].b = p[i].a + 1;
 
   for (i = 0; i < N; i++)
-    if (p[i].a != p[i].b + 1)
+    if (p[i].b != p[i].a + 1)
       abort ();
 
   return 0;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]