summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/config/i386/i386.h2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr69225-1.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/pr69225-2.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/pr69225-3.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/pr69225-4.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/pr69225-5.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/pr69225-6.c8
7 files changed, 49 insertions, 1 deletions
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index bdb1ba3c0dd..982a3b3b25c 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -687,7 +687,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
the rounding precision is indeterminate, since either may be chosen
apparently at random. */
#define TARGET_FLT_EVAL_METHOD \
- (TARGET_MIX_SSE_I387 ? -1 : TARGET_SSE_MATH ? 0 : 2)
+ (TARGET_MIX_SSE_I387 ? -1 : (TARGET_80387 && !TARGET_SSE_MATH) ? 2 : 0)
/* Whether to allow x87 floating-point arithmetic on MODE (one of
SFmode, DFmode and XFmode) in the current excess precision
diff --git a/gcc/testsuite/gcc.target/i386/pr69225-1.c b/gcc/testsuite/gcc.target/i386/pr69225-1.c
new file mode 100644
index 00000000000..cc5b782326c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr69225-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile} */
+/* { dg-options "-msse2 -mfpmath=sse" } */
+
+#include <float.h>
+
+#if FLT_EVAL_METHOD != 0
+# error FLT_EVAL_METHOD != 0
+#endif
diff --git a/gcc/testsuite/gcc.target/i386/pr69225-2.c b/gcc/testsuite/gcc.target/i386/pr69225-2.c
new file mode 100644
index 00000000000..cd0a6260cf6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr69225-2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile} */
+/* { dg-options "-mno-sse -mno-80387" } */
+
+#include <float.h>
+
+#if FLT_EVAL_METHOD != 0
+# error FLT_EVAL_METHOD != 0
+#endif
diff --git a/gcc/testsuite/gcc.target/i386/pr69225-3.c b/gcc/testsuite/gcc.target/i386/pr69225-3.c
new file mode 100644
index 00000000000..1440b7463d9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr69225-3.c
@@ -0,0 +1,8 @@
+/* { dg-do compile} */
+/* { dg-options "-m80387 -mfpmath=387" } */
+
+#include <float.h>
+
+#if FLT_EVAL_METHOD != 2
+# error FLT_EVAL_METHOD != 2
+#endif
diff --git a/gcc/testsuite/gcc.target/i386/pr69225-4.c b/gcc/testsuite/gcc.target/i386/pr69225-4.c
new file mode 100644
index 00000000000..b032a5f2bdf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr69225-4.c
@@ -0,0 +1,8 @@
+/* { dg-do compile} */
+/* { dg-options "-msse2 -mfancy-math-387 -mfpmath=sse" } */
+
+#include <float.h>
+
+#if FLT_EVAL_METHOD != 0
+# error FLT_EVAL_METHOD != 0
+#endif
diff --git a/gcc/testsuite/gcc.target/i386/pr69225-5.c b/gcc/testsuite/gcc.target/i386/pr69225-5.c
new file mode 100644
index 00000000000..4162f7790f1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr69225-5.c
@@ -0,0 +1,8 @@
+/* { dg-do compile} */
+/* { dg-options "-msse2 -m80387 -mfpmath=sse,387" } */
+
+#include <float.h>
+
+#if FLT_EVAL_METHOD != -1
+# error FLT_EVAL_METHOD != -1
+#endif
diff --git a/gcc/testsuite/gcc.target/i386/pr69225-6.c b/gcc/testsuite/gcc.target/i386/pr69225-6.c
new file mode 100644
index 00000000000..cd5f41946d6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr69225-6.c
@@ -0,0 +1,8 @@
+/* { dg-do compile} */
+/* { dg-options "-mno-80387" } */
+
+#include <float.h>
+
+#if FLT_EVAL_METHOD != 0
+# error FLT_EVAL_METHOD != 0
+#endif