GNU MPFR 4.0.0 Release Candidate

2017-12-09 Thread Vincent Lefevre
The release of GNU MPFR 4.0.0 ("dinde aux marrons")
is imminent. Please help to make this release as good as possible
by downloading and testing this release candidate:

http://www.mpfr.org/mpfr-4.0.0/mpfr-4.0.0-rc1.tar.xz
http://www.mpfr.org/mpfr-4.0.0/mpfr-4.0.0-rc1.tar.bz2
http://www.mpfr.org/mpfr-4.0.0/mpfr-4.0.0-rc1.tar.gz
http://www.mpfr.org/mpfr-4.0.0/mpfr-4.0.0-rc1.zip

The SHA1 digests:
28ad8b9d40c43c9ad18b16e222b8addfbd83ba2e  mpfr-4.0.0-rc1.tar.bz2
cc8b56d998d5512e46209fea08d906f923367307  mpfr-4.0.0-rc1.tar.gz
717faa1896ccb7dc99f7ee6053452f5258ad53a8  mpfr-4.0.0-rc1.tar.xz
aa7a4a154e761f71fce65011e195f873cac60a22  mpfr-4.0.0-rc1.zip

The SHA256 digests:
944fb955c5cca1873fcf2343e7a1edfb56645e7b003d8eecc8fb768d86b564c3  
mpfr-4.0.0-rc1.tar.bz2
abbc893738d2df8120e615b2745a07646a5879d3be51f2f941c0057ce791aaca  
mpfr-4.0.0-rc1.tar.gz
ef98fd9b6cb98a3d4b15963bdeecb3e6f9a003a5e6ce94fa4a4c37a518085a11  
mpfr-4.0.0-rc1.tar.xz
69e665daa00a0a7214b3893d5c5f1ab6f475872b7c39f6a5b3999ad4b752e6e3  
mpfr-4.0.0-rc1.zip

The signatures:
http://www.mpfr.org/mpfr-4.0.0/mpfr-4.0.0-rc1.tar.xz.asc
http://www.mpfr.org/mpfr-4.0.0/mpfr-4.0.0-rc1.tar.bz2.asc
http://www.mpfr.org/mpfr-4.0.0/mpfr-4.0.0-rc1.tar.gz.asc
http://www.mpfr.org/mpfr-4.0.0/mpfr-4.0.0-rc1.zip.asc

Each tarball is signed by Vincent Lefèvre. This can be verified using
the DSA key ID 980C197698C3739D; this key can be retrieved with:

  gpg --recv-keys 980C197698C3739D

or by downloading it from .
The key fingerprint is:

  07F3 DBBE CC1A 3960 5078  094D 980C 1976 98C3 739D

The signatures can be verified with: gpg --verify 
You should check that the key fingerprint matches.

Changes from versions 3.1.* to version 4.0.0:
- The "dinde aux marrons" release.
- MPFR now depends on GMP 5.0+ instead of 4.1+.
- API change:
  Applications that call GMP's mp_set_memory_functions function to change
  the allocators must first call the new function mpfr_mp_memory_cleanup
  in all threads where MPFR is potentially used; this new function is
  currently equivalent to mpfr_free_cache.
  The reason is that the way memory allocation is done by MPFR has changed
  (again), so that the current GMP allocators are used (since for some
  applications, the old allocators may become invalid).
  Note: Freeing the caches like this might have a performance impact on some
  particular applications; if this is an issue, this could be handled for a
  future MPFR version.
- Mini-gmp support via the --enable-mini-gmp configure option (experimental).
- The minimum precision MPFR_PREC_MIN is now 1, with rounding defined as
  in the next IEEE 754 revision (ties rounded away from zero).
- Shared caches for multithreaded applications.
  New function mpfr_free_cache2.
- Partial support of MPFR_RNDF (faithful rounding).
- New functions: mpfr_fpif_export and mpfr_fpif_import to export and import
  numbers in a floating-point interchange format, independent both on the
  number of bits per word and on the endianness.
- New function mpfr_fmodquo to return the low bits of the quotient
  corresponding to mpfr_fmod.
- New functions mpfr_flags_clear, mpfr_flags_set, mpfr_flags_test,
  mpfr_flags_save and mpfr_flags_restore to operate on groups of flags.
- New functions mpfr_set_float128 and mpfr_get_float128 to convert from/to
  the __float128 type (requires --enable-float128 and compiler support).
- New functions mpfr_buildopt_float128_p and mpfr_buildopt_sharedcache_p.
- New functions mpfr_rint_roundeven and mpfr_roundeven, completing the
  other similar round-to-integer functions for rounding to nearest with
  the even-rounding rule.
- New macro mpfr_round_nearest_away to add partial emulation of the
  rounding to nearest-away (as defined in IEEE 754-2008).
- New functions mpfr_nrandom and mpfr_erandom to generate random numbers
  following normal and exponential distributions respectively.
- New functions mpfr_fmma and mpfr_fmms to compute a*b+c*d and a*b-c*d.
- New function mpfr_rootn_ui, similar to mpfr_root, but agreeing with the
  rootn function of the IEEE 754-2008 standard.
- New functions mpfr_log_ui to compute the logarithm of an integer,
  mpfr_gamma_inc for the incomplete Gamma function.
- New function mpfr_beta for the Beta function (incomplete, experimental).
- New function mpfr_get_q to convert a floating-point number into rational.
- The mpfr_dump function is now described in the manual; its output format
  has slightly changed.
