This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/32899] New: [4.3 regresssion] Broken diagnostic for invalid use of .eq. for logicals


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.


-- 
           Summary: [4.3 regresssion] Broken diagnostic for invalid use of
                    .eq. for logicals
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32899


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]