https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105582
Bug ID: 105582
Summary: ICE on procedure pointer assignment inside block
Product: gcc
Version: og11 (devel/omp/gcc-11)
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: rnhmjoj at eurofusion dot eu
Target Milestone: ---
Compiling this program:
program pointer_block__crash
abstract interface
subroutine f()
end subroutine
end interface
block
procedure(f), pointer :: p
p => nop
end block
contains
subroutine nop()
end subroutine
end program
with gfortran results in an internal compiler error, producing this error
message:
crash.f90:1:28:
1 | program pointer_block__crash
| ^
internal compiler error: Segmentation fault
0x1666927 internal_error(char const*, ...)
???:0
0xe9c083 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
???:0
0x9bd1d6 walk_gimple_op(gimple*, tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
???:0
0x9bd37a walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
???:0
0x9bd510 walk_gimple_seq_mod(gimple**, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
???:0
0x9bd409 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
???:0
0x9bd510 walk_gimple_seq_mod(gimple**, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
???:0
0xcb199e lower_nested_functions(tree_node*)
???:0
0x86a856 cgraph_node::analyze()
???:0
0x86da1d symbol_table::finalize_compilation_unit()
???:0
I tested on GCC 9.3.0, 10.3.0, 11.2.0 and all versions result in the same
error.