On 7/10/19 7:50 AM, Mark Eggleston wrote: > The attached patch treats the intrinsic SIGN in the same way as MOD and > DIM as it has the same arguments. > > Tested using make -j 8 check-fortran on x86_64 > > Conditional compilation using #ifdef __GFC_REAL_16__ has been employed > where appropriate in the test cases so should be OK on platforms without > REAL(16). > > Change logs: > > gcc/fortran > > Mark Eggleston <mark.eggles...@codethink.com> > > PR fortran/89286 > * check.c (gfc_check_sign): Deleted. > * intrinsic.c (add_functions): Call add_sym_2 with gfc_check_a_p > instead of gfc_check_sign for "sign". > * intrinsic.h: Remove declaration of gfc_check_sign. > * iresolve.c (gfc_resolve_sign): Check for largest kind of the actual > arguments and convert the smaller. Set return kind to be the largest. > * simplify.c (gfc_simplify_sign): Use the largest kind of the actual > arguments for return > * intrinsic.texi: Add GNU extension notes for return value to SIGN. > > gcc/testsuite > > Mark Eggleston <mark.eggles...@codethink.com> > > PR fortran/89240 > * gfortran.dg/sign_gnu_extension_1.f90: New test. > * gfortran.dg/sign_gnu_extension_2.f90: New test. > * gfortran.dg/pr78619.f90: Check for "must have" instead of "must be". > > If OK please can someone commit as I do not have the privileges. > So FWIW, this is in my tester now too.
jeff