$ cat a.f integer*8 i integer*4 j i = mod(i,j) end $ g77 a.f $ ifort a.f $ pgf77 a.f $ gfortran a.f In file a.f:3 i = mod(i,j) 1 Error: 'p' argument of 'mod' intrinsic at (1) must be the same type and kind as 'a' We should be able to have j folded to the same kind as i.
Confirmed.
Patch submitted for that bug. Waiting for approval.
Subject: Bug 23912 Author: fxcoudert Date: Sun Nov 27 14:01:36 2005 New Revision: 107566 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107566 Log: PR fortran/23912 * iresolve.c (gfc_resolve_dim, gfc_resolve_mod, gfc_resolve_modulo): When arguments have different kinds, fold the lower one to the largest kind. * check.c (gfc_check_a_p): Arguments of different kinds is not a hard error, but an extension. * simplify.c (gfc_simplify_dim, gfc_simplify_mod, gfc_simplify_modulo): When arguments have different kinds, fold the lower one to the largest kind. * gfortran.dg/modulo_1.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/modulo_1.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/check.c trunk/gcc/fortran/iresolve.c trunk/gcc/fortran/simplify.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 23912 Author: fxcoudert Date: Fri Dec 2 15:50:30 2005 New Revision: 107897 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107897 Log: PR fortran/23912 * iresolve.c (gfc_resolve_dim, gfc_resolve_mod, gfc_resolve_modulo): When arguments have different kinds, fold the lower one to the largest kind. * check.c (gfc_check_a_p): Arguments of different kinds is not a hard error, but an extension. * simplify.c (gfc_simplify_dim, gfc_simplify_mod, gfc_simplify_modulo): When arguments have different kinds, fold the lower one to the largest kind. Modified: branches/gcc-4_1-branch/gcc/fortran/ChangeLog branches/gcc-4_1-branch/gcc/fortran/check.c branches/gcc-4_1-branch/gcc/fortran/iresolve.c branches/gcc-4_1-branch/gcc/fortran/simplify.c
Fixed on 4.1 and mainline.