https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125866
Bug ID: 125866
Summary: ICE: a module procedure with an allocatable,
intent(out) derived-type array dummy
Product: gcc
Version: 16.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: simon at whiteowl dot co.uk
Target Milestone: ---
Created attachment 64763
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64763&action=edit
Source file to reproduce the ICE, no pre-processing necessary
This applies to 12.3.0, 15.2.0 and 16.1.0. ifx and flang compile this code
cleanly.
gfortran -c -save-temps gf16-ice.f90
gf16-ice.f90:41:31:
41 | call lex(text, toks, n)
| 1
internal compiler error: Segmentation fault
0x22a363f internal_error(char const*, ...)
../../gcc/diagnostic-global-context.cc:787
0xfa48bf crash_signal
../../gcc/toplev.cc:325
0x83c599 is_CFI_desc(gfc_symbol*, gfc_expr*)
../../gcc/fortran/expr.cc:1197
0x9757e8 gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*,
gfc_expr*, vec<tree_node*, va_gc, vl_embed>*)
../../gcc/fortran/trans-expr.cc:8011
0x9cdaa1 gfc_trans_call(gfc_code*, bool, tree_node*, tree_node*, bool)
../../gcc/fortran/trans-stmt.cc:495
0x930f4e trans_code
../../gcc/fortran/trans.cc:2428
0x967f9b gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.cc:8303
0x936221 gfc_generate_module_code(gfc_namespace*)
../../gcc/fortran/trans.cc:2791
0x8c15fd translate_all_program_units
../../gcc/fortran/parse.cc:7583
0x8c15fd gfc_parse_file()
../../gcc/fortran/parse.cc:7926
0x92d99f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:247
/home/opt/gcc-16.1.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/16.1.0/f951
gf16-ice.f90 -quiet -dumpbase gf16-ice.f90 -dumpbase-ext .f90 -mtune=generic
-march=x86-64 -fintrinsic-modules-path
/home/opt/gcc-16.1.0/bin/../lib/gcc/x86_64-pc-linux-gnu/16.1.0/finclude
-fpre-include=/usr/include/finclude/math-vector-fortran.h -o gf16-ice.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.