public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH MIPS RFA] Regression cleanup for nan2008 toolchain
@ 2015-01-26 13:23 Robert Suchanek
  2015-01-26 17:25 ` Moore, Catherine
  2015-01-31 19:20 ` Richard Sandiford
  0 siblings, 2 replies; 7+ messages in thread
From: Robert Suchanek @ 2015-01-26 13:23 UTC (permalink / raw)
  To: gcc-patches; +Cc: Matthew Fortune, Catherine_Moore

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH MIPS RFA] Regression cleanup for nan2008 toolchain
  2015-01-26 13:23 [PATCH MIPS RFA] Regression cleanup for nan2008 toolchain Robert Suchanek
@ 2015-01-26 17:25 ` Moore, Catherine
  2015-01-28 10:27   ` Robert Suchanek
  2015-01-31 19:20 ` Richard Sandiford
  1 sibling, 1 reply; 7+ messages in thread
From: Moore, Catherine @ 2015-01-26 17:25 UTC (permalink / raw)
  To: Robert Suchanek, gcc-patches; +Cc: Matthew Fortune



> -----Original Message-----
> From: Robert Suchanek [mailto:Robert.Suchanek@imgtec.com]
> Sent: Monday, January 26, 2015 6:48 AM
> To: gcc-patches@gcc.gnu.org
> Cc: Matthew Fortune; Moore, Catherine
> Subject: [PATCH MIPS RFA] Regression cleanup for nan2008 toolchain
> 
> 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.
> ---

This patch is OK.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH MIPS RFA] Regression cleanup for nan2008 toolchain
  2015-01-26 17:25 ` Moore, Catherine
@ 2015-01-28 10:27   ` Robert Suchanek
  0 siblings, 0 replies; 7+ messages in thread
From: Robert Suchanek @ 2015-01-28 10:27 UTC (permalink / raw)
  To: Moore, Catherine, gcc-patches; +Cc: Matthew Fortune

> >
> > 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.
> > ---
> 
> This patch is OK.

Committed as 220199.

Regards,
Robert

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH MIPS RFA] Regression cleanup for nan2008 toolchain
  2015-01-26 13:23 [PATCH MIPS RFA] Regression cleanup for nan2008 toolchain Robert Suchanek
  2015-01-26 17:25 ` Moore, Catherine
@ 2015-01-31 19:20 ` Richard Sandiford
  2015-02-02 16:18   ` Robert Suchanek
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Sandiford @ 2015-01-31 19:20 UTC (permalink / raw)
  To: Robert Suchanek; +Cc: gcc-patches, Matthew Fortune, Catherine_Moore

Robert Suchanek <Robert.Suchanek@imgtec.com> writes:
> 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" } */

Nit, but this splits the dg-options from the comment that explains
the options.

Please could you add a comment explaining that the mips_nanlegacy is there
because of the #include of system headers that might not compile with
-mnan=legacy?  I agree that that's a good reason, but it's not obvious
without a comment.  (And without a comment this could start a precendent
of things being skipped in cases where the mips.exp options machinery
could be updated instead.)

Thanks,
Richard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH MIPS RFA] Regression cleanup for nan2008 toolchain
  2015-01-31 19:20 ` Richard Sandiford
@ 2015-02-02 16:18   ` Robert Suchanek
  2015-02-03 17:42     ` Moore, Catherine
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Suchanek @ 2015-02-02 16:18 UTC (permalink / raw)
  To: Richard Sandiford; +Cc: gcc-patches, Matthew Fortune, Catherine_Moore


> Please could you add a comment explaining that the mips_nanlegacy is there
> because of the #include of system headers that might not compile with
> -mnan=legacy?  I agree that that's a good reason, but it's not obvious
> without a comment.  (And without a comment this could start a precendent
> of things being skipped in cases where the mips.exp options machinery
> could be updated instead.)
> 

True.  Clarification added.

Ok for trunk?

Regards,
Robert

2015-02-02  Robert Suchanek  <robert.suchanek@imgtec.com>                    
                                                                             
       * gcc.target/mips/loongson-simd.c: Update comment to clarify the need
       for mips_nanlegacy target.                                                
                                                                             
diff --git a/gcc/testsuite/gcc.target/mips/loongson-simd.c b/gcc/testsuite/gcc.target/mips/loongson-simd.c
index 949632e..9c3ebce 100644                                                                             
--- a/gcc/testsuite/gcc.target/mips/loongson-simd.c                                                       
+++ b/gcc/testsuite/gcc.target/mips/loongson-simd.c                                                       
@@ -21,7 +21,10 @@ along with GCC; see the file COPYING3.  If not see                                     
 /* { dg-do run } */                                                                                      
 /* 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.  */                                               
+   that the Loongson processors do not support either.  The effective target                             
+   mips_nanlegacy is required for a toolchain without the legacy NaN support                             
+   because inclusion of some system headers e.g. stdint.h will fail due to not                                 
+   finding stubs-o32_hard.h.  */                                                                         
 /* { dg-require-effective-target mips_nanlegacy } */                                                     
 /* { dg-options "isa=loongson -mhard-float -mno-micromips -mno-mips16 -flax-vector-conversions" } */     
                                                                                                          

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH MIPS RFA] Regression cleanup for nan2008 toolchain
  2015-02-02 16:18   ` Robert Suchanek
