https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84868
Paul Thomas <pault at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gnu.org CC| |pault at gcc dot gnu.org --- Comment #14 from Paul Thomas <pault at gcc dot gnu.org> --- (In reply to G. Steinmetz from comment #0) > Changed between 20161204 and 20161211 : > > > $ cat z1.f90 > module m > character(:), allocatable :: c > contains > function f(n) result(z) > character, parameter :: c(3) = ['x', 'y', 'z'] > integer, intent(in) :: n > character(len_trim(c(n))) :: z > z = c(n) > end > end > program p > use m > print *, f(2) > end > > > $ gfortran-7-20161204 -c z1.f90 > $ > $ gfortran-8-20180311 -c z1.f90 > z1.f90:13:0: > > print *, f(2) > > internal compiler error: in gfc_conv_descriptor_offset, at > fortran/trans-array.c:208 > 0x74e222 gfc_conv_descriptor_offset > ../../gcc/fortran/trans-array.c:208 > 0x75349c gfc_conv_descriptor_offset_get(tree_node*) > ../../gcc/fortran/trans-array.c:220 > 0x75349c gfc_conv_array_offset(tree_node*) > ../../gcc/fortran/trans-array.c:2967 > 0x75349c gfc_conv_array_ref(gfc_se*, gfc_array_ref*, gfc_expr*, locus*) > ../../gcc/fortran/trans-array.c:3575 > 0x780ddd gfc_conv_variable > ../../gcc/fortran/trans-expr.c:2737 > 0x77db02 gfc_conv_expr(gfc_se*, gfc_expr*) > ../../gcc/fortran/trans-expr.c:7926 > 0x78a98c gfc_conv_intrinsic_function_args > ../../gcc/fortran/trans-intrinsic.c:223 > 0x79dc3d gfc_conv_intrinsic_len_trim > ../../gcc/fortran/trans-intrinsic.c:6248 > 0x79dc3d gfc_conv_intrinsic_function(gfc_se*, gfc_expr*) > ../../gcc/fortran/trans-intrinsic.c:9134 > 0x77d545 gfc_conv_function_expr > ../../gcc/fortran/trans-expr.c:6784 > 0x77dae2 gfc_conv_expr(gfc_se*, gfc_expr*) > ../../gcc/fortran/trans-expr.c:7918 > 0x77fa8a gfc_apply_interface_mapping(gfc_interface_mapping*, gfc_se*, > gfc_expr*) > ../../gcc/fortran/trans-expr.c:4409 > 0x77b6f7 gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*, > gfc_expr*, vec<tree_node*, va_gc, vl_embed>*) > ../../gcc/fortran/trans-expr.c:5970 > 0x77d59c gfc_conv_function_expr > ../../gcc/fortran/trans-expr.c:6808 > 0x77dae2 gfc_conv_expr(gfc_se*, gfc_expr*) > ../../gcc/fortran/trans-expr.c:7918 > 0x7843aa gfc_conv_expr_reference(gfc_se*, gfc_expr*) > ../../gcc/fortran/trans-expr.c:8018 > 0x7a3d56 gfc_trans_transfer(gfc_code*) > ../../gcc/fortran/trans-io.c:2585 > 0x749ec7 trans_code > ../../gcc/fortran/trans.c:2044 > 0x7a1807 build_dt > ../../gcc/fortran/trans-io.c:2027 > 0x749ee7 trans_code > ../../gcc/fortran/trans.c:2016 This, I believe, was commit 345bd7ebbb38f0e1d5acf33ab3f680111cfa7871 where LEN_TRIM was introduced to interface mapping on 2016-12-09 for pr44265. Removing the chunk concerned does not fix the problem. I have stared at this for ages. For reasons that I cannot see, the use associated version of 'c' is being used, so the interface mapping has failed. I will come back to this. Paul