https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104131
--- Comment #2 from G. Steinmetz <gs...@t-online.de> --- And with a coarray : $ cat zz1.f90 program p use iso_c_binding, only: c_intptr_t integer, parameter :: omp_event_handle_kind = c_intptr_t integer (kind=omp_event_handle_kind) :: x[*] !$omp task detach (x) !$omp end task end $ cat zz2.f90 program p use iso_c_binding, only: c_intptr_t integer, parameter :: omp_event_handle_kind = c_intptr_t integer (kind=omp_event_handle_kind) :: x[*] !$omp parallel master default (none) !$omp task detach (x) !$omp end task !$omp end parallel master end $ gfortran-12-20220123 -c zz1.f90 -fopenmp -fcoarray=single zz1.f90:5:24: 5 | !$omp task detach (x) | ^ internal compiler error: Segmentation fault 0xcc430f crash_signal ../../gcc/toplev.cc:322 0xa229da omp_add_variable ../../gcc/gimplify.cc:7200 0xa32f20 gimplify_scan_omp_clauses ../../gcc/gimplify.cc:10305 0xa267ce gimplify_omp_task ../../gcc/gimplify.cc:12122 0xa267ce gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc/gimplify.cc:15454 0xa29b18 gimplify_stmt(tree_node**, gimple**) ../../gcc/gimplify.cc:7035 0xa2a071 gimplify_bind_expr ../../gcc/gimplify.cc:1427 0xa2745a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc/gimplify.cc:15161 0xa29b18 gimplify_stmt(tree_node**, gimple**) ../../gcc/gimplify.cc:7035 0xa2ab9b gimplify_body(tree_node*, bool) ../../gcc/gimplify.cc:16206 0xa2afef gimplify_function_tree(tree_node*) ../../gcc/gimplify.cc:16360 0x8b26f7 cgraph_node::analyze() ../../gcc/cgraphunit.cc:675 0x8b50a7 analyze_functions ../../gcc/cgraphunit.cc:1240 0x8b5a6d symbol_table::finalize_compilation_unit() ../../gcc/cgraphunit.cc:2500