https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88074

--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to jos...@codesourcery.com from comment #12)
> Note that such issues are not unique to ctan.
> 
> E.g., compiling __builtin_jn (1000000000, 1e10) will produce such a hang.  
> The difference is that in the ctan case the additional algorithm needed in 
> MPC to avoid huge precision being needed for such cases would be 
> reasonable simple, whereas fast and accurate computation of high-order 
> Bessel functions is much harder (there's some literature on the subject, 
> which I haven't studied in detail, but certainly additional algorithms 
> needed there in MPFR would be much more involved).

So if we can "easily" identify problematic argument ranges we can refrain
from constant-folding these (I hope they are not constexpr in C++?).  I suppose
the C/C++ standards do not set any constraint on the precision of the result
though so we may be able to use the algorithm used by libm which surely
does not suffer from such cases (but degrades in precision instead)?

Reply via email to