After PR97896 for which some code was added to ignore the KIND argument
of the INDEX intrinsics, and PR87711 for which that was extended to LEN_TRIM
as well, this propagates it further to MASKL, MASKR, SCAN and VERIFY.
PR fortran/103789
gcc/fortran/ChangeLog:
* trans-array.c (arg_evaluated_for_scalarization): Add MASKL, MASKR,
SCAN and VERIFY to the list of intrinsics whose KIND argument is to be
ignored.
gcc/testsuite/ChangeLog:
* gfortran.dg/maskl_1.f90: New test.
* gfortran.dg/maskr_1.f90: New test.
* gfortran.dg/scan_3.f90: New test.
* gfortran.dg/verify_3.f90: New test.
{
case GFC_ISYM_INDEX:
case GFC_ISYM_LEN_TRIM:
+ case GFC_ISYM_MASKL:
+ case GFC_ISYM_MASKR:
+ case GFC_ISYM_SCAN:
+ case GFC_ISYM_VERIFY:
if (strcmp ("kind", gfc_dummy_arg_get_name (*dummy_arg)) == 0)
return false;
/* Fallthrough. */
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/103789
+! Check the absence of ICE when generating calls to MASKL with a KIND argument.
+
+program p
+ integer :: z(2), y(2)
+ y = [1, 13]
+ z = maskl(y, kind=4) + 1
+end program p
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/103789
+! Check the absence of ICE when generating calls to MASKR with a KIND argument.
+
+program p
+ integer :: z(2), y(2)
+ y = [1, 13]
+ z = maskr(y, kind=4) + 1
+end program p
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/103789
+! Check the absence of ICE when generating calls to SCAN with a KIND argument.
+
+program p
+ character(len=10) :: y(2)
+ integer :: z(2)
+ y = ['abc', 'def']
+ z = scan(y, 'e', kind=4) + 1
+end program p
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/103789
+! Check the absence of ICE when generating calls to VERIFY with a KIND argument.
+
+program p
+ character(len=10) :: y(2)
+ integer :: z(2)
+ y = ['abc', 'def']
+ z = verify(y, 'e', kind=4) + 1
+end program p