https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87705
Bug ID: 87705 Summary: Compilation error when dealing with sub derived types Product: gcc Version: 8.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: peter.gerkens at siemens dot com Target Milestone: --- Created attachment 44882 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44882&action=edit File "main.f90" contains the module with the dreived type declarations and the main program containing some data statements. When using nested derived types the order of the variables in the "sub" derived type are important, otherwise a compiler error occurs: mlhw7ahx: /home/gerke00p/Softwaredevelopment/Fortran/gfortran_error_10_2018 > gfortran -v -save-temps -Wall -Wextra main.f90 -o main Driving: gfortran -v -save-temps -Wall -Wextra main.f90 -o main -l gfortran -l m -shared-libgcc Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/home/gerke00p/Softwaredevelopment/gcc/gcc-8.2.0_bin/libexec/gcc/x86_64-pc-linux-gnu/8.2.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-8.2.0/configure --prefix=/home/gerke00p/Softwaredevelopment/gcc/gcc-8.2.0_bin Thread model: posix gcc version 8.2.0 (GCC) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-Wextra' '-o' 'main' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /home/gerke00p/Softwaredevelopment/gcc/gcc-8.2.0_bin/libexec/gcc/x86_64-pc-linux-gnu/8.2.0/f951 main.f90 -quiet -dumpbase main.f90 -mtune=generic -march=x86-64 -auxbase main -Wall -Wextra -version -fintrinsic-modules-path /home/gerke00p/Softwaredevelopment/gcc/gcc-8.2.0_bin/lib/gcc/x86_64-pc-linux-gnu/8.2.0/finclude -o main.s GNU Fortran (GCC) version 8.2.0 (x86_64-pc-linux-gnu) compiled by GNU C version 8.2.0, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU Fortran2008 (GCC) version 8.2.0 (x86_64-pc-linux-gnu) compiled by GNU C version 8.2.0, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 main.f90:36:0: program main internal compiler error: in gfc_conv_string_init, at fortran/trans-const.c:148 0x5c5a3f gfc_conv_string_init(tree_node*, gfc_expr*) ../../gcc-8.2.0/gcc/fortran/trans-const.c:148 0x70a60f gfc_conv_initializer(gfc_expr*, gfc_typespec*, tree_node*, bool, bool, bool) ../../gcc-8.2.0/gcc/fortran/trans-expr.c:6958 0x70abb0 gfc_conv_structure(gfc_se*, gfc_expr*, int) ../../gcc-8.2.0/gcc/fortran/trans-expr.c:7818 0x70a627 gfc_conv_initializer(gfc_expr*, gfc_typespec*, tree_node*, bool, bool, bool) ../../gcc-8.2.0/gcc/fortran/trans-expr.c:6951 0x70abb0 gfc_conv_structure(gfc_se*, gfc_expr*, int) ../../gcc-8.2.0/gcc/fortran/trans-expr.c:7818 0x6ddcdd gfc_conv_array_initializer(tree_node*, gfc_expr*) ../../gcc-8.2.0/gcc/fortran/trans-array.c:5970 0x70a65a gfc_conv_initializer(gfc_expr*, gfc_typespec*, tree_node*, bool, bool, bool) ../../gcc-8.2.0/gcc/fortran/trans-expr.c:6916 0x6f4bf2 gfc_get_symbol_decl(gfc_symbol*) ../../gcc-8.2.0/gcc/fortran/trans-decl.c:1835 0x6f7657 generate_local_decl ../../gcc-8.2.0/gcc/fortran/trans-decl.c:5595 0x6bd4c2 do_traverse_symtree ../../gcc-8.2.0/gcc/fortran/symbol.c:4179 0x6f824a generate_local_vars ../../gcc-8.2.0/gcc/fortran/trans-decl.c:5795 0x6f824a gfc_generate_function_code(gfc_namespace*) ../../gcc-8.2.0/gcc/fortran/trans-decl.c:6442 0x688e46 translate_all_program_units ../../gcc-8.2.0/gcc/fortran/parse.c:6125 0x688e46 gfc_parse_file() ../../gcc-8.2.0/gcc/fortran/parse.c:6328 0x6cf25f gfc_be_parse_file ../../gcc-8.2.0/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.