https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118441
--- Comment #3 from anlauf at gcc dot gnu.org --- Disabing the following part of r15-6508-gbca8b13bd7bc3d fixes the ICE: diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc index 7d3a9ed4a24..814a2055eca 100644 --- a/gcc/fortran/trans-decl.cc +++ b/gcc/fortran/trans-decl.cc @@ -2215,6 +2215,8 @@ get_proc_pointer_decl (gfc_symbol *sym) return decl; } +static void +create_function_arglist (gfc_symbol *sym); /* Get a basic decl for an external function. */ @@ -2464,7 +2466,12 @@ module_sym: if (sym->formal_ns->omp_declare_simd) gfc_trans_omp_declare_simd (sym->formal_ns); if (flag_openmp) - gfc_trans_omp_declare_variant (sym->formal_ns); + { + // We need DECL_ARGUMENTS to put attributes on, in case some arguments + // need adjustment + create_function_arglist (sym->formal_ns->proc_name); + gfc_trans_omp_declare_variant (sym->formal_ns); + } } return fndecl;