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]

Re: [patch] Fix excess-precision failures on darwin by passing -mfpmath=387


So, please add -mfpmath=387 and remove dg-require-effective-target
from all gcc.target/i386/excess-precision-X.c tests. The patch is
pre-approved if it works OK on 32 and 64bit targets.

The patch below, committed as rev. 148395, was tested on i386-darwin with both -m32 and -m64.


FX




Index: gcc.target/i386/excess-precision-1.c =================================================================== --- gcc.target/i386/excess-precision-1.c (revision 148352) +++ gcc.target/i386/excess-precision-1.c (working copy) @@ -1,8 +1,7 @@ /* Excess precision tests. Test that excess precision is carried through various operations. */ /* { dg-do run } */ -/* { dg-require-effective-target ilp32 } */ -/* { dg-options "-O2 -fexcess-precision=standard" } */ +/* { dg-options "-O2 -mfpmath=387 -fexcess-precision=standard" } */

#include <float.h>

Index: gcc.target/i386/excess-precision-3.c
===================================================================
--- gcc.target/i386/excess-precision-3.c	(revision 148352)
+++ gcc.target/i386/excess-precision-3.c	(working copy)
@@ -1,8 +1,7 @@
 /* Excess precision tests.  Test excess precision is removed when
    necessary.  */
 /* { dg-do run } */
-/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-O2 -fexcess-precision=standard" } */
+/* { dg-options "-O2 -mfpmath=387 -fexcess-precision=standard" } */

 #include <float.h>
 #include <stdarg.h>
Index: gcc.target/i386/excess-precision-5.c
===================================================================
--- gcc.target/i386/excess-precision-5.c	(revision 148352)
+++ gcc.target/i386/excess-precision-5.c	(working copy)
@@ -1,8 +1,7 @@
 /* Excess precision tests.  Verify excess precision doesn't affect
    actual types.  */
 /* { dg-do compile } */
-/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-fexcess-precision=standard" } */
+/* { dg-options "-mfpmath=387 -fexcess-precision=standard" } */

 float f;
 double d;
Index: gcc.target/i386/excess-precision-2.c
===================================================================
--- gcc.target/i386/excess-precision-2.c	(revision 148352)
+++ gcc.target/i386/excess-precision-2.c	(working copy)
@@ -1,7 +1,6 @@
 /* Excess precision tests.  Test excess precision of constants.  */
 /* { dg-do run } */
-/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-O2 -fexcess-precision=standard" } */
+/* { dg-options "-O2 -mfpmath=387 -fexcess-precision=standard" } */

#include <float.h>

Index: gcc.target/i386/excess-precision-4.c
===================================================================
--- gcc.target/i386/excess-precision-4.c	(revision 148352)
+++ gcc.target/i386/excess-precision-4.c	(working copy)
@@ -1,8 +1,7 @@
 /* Excess precision tests.  Test diagnostics for excess precision of
    constants.  */
 /* { dg-do compile } */
-/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-fexcess-precision=standard" } */
+/* { dg-options "-mfpmath=387 -fexcess-precision=standard" } */

float f = 0.0f * 1e50f; /* { dg-warning "floating constant exceeds range of 'float'" } */
double d = 0.0 * 1e400; /* { dg-warning "floating constant exceeds range of 'double'" } */
Index: gcc.target/i386/excess-precision-6.c
===================================================================
--- gcc.target/i386/excess-precision-6.c (revision 148352)
+++ gcc.target/i386/excess-precision-6.c (working copy)
@@ -1,8 +1,7 @@
/* Excess precision tests. Make sure sqrt is not inlined for float or
double. */
/* { dg-do compile } */
-/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-O2 -fno-math-errno -fexcess-precision=standard" } */
+/* { dg-options "-mfpmath=387 -O2 -fno-math-errno -fexcess- precision=standard" } */


 float f;
 double d;
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 148394)
+++ ChangeLog	(working copy)
@@ -1,5 +1,16 @@
 2009-06-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

+	PR testsuite/39831
+	* gcc.target/i386/excess-precision-1.c: Use -mfpmath=387, and
+	remove ilp32 requirement.
+	* gcc.target/i386/excess-precision-2.c: Likewise.
+	* gcc.target/i386/excess-precision-3.c: Likewise.
+	* gcc.target/i386/excess-precision-4.c: Likewise.
+	* gcc.target/i386/excess-precision-5.c: Likewise.
+	* gcc.target/i386/excess-precision-6.c: Likewise.
+
+2009-06-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
 	PR fortran/38718
 	* gfortran.dg/is_iostat_end_eor_2.f90: New test.
 	* gfortran.dg/nan_5.f90: New test.


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