Mainline produces a bad diagnostic for the following code snippet: =========================== subroutine FOO logical I I = I .eq. I end subroutine =========================== ePR22503.f:3.13: I = I .eq. I 1 Error: Logicals at (1) must be compared with .neqv. instead of .eq. This should read ".eqv." instead of ".neqv.". The regression was caused by the following patch: 2007-07-08 Daniel Franke <franke.daniel@gmail.com> Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/17711 * gfortran.h (gfc_intrinsic_op): Added INTRINSIC_EQ_OS, INTRINSIC_NE_OS, INTRINSIC_GT_OS, INTRINSIC_GE_OS, INTRINSIC_LT_OS and INTRINSIC_LE_OS. ... The problem is in the following code snipppet from the function resolve_operator in resolve.c: ... if (op1->ts.type == BT_LOGICAL && op2->ts.type == BT_LOGICAL) sprintf (msg, _("Logicals at %%L must be compared with %s instead of %s"), e->value.op.operator == INTRINSIC_EQ ? ".eqv." : ".neqv.", gfc_op2string (e->value.op.operator)); else ... Instead of only testing for INTRINSIC_EQ there should also be a test for INTRINSIC_EQ_OS IMHO.
Confirmed. Volker's suggestion is the correct fix. I have a patch and test case. I'm regression testing I as I type.
Thanks Steve :)
Subject: Bug 32899 Author: kargl Date: Fri Jul 27 16:59:32 2007 New Revision: 126985 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126985 Log: 2007-07-26 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/32899 * resolve.c (resolve_operator): Add INTRINSIC_EQ_OS comparison. 2007-07-26 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/32899 * gfortran.dg/logical_comp.f90: Update dg-error strings. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/resolve.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/logical_comp.f90
Fixed on trunk.