On Thu, 24 Jan 2019 at 15:31, Joseph Myers <jos...@codesourcery.com> wrote:
>
> On Thu, 24 Jan 2019, Christophe Lyon wrote:
>
> > The attached small patch adds
> > /* { dg-require-effective-target fenv_exceptions } */
> > to them.
>
> It should be a *new* effective-target, because these tests are nothing to
> do with exceptions; they're about rounding modes (but actually you only
> need an effective-target that tests whether fenv.h can be included because
> the tests contain #ifdef for the rounding modes used).
>

OK, here is an updated version, including a doc for fenv_exceptions.

Christophe

> --
> Joseph S. Myers
> jos...@codesourcery.com
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 32a8f6a..a670456 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2128,6 +2128,13 @@ Target can truncate a file from a file descriptor, as 
used by
 @file{libgfortran/io/unix.c:fd_truncate}; i.e.@: @code{ftruncate} or
 @code{chsize}.
 
+@item fenv
+Target provides @file{fenv.h} include file.
+
+@item fenv_exceptions
+Target supports @file{fenv.h} with all the standard IEEE exceptions
+and floating-point exceptions are raised by arithmetic operations.
+
 @item freestanding
 Target is @samp{freestanding} as defined in section 4 of the C99 standard.
 Effectively, it is a target which supports no extra headers or libraries
diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c 
b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c
index fa6eb6b..c445d10 100644
--- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c
+++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c
@@ -4,6 +4,7 @@
 /* { dg-require-effective-target __float128 } */
 /* { dg-require-effective-target base_quadfloat_support } */
 /* { dg-require-effective-target int128 } */
+/* { dg-require-effective-target fenv } */
 /* { dg-options "-frounding-math" } */
 /* { dg-add-options __float128 } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-1.c 
b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-1.c
index d6454fa..0c524a8 100644
--- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-1.c
+++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-1.c
@@ -2,6 +2,7 @@
    float.  */
 /* { dg-do run } */
 /* { dg-require-effective-target int128 } */
+/* { dg-require-effective-target fenv } */
 /* { dg-options "-frounding-math" } */
 
 #include <fenv.h>
diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-2.c 
b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-2.c
index dbfa481..a82f03d 100644
--- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-2.c
+++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-2.c
@@ -2,6 +2,7 @@
    float.  */
 /* { dg-do run } */
 /* { dg-require-effective-target int128 } */
+/* { dg-require-effective-target fenv } */
 /* { dg-options "-frounding-math" } */
 
 #include <fenv.h>
diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c 
b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c
index 63a305e..707d539 100644
--- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c
+++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c
@@ -2,6 +2,7 @@
    float.  */
 /* { dg-do run } */
 /* { dg-require-effective-target int128 } */
+/* { dg-require-effective-target fenv } */
 /* { dg-options "-frounding-math" } */
 
 #include <fenv.h>
diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c 
b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c
index e716109..09600f9 100644
--- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c
+++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c
@@ -2,6 +2,7 @@
    float.  */
 /* { dg-do run } */
 /* { dg-require-effective-target int128 } */
+/* { dg-require-effective-target fenv } */
 /* { dg-options "-frounding-math" } */
 
 #include <fenv.h>
diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index c0df467..92202ff 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -8536,6 +8536,14 @@ proc check_effective_target_avr_tiny { } {
     }
 }
 
+# Return 1 if <fenv.h> is available.
+
+proc check_effective_target_fenv {} {
+    return [check_no_compiler_messages fenv object {
+       #include <fenv.h>
+    } [add_options_for_ieee "-std=gnu99"]]
+}
+
 # Return 1 if <fenv.h> is available with all the standard IEEE
 # exceptions and floating-point exceptions are raised by arithmetic
 # operations.  (If the target requires special options for "inexact"
2019-01-24  Christophe Lyon  <christophe.l...@linaro.org>

        gcc/
        * doc/sourcebuild.texi (Environment attributes): Add fenv and
        fenv_exceptions description.

2019-01-24  Christophe Lyon  <christophe.l...@linaro.org>

        gcc/testsuite/
        * lib/target-supports.exp (check_effective_target_fenv): New.
        * gcc.dg/torture/fp-int-convert-float128-timode-3.c: Add missing
        fenv effective target.
        * gcc.dg/torture/fp-int-convert-timode-1.c: Likewise.
        * gcc.dg/torture/fp-int-convert-timode-2.c: Likewise.
        * gcc.dg/torture/fp-int-convert-timode-3.c: Likewise.
        * gcc.dg/torture/fp-int-convert-timode-4.c: Likewise.

Reply via email to