Re: _Float16-related failures on x86_64-apple-darwin

2021-12-30 Thread Joseph Myers
On Fri, 24 Dec 2021, Hongtao Liu via Gcc wrote:

> gcc define __FLT_EVAL_METHOD__ according to
> 
>   builtin_define_with_int_value ("__FLT_EVAL_METHOD__",
> c_flt_eval_method (true));
> 
> and guess we need to handle things like:
> 
>/* GCC only supports one interchange type right now, _Float16.  If
>   we're evaluating _Float16 in 16-bit precision, then flt_eval_method
>   will be FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16.  */
> +  if (x == FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16
> +  && x == y)
> +return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT;

That's an incorrect change.  excess_precision_mode_join has 
straightforward, well-defined semantics documented in the comment above 
the function and correcly implemented by it before this change; modifying 
those semantics is not the appropriate way to address this issue.

fixincludes is the right place for a fix for this issue.  There is a 
plausible case for having an architecture-independent 
__FLT_EVAL_METHOD___ macro that takes only values defined by 
C99 (regardless of -fpermitted-flt-eval-methods), rather than using the 
new C23 values such as 16, but if you did have such a macro you'd still 
need to fixinclude the system headers - it would just affect exactly what 
change fixincludes makes to those headers (if there were such a macro, 
fixincludes could change the headers to use it).

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: _Float16-related failures on x86_64-apple-darwin

2021-12-30 Thread FX via Gcc
Hi Joseph,

> fixincludes is the right place for a fix for this issue.  There is a 
> plausible case for having an architecture-independent 
> __FLT_EVAL_METHOD___ macro that takes only values defined by 
> C99 (regardless of -fpermitted-flt-eval-methods), rather than using the 
> new C23 values such as 16, but if you did have such a macro you'd still 
> need to fixinclude the system headers - it would just affect exactly what 
> change fixincludes makes to those headers (if there were such a macro, 
> fixincludes could change the headers to use it).

There is still a difference. If we define a new macro 
__FLT_EVAL_METHOD_OLDSTYLE__ (however it is named), it means we can make a more 
robust fixinclude, using that macro. If we fixinclude right now to handle the 
value of 16, then we might have to update the fixinclude for any new value that 
comes along in the future.

FX

Re: Need for __builtin_issignaling()

2021-12-30 Thread Joseph Myers
On Wed, 29 Dec 2021, FX via Gcc wrote:

> Is it particularly hard to do? I came across a post in the list archives 
> from Joseph, who said it would be good to have. I’d be willing to try 
> and put something together, unless you think it’s a big project. Any 
> pointers as to how to start would be appreciated.

Start by looking at Tamar Christina's patch for bugs 77925, 77926, 66462, 
which got reverted because of problems it caused.  In particular, see my 
comment 18 in bug 66462 pointing to some of the reports of issues, and 
look at the relevant discussion in June 2017.  I think the following 
comment 19 is incorrect (when it refers to June and November, those are 
June 2017 and November 2016, so the November version is an *older* one, 
but that comments is under the apprehension that it was a newer one).

There's no need to use that patch as a starting point, but it may well be 
helpful to do so, or at least to get ideas from it.  It didn't add 
__builtin_issignaling, but did add implementations of other related 
built-in functions based on bit-manipulation, and __builtin_issignaling 
would need to be implemented based on such bit-manipulation.

Apart from avoiding the bugs in that patch, for __builtin_issignaling 
there isn't any other implementation approach to fall back on, and there 
isn't any defined external-linkage function to fall back on either.  So 
it's strongly desirable to have a built-in function that works (is 
expanded inline) for *all* floating-point formats supported by GCC, not 
just some.  (For formats not supporting signaling NaNs, it can trivially 
return 0 after evaluating the argument for its side effects.)  Note that 
supporting all formats includes working for formats where integer 
arithmetic on a same-size integer isn't supported (TFmode on 32-bit 
architectures where there isn't TImode integer arithmetic, in particular), 
so you need to be careful about working correctly in that case.

-- 
Joseph S. Myers
jos...@codesourcery.com


gcc-9-20211230 is now available

2021-12-30 Thread GCC Administrator via Gcc
Snapshot gcc-9-20211230 is now available on
  https://gcc.gnu.org/pub/gcc/snapshots/9-20211230/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 9 git branch
with the following options: git://gcc.gnu.org/git/gcc.git branch releases/gcc-9 
revision 218f5148de327759769468030496bd370102bd64

You'll find:

 gcc-9-20211230.tar.xzComplete GCC

  SHA256=615dd83371326b63f16eac8bb47ee686ad5fba6547a3518ec749234b6246e11b
  SHA1=0818b925d5fb31206ad17ce3ac784b24254df60c

Diffs from 9-20211223 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-9
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.