This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH MIPS RFA] Regression cleanup for nan2008 toolchain
- From: Robert Suchanek <Robert dot Suchanek at imgtec dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Matthew Fortune <Matthew dot Fortune at imgtec dot com>, "Catherine_Moore at mentor dot com" <Catherine_Moore at mentor dot com>
- Date: Mon, 26 Jan 2015 11:48:28 +0000
- Subject: [PATCH MIPS RFA] Regression cleanup for nan2008 toolchain
- Authentication-results: sourceware.org; auth=none
Hi,
Here is a patch to clean up a large number of reported failures when a toolchain
is configured with --with-nan=2008 for mips*-linux-gnu triplet and clean up a failures
for mips-img-linux-gnu where nan2008 is set by the default.
In the former case, regression involves testing e.g. -mips4 with default options which
causes emission of warnings that the -mips4 architecture does not support nan2008, and
hence, the test is classified as a fail ("test for excess errors" type of error).
The patch implies -mnan=legacy switch for all tests that are run for ISA rev < 2.
In the latter case, even if we decrease the ISA level for incompatible options for
the loongson vector extension tests, especially loongson-simd.c, a test that includes
stdint.h or stdlib.h will end up including the glibc header 'stubs-<abi>.h>' and will
fail as the mipsr6 toolchain will only have stubs-o32_hard_2008.h. A toolchain supporting
nan1985 will have the required stubs-o32_hard.h. The only neat solution AFAICS was to add
a new effective target that tries to compile and include stdlib.h to check if we have
the proper support for the legacy NaN marking the concerned tests as UNSUPPORTED.
Regards,
Robert
2015-01-26 Robert Suchanek <robert.suchanek@imgtec.com>
gcc/testsuite
* lib/target-supports.exp (check_effective_target_mips_nanlegacy): New.
* gcc.target/mips/loongson-simd.c: Require legacy NaN support.
* gcc.target/mips/mips.exp (mips-dg-options): Imply -mnan=legacy for
ISA rev < 2.
---
gcc/testsuite/gcc.target/mips/loongson-simd.c | 1 +
gcc/testsuite/gcc.target/mips/mips.exp | 1 +
gcc/testsuite/lib/target-supports.exp | 9 +++++++++
3 files changed, 11 insertions(+)
diff --git a/gcc/testsuite/gcc.target/mips/loongson-simd.c b/gcc/testsuite/gcc.target/mips/loongson-simd.c
index 160da6b..949632e 100644
--- a/gcc/testsuite/gcc.target/mips/loongson-simd.c
+++ b/gcc/testsuite/gcc.target/mips/loongson-simd.c
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
/* loongson.h does not handle or check for MIPS16ness or
microMIPSness. There doesn't seem any good reason for it to, given
that the Loongson processors do not support either. */
+/* { dg-require-effective-target mips_nanlegacy } */
/* { dg-options "isa=loongson -mhard-float -mno-micromips -mno-mips16 -flax-vector-conversions" } */
#include "loongson.h"
diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp
index b81d344..a0980a9 100644
--- a/gcc/testsuite/gcc.target/mips/mips.exp
+++ b/gcc/testsuite/gcc.target/mips/mips.exp
@@ -1300,6 +1300,7 @@ proc mips-dg-options { args } {
mips_make_test_option options "-mno-dsp"
mips_make_test_option options "-mno-synci"
mips_make_test_option options "-mno-micromips"
+ mips_make_test_option options "-mnan=legacy"
}
if { $isa_rev > 5 } {
mips_make_test_option options "-mno-dsp"
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index e51d07d..de2f599 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -3036,6 +3036,15 @@ proc check_effective_target_mips_loongson { } {
}]
}
+# Return 1 if this is a MIPS target that supports the legacy NAN.
+
+proc check_effective_target_mips_nanlegacy { } {
+ return [check_no_compiler_messages nanlegacy assembly {
+ #include <stdlib.h>
+ int main () { return 0; }
+ } "-mnan=legacy"]
+}
+
# Return 1 if this is an ARM target that adheres to the ABI for the ARM
# Architecture.
--
1.7.9.5