https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121263
Bug ID: 121263
Summary: ICE with transfer with rank 1 unlimited polymorhpic
Product: gcc
Version: 15.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: chuckyvt at gmail dot com
Target Milestone: ---
The following code generates an ICE for all versions of GFortran that I have
tried on Compiler Explorer. Unlimited polymorphic scalars seem to work ok,
but not arrays.
module stdlib_hashmap_wrappers
contains
subroutine set_rank_one_key( key, value )
integer, allocatable, intent(inout) :: key(:)
class(*), intent(in) :: value(:)
key = transfer( value, key )
end subroutine set_rank_one_key
end module stdlib_hashmap_wrappers
The following error is returned:
internal compiler error: tree check: expected class 'expression', have
'declaration' (var_decl) in tree_operand_check, at tree.h:4285
0x25d3a65 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x25c8b06 internal_error(char const*, ...)
???:0
0x90641a tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
???:0
0xb5ab99 gfc_conv_loop_setup(gfc_loopinfo*, locus*)
???:0
0xb77ae1 gfc_generate_function_code(gfc_namespace*)
???:0
0xb443d1 gfc_generate_module_code(gfc_namespace*)
???:0
0xaddee5 gfc_parse_file()
???:0
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.
Compiler returned: 1