Fortran degree trigonometric functions support procedure pointers
Fortran now supports degree-based trigonometric functions when used with procedure pointers.
GCC’s libgfortran has added support for degree-based trigonometric functions and their inverses, specifically catering to scenarios where these functions are used as targets for procedure pointers. Previously, while a value-passing variant existed, a reference-passing variant was missing for these Fortran calling conventions. This change introduces specific wrappers to handle these cases, ensuring consistent behavior and resolving an issue with intrinsic procedure resolution.
In Details
PR fortran/121366 addresses the need for degree trigonometric functions (and their inverses) in libgfortran to support Fortran calling conventions, particularly when used as procedure pointer targets. This commit adds specific wrappers in intrinsics/trigd_specific.F90 and ensures correct resolution and isym setting in iresolve.cc and trans-decl.cc.
- libgfortran
- The runtime library for the GNU Fortran compiler (gfortran), providing intrinsic functions and support for Fortran language features.
- procedure pointer
- A variable in Fortran that can hold the address of a procedure (function or subroutine), allowing for dynamic dispatch and callbacks.
- intrinsic function
- A built-in function provided by the programming language (like
SIN,COSin Fortran) that performs standard mathematical or computational operations. - Fortran calling conventions
- The rules for how arguments are passed between procedures (e.g., by value or by reference) and how return values are handled, specific to the Fortran language.