public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kewen.Lin" <linkw@linux.ibm.com>
To: Piotr Kubaj <pkubaj@anongoth.pl>
Cc: segher@kernel.crashing.org, gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org
Subject: Re: [PATCH V2] powerpc: properly check for feenableexcept() on FreeBSD
Date: Thu, 12 May 2022 15:20:08 +0800	[thread overview]
Message-ID: <1042909b-f9e9-eb7d-19ca-2874214cb870@linux.ibm.com> (raw)
In-Reply-To: <Ynr2CdraevxPHhKH@KGPE-D16>

Hi Piotr,

Thanks for doing this, some comments are inlined.

on 2022/5/11 07:32, Piotr Kubaj via Gcc-patches wrote:
> Is there anything more required?
> 
> On 22-05-03 12:33:43, Piotr Kubaj wrote:
>> Here are gmake check-gfortran results requested by FX.
>>
>> Before patching:
>>                 === gfortran Summary ===
>>
>> # of expected passes            65106
>> # of unexpected failures        6
>> # of expected failures          262
>> # of unsupported tests          367
>>
>> After patching:
>>                 === gfortran Summary ===
>>
>> # of expected passes            65384
>> # of unexpected failures        6
>> # of expected failures          262
>> # of unsupported tests          373
>>

Nice!

>> In both cases, unexpected failures are:
>> FAIL: gfortran.dg/pr98076.f90   -O0  execution test
>> FAIL: gfortran.dg/pr98076.f90   -O1  execution test
>> FAIL: gfortran.dg/pr98076.f90   -O2  execution test
>> FAIL: gfortran.dg/pr98076.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
>> FAIL: gfortran.dg/pr98076.f90   -O3 -g  execution test
>> FAIL: gfortran.dg/pr98076.f90   -Os  execution test
>>
>> But this seems unrelated to my patch.>>
>> On 22-05-03 12:21:12, pkubaj@FreeBSD.org wrote:
>>> From: Piotr Kubaj <pkubaj@FreeBSD.org>
>>>
>>> FreeBSD/powerpc* has feenableexcept() defined in fenv.h header.
>>>
>>> Signed-off-by: Piotr Kubaj <pkubaj@FreeBSD.org>
>>> ---
>>>  libgfortran/configure    | 41 +++++++++++++++++++++++++++++++++++++++-
>>>  libgfortran/configure.ac | 17 ++++++++++++++++-
>>>  2 files changed, 56 insertions(+), 2 deletions(-)
>>>
... snip 
>>>  # At least for glibc, clock_gettime is in librt.  But don't
>>>  # pull that in if it still doesn't give us the function we want.  This
>>> diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
>>> index 97cc490cb5e..2dd6d345b22 100644
>>> --- a/libgfortran/configure.ac
>>> +++ b/libgfortran/configure.ac
>>> @@ -602,8 +602,23 @@ fi
>>>  # Check whether we have a __float128 type, depends on enable_libquadmath_support
>>>  LIBGFOR_CHECK_FLOAT128
>>>  
>>> +case x$target in
>>> +  xpowerpc*-freebsd*)
>>> +    AC_CACHE_CHECK([for fenv.h and feenableexcept], have_feenableexcept, [
>>> +      AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
>>> +        [[ #include <fenv.h>  ]],
>>> +        [[ feenableexcept(FE_DIVBYZERO | FE_INVALID); ]])],
>>> +        [ have_feenableexcept="yes" ],
>>> +        [ have_feenableexcept="no"  ])])
>>> +    if test "x$have_feenableexcept" = "xyes"; then
>>> +      AC_DEFINE(HAVE_FEENABLEEXCEPT,1,[fenv.h includes feenableexcept])
>>> +    fi;
>>> +    ;;
>>> +  *)

As your explanation in [1], IMHO it's not a good idea to take powerpc*-freebsd* specially
here, for your mentioned triples that may also suffer this same issue, we will have to
update this hunk for them in future.

How about: do the glibc check first as before, if it fails then do one further general check
(for all) with one compilation on fenv.h as what your patch proposes.

Besides, IMHO it should use AC_LINK_IFELSE, since one fenv.h which doesn't implement
feenableexcept could also pass the check.  And there is one AC_CHECK_HEADERS_ONCE checking
for fenv.h existence, not sure if it's worth to guarding the further check with its result.

[1] https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593248.html

BR,
Kewen

  reply	other threads:[~2022-05-12  7:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 10:21 pkubaj
2022-05-03 10:33 ` Piotr Kubaj
2022-05-10 23:32   ` Piotr Kubaj
2022-05-12  7:20     ` Kewen.Lin [this message]
2022-05-12 20:16 ` Segher Boessenkool
2022-05-13  2:59   ` Kewen.Lin
2022-05-13 10:34     ` Piotr Kubaj
2022-05-13 12:53       ` Segher Boessenkool
2022-05-14  5:46     ` Piotr Kubaj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1042909b-f9e9-eb7d-19ca-2874214cb870@linux.ibm.com \
    --to=linkw@linux.ibm.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pkubaj@anongoth.pl \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).