Correct module change introduced by DTIO patch.

Paul Richard Thomas paul.richard.thomas@gmail.com
Thu Sep 22 11:48:00 GMT 2016


Dear All,

This patch has just been committed to trunk as r240349, following an
OK from Andre on #gfortran.

This was urgently needed since the original DTIO patch, committed on
2016-31-08, added two extra pairs of parentheses, which are always
empty, to the intrinsic operator list in module files. Since
INTRINSIC_(UN)FORMATTED are NOT operators, the cleanest fix is to
place them after the sentinel in the enum. This has been commented
both in gfortran.h and interface.c to avoid any future
misunderstandings.

Please note that module files produced between 2016-31-08 05:36:22 and
11:26:59 today should be recompiled.

Paul

2016-09-22  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/48298
    * gfortran.h : Place the pseudo operators INTRINSIC_FORMATTED
    and INTRINSIC_UNFORMATTED after the sentinel in enum
    gfc_intrinsic_op so that they do not appear as place holders
    in module_write.
    * interface.c (dtio_op): Comment on the special nature of the
    pseudo operators INTRINSIC FORMATTED and INTRINSIC_UNFORMATTED.
-------------- next part --------------
Index: gcc/fortran/gfortran.h
===================================================================
*** gcc/fortran/gfortran.h	(revision 240341)
--- gcc/fortran/gfortran.h	(working copy)
*************** enum gfc_intrinsic_op
*** 178,186 ****
    INTRINSIC_EQ_OS, INTRINSIC_NE_OS, INTRINSIC_GT_OS, INTRINSIC_GE_OS,
    INTRINSIC_LT_OS, INTRINSIC_LE_OS,
    INTRINSIC_NOT, INTRINSIC_USER, INTRINSIC_ASSIGN, INTRINSIC_PARENTHESES,
!   /* User defined derived type pseudo operator.  */
!   INTRINSIC_FORMATTED, INTRINSIC_UNFORMATTED,
!   GFC_INTRINSIC_END /* Sentinel */
  };
  
  /* This macro is the number of intrinsic operators that exist.
--- 178,187 ----
    INTRINSIC_EQ_OS, INTRINSIC_NE_OS, INTRINSIC_GT_OS, INTRINSIC_GE_OS,
    INTRINSIC_LT_OS, INTRINSIC_LE_OS,
    INTRINSIC_NOT, INTRINSIC_USER, INTRINSIC_ASSIGN, INTRINSIC_PARENTHESES,
!   GFC_INTRINSIC_END, /* Sentinel */
!   /* User defined derived type pseudo operators. These are set beyond the
!      sentinel so that they are excluded from module_read and module_write.  */
!   INTRINSIC_FORMATTED, INTRINSIC_UNFORMATTED
  };
  
  /* This macro is the number of intrinsic operators that exist.
Index: gcc/fortran/interface.c
===================================================================
*** gcc/fortran/interface.c	(revision 240342)
--- gcc/fortran/interface.c	(working copy)
*************** fold_unary_intrinsic (gfc_intrinsic_op o
*** 115,121 ****
  }
  
  
! /* Return the operator depending on the DTIO moded string.  */
  
  static gfc_intrinsic_op
  dtio_op (char* mode)
--- 115,123 ----
  }
  
  
! /* Return the operator depending on the DTIO moded string.  Note that
!    these are not operators in the normal sense and so have been placed
!    beyond GFC_INTRINSIC_END in gfortran.h:enum gfc_intrinsic_op.  */
  
  static gfc_intrinsic_op
  dtio_op (char* mode)


More information about the Gcc-patches mailing list