Bug in gmp/mpfr/mpc, never ending ctan computation

Richard Biener rguenther at suse.de
Mon Nov 19 09:31:43 UTC 2018


For

#include <complex.h>

int main()
{
  _Complex double x;
  __real x = 3.09126495087690770626068115234375e+8;
  __imag x = -4.045689747817175388336181640625e+8;
  volatile _Complex double y = ctan (x);
  return 0;
}

I see GCC never finishing constant folding of ctan () with
backtraces like

#0  0x00007ffff735666b in ?? () from /usr/lib64/libgmp.so.10
#1  0x00007ffff7356540 in ?? () from /usr/lib64/libgmp.so.10
#2  0x00007ffff7356540 in ?? () from /usr/lib64/libgmp.so.10
#3  0x00007ffff7356540 in ?? () from /usr/lib64/libgmp.so.10
#4  0x00007ffff7357157 in ?? () from /usr/lib64/libgmp.so.10
#5  0x00007ffff7357ecf in __gmpn_mul_fft () from /usr/lib64/libgmp.so.10
#6  0x00007ffff737a7cf in __gmpn_mulmod_bnm1 () from 
/usr/lib64/libgmp.so.10
#7  0x00007ffff737a553 in __gmpn_mulmod_bnm1 () from 
/usr/lib64/libgmp.so.10
#8  0x00007ffff737ab39 in __gmpn_mulmod_bnm1 () from 
/usr/lib64/libgmp.so.10
#9  0x00007ffff7358654 in __gmpn_nussbaumer_mul () from 
/usr/lib64/libgmp.so.10
#10 0x00007ffff735829e in __gmpn_mul_n () from /usr/lib64/libgmp.so.10
#11 0x00007ffff737e5e9 in __gmpn_preinv_mu_div_qr ()
   from /usr/lib64/libgmp.so.10
#12 0x00007ffff737ebf9 in ?? () from /usr/lib64/libgmp.so.10
#13 0x00007ffff7362638 in __gmpn_tdiv_qr () from /usr/lib64/libgmp.so.10
#14 0x00007ffff7353e24 in __gmpn_divrem () from /usr/lib64/libgmp.so.10
#15 0x00007ffff735b64c in ?? () from /usr/lib64/libgmp.so.10
#16 0x00007ffff735baf5 in __gmpn_sqrtrem () from /usr/lib64/libgmp.so.10
#17 0x00007ffff7344102 in __gmpz_sqrt () from /usr/lib64/libgmp.so.10
#18 0x00007ffff75d4c0c in ?? () from /usr/lib64/libmpfr.so.4
#19 0x00007ffff75d50a1 in ?? () from /usr/lib64/libmpfr.so.4
#20 0x00007ffff75d563d in mpfr_sincos_fast () from /usr/lib64/libmpfr.so.4
#21 0x00007ffff75d5c8c in mpfr_sin_cos () from /usr/lib64/libmpfr.so.4
#22 0x00007ffff7810b79 in mpc_sin_cos () from /usr/lib64/libmpc.so.3
#23 0x00007ffff78138ab in mpc_tan () from /usr/lib64/libmpc.so.3
#24 0x0000000000e835cf in do_mpc_arg1 (result_real=0x7fffffffcee0, 

So I'm not sure which library to report the issue on (and the MPC
bugtracker on gforge seems unused).  So I hope relevant devs follow
the GMP list and can identify the problematic library.

This has been reported as GCC bug here: 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88074

Thanks,
Richard.

-- 
Richard Biener <rguenther at suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)


More information about the gmp-devel mailing list