This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi 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]

Set -ffp-contract=off for libffi.call/many.c


Hi,

The review of this patch ran out of stream:

https://sourceware.org/ml/libffi-discuss/2013/msg00128.html

The proposed solution would not work when testing with a none GCC compiler. Constraining the dg-option was tricky because the mechanism available allows matching against the target triple not the compiler and in this particular scenario the issue was the compiler, not the target.

The purpose of the test is to ensure that the arguments are correctly passed via two alternative mechanisms. The actual sequence of operations used to combine all the arguments into a return value is largely irrelevant.

Therefore the other route here is to adjust the computation used to remove the opportunity for the compiler to choose a fused multiply.

Proposed patch attached.

OK?

2013-10-11  Marcus Shawcroft  <marcus.shawcroft@arm.com>

        * testsuite/libffi.call/many.c (many): Replace * with +.

Thanks
/Marcus
diff --git a/testsuite/libffi.call/many.c b/testsuite/libffi.call/many.c
index 67a367f..11818e6 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)

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