From c00a49ecd165b2d06c1c9b249d212dc843fa116f Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 15 Mar 2014 22:08:19 -0700 Subject: [PATCH 1/3] testsuite/libffi.call/many.c: Avoid spurious failure due to excess precision The test case testsuite/libffi.call/many.c can spuriously fail due to excess floating-point precision. Instrumenting it with some printf calls shows differences well above FLT_EPSILON. (Note when instrumenting it that multiple computations of the difference, such as one in a print and another in the conditional, may produce different results.) Rather than complicating the test suite with architecture-specific flags to avoid excess precision, just simplify the floating-point computation to avoid a dependency on potential excess precision. --- testsuite/libffi.call/many.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/libffi.call/many.c b/testsuite/libffi.call/many.c index 11818e6f..5447664f 100644 --- a/testsuite/libffi.call/many.c +++ b/testsuite/libffi.call/many.c @@ -32,7 +32,7 @@ static float many(float f1, (double) f11, (double) f12, (double) f13); #endif - return f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12+f13; + return f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13; } int main (void) From 88d562a8b5912e99306063fe3bc289bab6ca6ebe Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 15 Mar 2014 22:08:19 -0700 Subject: [PATCH 2/3] testsuite/libffi.call/many_win32.c: Avoid spurious failure due to excess precision The test case testsuite/libffi.call/many_win32.c can spuriously fail due to excess floating-point precision. Instrumenting it with some printf calls shows differences well above FLT_EPSILON. (Note when instrumenting it that multiple computations of the difference, such as one in a print and another in the conditional, may produce different results.) Rather than complicating the test suite with architecture-specific flags to avoid excess precision, just simplify the floating-point computation to avoid a dependency on potential excess precision. --- testsuite/libffi.call/many_win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/libffi.call/many_win32.c b/testsuite/libffi.call/many_win32.c index 1b263322..d9038f44 100644 --- a/testsuite/libffi.call/many_win32.c +++ b/testsuite/libffi.call/many_win32.c @@ -23,7 +23,7 @@ static float __attribute__((stdcall)) stdcall_many(float f1, float f12, float f13) { - return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13); + return f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13; } int main (void) From 82f8cb24a1d976db35ae31a4b86cec8926da327d Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sun, 16 Mar 2014 04:27:32 -0700 Subject: [PATCH 3/3] ChangeLog: Document many.c and many_win32.c changes to avoid spurious failures --- ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index d3cfa9db..2cd55b60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-03-16 Josh Triplett + + * testsuite/libffi.call/many.c: Avoid spurious failure due to excess + floating-point precision. + * testsuite/libffi.call/many_win32.c: Ditto. + 2014-03-16 Josh Triplett * libtool-ldflags: Re-add.