@ 2015-02-03 17:42     ` Moore, Catherine
  2015-02-04 11:36       ` Robert Suchanek
  0 siblings, 1 reply; 7+ messages in thread
From: Moore, Catherine @ 2015-02-03 17:42 UTC (permalink / raw)
  To: Robert Suchanek, Richard Sandiford; +Cc: gcc-patches, Matthew Fortune



> -----Original Message-----
> From: Robert Suchanek [mailto:Robert.Suchanek@imgtec.com]
> Sent: Monday, February 02, 2015 11:18 AM
> To: Richard Sandiford
> Cc: gcc-patches@gcc.gnu.org; Matthew Fortune; Moore, Catherine
> Subject: RE: [PATCH MIPS RFA] Regression cleanup for nan2008 toolchain
> 
> 
> > Please could you add a comment explaining that the mips_nanlegacy is
> > there because of the #include of system headers that might not compile
> > with -mnan=legacy?  I agree that that's a good reason, but it's not
> > obvious without a comment.  (And without a comment this could start a
> > precendent of things being skipped in cases where the mips.exp options
> > machinery could be updated instead.)
> >
> 
> True.  Clarification added.
> 
> Ok for trunk?
> 
> Regards,
> Robert
> 
> 2015-02-02  Robert Suchanek  <robert.suchanek@imgtec.com>
> 
>        * gcc.target/mips/loongson-simd.c: Update comment to clarify the need
>        for mips_nanlegacy target.
> 
> diff --git a/gcc/testsuite/gcc.target/mips/loongson-simd.c
> b/gcc/testsuite/gcc.target/mips/loongson-simd.c
> index 949632e..9c3ebce 100644
> --- a/gcc/testsuite/gcc.target/mips/loongson-simd.c
> +++ b/gcc/testsuite/gcc.target/mips/loongson-simd.c
> @@ -21,7 +21,10 @@ along with GCC; see the file COPYING3.  If not see
>  /* { dg-do run } */
>  /* 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.  */
> +   that the Loongson processors do not support either.  The effective target
> +   mips_nanlegacy is required for a toolchain without the legacy NaN support
> +   because inclusion of some system headers e.g. stdint.h will fail due to not
> +   finding stubs-o32_hard.h.  */
>  /* { dg-require-effective-target mips_nanlegacy } */
>  /* { dg-options "isa=loongson -mhard-float -mno-micromips -mno-mips16 -
> flax-vector-conversions" } */
> 

Thanks for the update.  This is OK.
Catherine

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH MIPS RFA] Regression cleanup for nan2008 toolchain
  2015-02-03 17:42     ` Moore, Catherine
@ 2015-02-04 11:36       ` Robert Suchanek
  0 siblings, 0 replies; 7+ messages in thread
From: Robert Suchanek @ 2015-02-04 11:36 UTC (permalink / raw)
  To: Moore, Catherine, Richard Sandiford; +Cc: gcc-patches, Matthew Fortune

> > 2015-02-02  Robert Suchanek  <robert.suchanek@imgtec.com>
> >
> >        * gcc.target/mips/loongson-simd.c: Update comment to clarify the
> need
> >        for mips_nanlegacy target.
> >
> > diff --git a/gcc/testsuite/gcc.target/mips/loongson-simd.c
> > b/gcc/testsuite/gcc.target/mips/loongson-simd.c
> > index 949632e..9c3ebce 100644
> > --- a/gcc/testsuite/gcc.target/mips/loongson-simd.c
> > +++ b/gcc/testsuite/gcc.target/mips/loongson-simd.c
> > @@ -21,7 +21,10 @@ along with GCC; see the file COPYING3.  If not see
> >  /* { dg-do run } */
> >  /* 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.  */
> > +   that the Loongson processors do not support either.  The effective
> target
> > +   mips_nanlegacy is required for a toolchain without the legacy NaN
> support
> > +   because inclusion of some system headers e.g. stdint.h will fail due to
> not
> > +   finding stubs-o32_hard.h.  */
> >  /* { dg-require-effective-target mips_nanlegacy } */
> >  /* { dg-options "isa=loongson -mhard-float -mno-micromips -mno-mips16 -
> > flax-vector-conversions" } */
> >
> 
> Thanks for the update.  This is OK.
> Catherine

Committed as r220393.

Thanks and regards,
Robert

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-02-04 11:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 13:23 [PATCH MIPS RFA] Regression cleanup for nan2008 toolchain Robert Suchanek
2015-01-26 17:25 ` Moore, Catherine
2015-01-28 10:27   ` Robert Suchanek
2015-01-31 19:20 ` Richard Sandiford
2015-02-02 16:18   ` Robert Suchanek
2015-02-03 17:42     ` Moore, Catherine
2015-02-04 11:36       ` Robert Suchanek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).