https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93871
--- Comment #13 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Fri, Feb 21, 2020 at 08:58:59PM +0000, sgk at troutmask dot apl.washington.edu wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93871 > > --- Comment #11 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- > On Fri, Feb 21, 2020 at 08:44:25PM +0000, foreese at gcc dot gnu.org wrote: > > > > --- Comment #10 from Fritz Reese <foreese at gcc dot gnu.org> --- > > Thomas, thank you for discovering this. Steve, thanks for your investigative > > work and the patch. I will try to look at this and get a patch in within the > > next week or so. > > > > Hi Fritz, > > I'm scratching my head on this one. The way you added > 'cotan' to intrinsic.c looks exactly like how 'sin' > is added to the list of intrinsics. I would expect > it to just work, but ... clearly something is amiss. > Found it. Index: gcc/fortran/intrinsic.c =================================================================== --- gcc/fortran/intrinsic.c (revision 280157) +++ gcc/fortran/intrinsic.c (working copy) @@ -4568,8 +4568,7 @@ do_simplify (gfc_intrinsic_sym *specific, gfc_expr *e) /* Some math intrinsics need to wrap the original expression. */ if (specific->simplify.f1 == gfc_simplify_trigd - || specific->simplify.f1 == gfc_simplify_atrigd - || specific->simplify.f1 == gfc_simplify_cotan) + || specific->simplify.f1 == gfc_simplify_atrigd) { result = (*specific->simplify.f1) (e); goto finish; gfc_simplify_cotan doesn't need the special treatment that the degree-family of DEC functions need.