https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93871
ktkachov at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ktkachov at gcc dot gnu.org --- Comment #48 from ktkachov at gcc dot gnu.org --- (In reply to CVS Commits from comment #45) > The master branch has been updated by Fritz Reese <fore...@gcc.gnu.org>: > > https://gcc.gnu.org/g:57391ddaf39f7cb85825c32e83feb1435889da51 > > commit r10-7603-g57391ddaf39f7cb85825c32e83feb1435889da51 > Author: Fritz Reese <fore...@gcc.gnu.org> > Date: Tue Apr 7 11:59:36 2020 -0400 > > Fix PR fortran/93871 and re-implement degree-valued trigonometric > intrinsics. > > 2020-04-01 Fritz Reese <fore...@gcc.gnu.org> > Steven G. Kargl <ka...@gcc.gnu.org> > > gcc/fortran/ChangeLog > > PR fortran/93871 > * gfortran.h (GFC_ISYM_ACOSD, GFC_ISYM_ASIND, GFC_ISYM_ATAN2D, > GFC_ISYM_ATAND, GFC_ISYM_COSD, GFC_ISYM_COTAND, GFC_ISYM_SIND, > GFC_ISYM_TAND): New. > * intrinsic.c (add_functions): Remove check for flag_dec_math. > Give degree trig functions simplification and name resolution > functions (e.g, gfc_simplify_atrigd () and gfc_resolve_atrigd > ()). > (do_simplify): Remove special casing of degree trig functions. > * intrinsic.h (gfc_simplify_acosd, gfc_simplify_asind, > gfc_simplify_atand, gfc_simplify_cosd, gfc_simplify_cotand, > gfc_simplify_sind, gfc_simplify_tand, gfc_resolve_trigd2): Add > new > prototypes. > (gfc_simplify_atrigd, gfc_simplify_trigd, gfc_resolve_cotan, > resolve_atrigd): Remove prototypes of deleted functions. > * iresolve.c (is_trig_resolved, copy_replace_function_shallow, > gfc_resolve_cotan, get_radians, get_degrees, resolve_trig_call, > gfc_resolve_atrigd, gfc_resolve_atan2d): Delete functions. > (gfc_resolve_trigd, gfc_resolve_trigd2): Resolve to library > functions. > * simplify.c (rad2deg, deg2rad, gfc_simplify_acosd, > gfc_simplify_asind, > gfc_simplify_atand, gfc_simplify_atan2d, gfc_simplify_cosd, > gfc_simplify_sind, gfc_simplify_tand, gfc_simplify_cotand): New > functions. > (gfc_simplify_atan2): Fix error message. > (simplify_trig_call, gfc_simplify_trigd, gfc_simplify_atrigd, > radians_f): Delete functions. > * trans-intrinsic.c: Add LIB_FUNCTION decls for sind, cosd, tand. > (rad2deg, gfc_conv_intrinsic_atrigd, gfc_conv_intrinsic_cotan, > gfc_conv_intrinsic_cotand, gfc_conv_intrinsic_atan2d): New > functions. > (gfc_conv_intrinsic_function): Handle ACOSD, ASIND, ATAND, COTAN, > COTAND, ATAN2D. > * trigd_fe.inc: New file. Included by simplify.c to implement > simplify_sind, simplify_cosd, simplify_tand with code common to > the > libgfortran implementation. > > gcc/testsuite/ChangeLog > > PR fortran/93871 > * gfortran.dg/dec_math.f90: Extend coverage to real(10) and > real(16). > * gfortran.dg/dec_math_2.f90: New test. > * gfortran.dg/dec_math_3.f90: Likewise. > * gfortran.dg/dec_math_4.f90: Likewise. > * gfortran.dg/dec_math_5.f90: Likewise. > > libgfortran/ChangeLog > > PR fortran/93871 > * Makefile.am, Makefile.in: New make rule for intrinsics/trigd.c. > * gfortran.map: New routines for {sind, cosd, tand}X{r4, r8, > r10, r16}. > * intrinsics/trigd.c, intrinsics/trigd_lib.inc, > intrinsics/trigd.inc: > New files. Defines native degree-valued trig functions. I think this broke the build for bare-metal (newlib) targets like aarch64-none-elf: libgfortran/intrinsics/trigd_lib.inc:55:56: error: implicit declaration of function 'copysignl' [-Werror=implicit-function-declaration] 55 | #define mpfr_copysign(rop, op1, op2, rnd) rop = SUFFIX(copysign)((op1), (op2)) | ^~~~~~~~ I think newlib doesn't support long double functions well so likely doesn't have copysignl. Is there some way this use can be conditionalised on library support?