https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93871
--- Comment #15 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Sat, Feb 22, 2020 at 10:17:17AM +0000, thenlich at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93871 > > --- Comment #14 from Thomas Henlich <thenlich at gcc dot gnu.org> --- > Come for the runtime, stay for the ICE! To improve the runtime, one needs to rework gfc_resolve_cotan(). This is where sin(x) and cos(x) are evaluated, then the quotient is taken. The slowness comes from doing the argument reduction twice. For some architectures, it can be improved by computed cexp() and then using the real and imaginary parts to compute cotan(). Why? On some architectures, cexp() is computed via __builtin_sincos().