- The mpfr_eint function now returns the value of the E1/eint1 function
  for negative argument.
- The behavior of the mpfr_set_exp function changed, as it could easily
  yield undefined behavior in some cases (this modifies both the API and
  the ABI).
- In function mpfr_urandom, the next random state no longer depends on the
  current exponent range and the rounding mode. The exceptions due to the
  rounding of the random number are now correctly generated, following the
  uniform distribution.
- Functions mpfr_grandom and m

Re: GNU MPFR 4.0.0 Release Candidate

2017-12-09 Thread Andrew Roberts

MPFR 4.0.0-rc1 causes in-tree build of gcc to fail (error building mpc)

Using:
gcc-8-20171203
gmp 6.1.2
mpc 1.0.3
mpfr 4.0.0-rc1
isl 0.16.1

mpfr-3.1.6 works fine.

/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. 
-I../../../gcc-8.0.0/mpc/src -I.. -I/home/aroberts/gcc/gcc-build/./gmp 
-I/home/aroberts/gcc/gcc-8.0.0/mpfr/src   -O2 -g   -pipe -MT pow_d.lo 
-MD -MP -MF .deps/pow_d.Tpo -c -o pow_d.lo 
../../../gcc-8.0.0/mpc/src/pow_d.c
../../../gcc-8.0.0/mpc/src/mul.c:175:1: error: conflicting types for 
‘mpfr_fmma’

 mpfr_fmma (mpfr_ptr z, mpfr_srcptr a, mpfr_srcptr b, mpfr_srcptr c,
 ^
In file included from ../../../gcc-8.0.0/mpc/src/mpc.h:25:0,
 from ../../../gcc-8.0.0/mpc/src/mpc-impl.h:30,
 from ../../../gcc-8.0.0/mpc/src/mul.c:22:
/home/aroberts/gcc/gcc-8.0.0/mpfr/src/mpfr.h:731:21: note: previous 
declaration of ‘mpfr_fmma’ was here
 __MPFR_DECLSPEC int mpfr_fmma (mpfr_ptr, mpfr_srcptr, mpfr_srcptr, 
mpfr_srcptr,

 ^
make[4]: *** [Makefile:532: mul.lo] Error 1

I've also sent additional info to mpfr at inria.fr, but that was 
possibly rejected (sent to moderators), so this is just a heads up.


And yes I know its not an officially supported combination etc etc...

Regards

Andrew


Re: GNU MPFR 4.0.0 Release Candidate

2017-12-09 Thread Vincent Lefevre
On 2017-12-09 11:59:41 +, Andrew Roberts wrote:
> MPFR 4.0.0-rc1 causes in-tree build of gcc to fail (error building mpc)
[...]
> I've also sent additional info to mpfr at inria.fr, but that was possibly
> rejected (sent to moderators), so this is just a heads up.

It was just an informational message because only subscribers can
post without needing moderation (to avoid spam).

> And yes I know its not an officially supported combination etc etc...

As it was said later in the mpfr list, this is a bug in mpc, which
unconditionally took the mpfr namespace.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


GCC Plugin Callback on template instantiation (or constexpr call evaluation)

2017-12-09 Thread Katsunori Kumatani
For a GCC plugin, is there a way to have a callback registered/get
called on template instantiation of a type with an attribute or some
other means? Consider:

template struct foo { typedef T __attribute__((bar)) type; };

void foobar(foo::type);

In this case, the attribute handler callback gets called on the
template definition when it registers the attribute, not instantiation
in foobar which is what I need because I want to do some "processing"
on the type (which in this case is int*). For instance, remove the
POINTER_TYPE from it (which can easily be done with metaprogramming
but that's beside the point for this simple exercise, obviously).

Just as a note, I don't mind overriding any hooks (lang_hooks or
targetm or otherwise) if need be (and call the old one in a chain), or
just using plain plugin events, or other callbacks, etc.

An alternative way would be if I could intercept a constexpr call
evaluation in a plugin event, so then I can defer the whole thing to a
decltype of the plugin's function. There was a patch to add a
PLUGIN_EVAL_CALL_CONSTEXPR event a year ago but I've no idea what
happened to it.

I'm aware it's probably not possible at the moment but maybe I'm
missing something non-obvious. If it must be patched, hopefully a very
simple hook can be added for this purpose since it would help a lot
with plugins extending metaprogramming like this. Thanks.


Finishing the repository conversion

2017-12-09 Thread Eric S. Raymond
(I tried to send an earlier version of this a few days ago.  It's not
in your list archives; an MTA somewhere might have had a bad moment.)

I have good news and better news.

The good news is both reposurgeon bugs known to be blocking the GCC
repository conversion seem now to be fixed.

The better news is that the person cutting my paychecks has approved
the GCC repo conversion as a supported activity, which means I can
concentrate on this until it's done.  This couldn't happen sooner
because NTPsec had to get to 1.0 first.

I'm mirroring the repo now. It would  helpful if I could get an
up-to-date copy of the repository's attribution map (usernames to full
names and email addresses).

One thing my software can do now that it couldn't do six months ago
is mine Author fields from ChangeLog histories.  So you'll get a
better-quality conversion than if I had been able to finish this then.
-- 
http://www.catb.org/~esr/";>Eric S. Raymond

The price of liberty is, always has been, and always will be blood.  The person
who is not willing to die for his liberty has already lost it to the first
scoundrel who is willing to risk dying to violate that person's liberty.  Are
you free?   -- Andrew Ford