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/85138] New: ICE with generic function


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85138

            Bug ID: 85138
           Summary: ICE with generic function
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: abensonca at gmail dot com
  Target Milestone: ---

The following (reduced from a much larger module) causes an ICE with gfortran
8.0.1 r258983:

module fox_m_fsys_format
  interface len
     module procedure str_real_sp_len, str_real_sp_fmt_len
  end interface
contains
  pure function str_real_sp_fmt_len(x, fmt) result(n)
    real, intent(in) :: x
    character(len=*), intent(in) :: fmt
    if (.not.checkFmt(fmt)) then
    endif
  end function str_real_sp_fmt_len
  pure function str_real_sp_len(x) result(n)
    real, intent(in) :: x
    n = len(x, "")
  end function str_real_sp_len
  function str_real_dp_matrix(xa) result(s)
    real, intent(in) :: xa
    character(len=len(xa)) :: s
  end function str_real_dp_matrix
end module fox_m_fsys_format

$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/home/abenson/Galacticus/Tools/libexec/gcc/x86_64-pc-linux-gnu/8.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/home/abenson/Galacticus/Tools
--enable-languages=c,c++,fort
an --disable-multilib
Thread model: posix
gcc version 8.0.1 20180330 (experimental) (GCC)

$ gfortran -c tmp3.F90
tmp3.F90:9:0:

     if (.not.checkFmt(fmt)) then

internal compiler error: in gfc_typenode_for_spec, at
fortran/trans-types.c:1157
0x5ee3b2 gfc_typenode_for_spec(gfc_typespec*, int)
        ../../gcc-trunk/gcc/fortran/trans-types.c:1157
0x889d77 gfc_conv_unary_op
        ../../gcc-trunk/gcc/fortran/trans-expr.c:2802
0x887060 gfc_conv_expr_op
        ../../gcc-trunk/gcc/fortran/trans-expr.c:3317
0x887060 gfc_conv_expr(gfc_se*, gfc_expr*)
        ../../gcc-trunk/gcc/fortran/trans-expr.c:7918
0x889cc7 gfc_conv_expr_val(gfc_se*, gfc_expr*)
        ../../gcc-trunk/gcc/fortran/trans-expr.c:7975
0x8c00d7 gfc_trans_if_1
        ../../gcc-trunk/gcc/fortran/trans-stmt.c:1427
0x8c8dba gfc_trans_if(gfc_code*)
        ../../gcc-trunk/gcc/fortran/trans-stmt.c:1464
0x84ca37 trans_code
        ../../gcc-trunk/gcc/fortran/trans.c:1916
0x878a2d gfc_generate_function_code(gfc_namespace*)
        ../../gcc-trunk/gcc/fortran/trans-decl.c:6507
0x850cc1 gfc_generate_module_code(gfc_namespace*)
        ../../gcc-trunk/gcc/fortran/trans.c:2222
0x80333b translate_all_program_units
        ../../gcc-trunk/gcc/fortran/parse.c:6108
0x80333b gfc_parse_file()
        ../../gcc-trunk/gcc/fortran/parse.c:6324
0x849b8f gfc_be_parse_file
        ../../gcc-trunk/gcc/fortran/f95-lang.c:204
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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