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]

[PATCH] fix gcc.c-torture/execute/990127-2.c for non-i386 ports


Hi,

This tests has been recently fixed for the i386 port, but m68k has
exactly the same problem but it has no -mpc64 option.
In other cases this has been by using volatile or by using -ffloat-store
(e.g. in gcc.c-torture/execute/ieee), which are more portable.

bye, Roman

200x-xx-xx  Roman Zippel <zippel@linux-m68k.org>

gcc/testsuite/
        * gcc.c-torture/execute/990127-2.c (fpTest): Use volatile to force
	requested precision.
	* gcc.c-torture/execute/990127-2.x: Remove.


---
 gcc/testsuite/gcc.c-torture/execute/990127-2.c |    2 +-
 gcc/testsuite/gcc.c-torture/execute/990127-2.x |   15 ---------------
 2 files changed, 1 insertion(+), 16 deletions(-)

Index: gcc/gcc/testsuite/gcc.c-torture/execute/990127-2.c
===================================================================
--- gcc.orig/gcc/testsuite/gcc.c-torture/execute/990127-2.c
+++ gcc/gcc/testsuite/gcc.c-torture/execute/990127-2.c
@@ -9,7 +9,7 @@ void
 fpTest (double x, double y)
 {
   double result1 = (35.7 * 100.0) / 45.0;
-  double result2 = (x * 100.0) / y;
+  volatile double result2 = (x * 100.0) / y;
   fpEq (result1, result2);
 }
 
Index: gcc/gcc/testsuite/gcc.c-torture/execute/990127-2.x
===================================================================
--- gcc.orig/gcc/testsuite/gcc.c-torture/execute/990127-2.x
+++ /dev/null
@@ -1,15 +0,0 @@
-# On x86 targets, two floating-point double values can't be reliably compared
-# for inequality due to excess precision of 80387 floating-point coprocessor.
-# Use -mpc64 to force 80387 floating-point precision to 64 bits.  This option
-# has no effect on SSE, but it is needed in case of -m32 on x86_64 targets.
-
-if { [istarget i?86-*-linux*]
-     || [istarget i?86-*-kfreebsd*-gnu]
-     || [istarget i?86-*-knetbsd*-gnu]
-     || [istarget x86_64-*-linux*]
-     || [istarget x86_64-*-kfreebsd*-gnu]
-     || [istarget x86_64-*-knetbsd*-gnu] } {
-	set additional_flags "-mpc64"
-}
-
-return 0


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