https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92050
kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P4 CC| |kargl at gcc dot gnu.org, | |vehre at gcc dot gnu.org Target Milestone|--- |10.0 --- Comment #1 from kargl at gcc dot gnu.org --- The ICE is caused by an assert() in the code. Lines 7020-7035 in trans-expr.c are the following: if (args && args->expr && args->expr->ts.type == BT_CLASS && sym->ts.type == BT_CLASS && result != NULL_TREE && DECL_P (result) && !GFC_CLASS_TYPE_P (TREE_TYPE (result))) { gfc_se parmse; gfc_expr *class_expr = gfc_find_and_cut_at_last_class_ref (args->expr); gfc_init_se (&parmse, NULL); gfc_conv_expr (&parmse, class_expr); if (!DECL_LANG_SPECIFIC (result)) gfc_allocate_lang_decl (result); GFC_DECL_SAVED_DESCRIPTOR (result) = parmse.expr; gfc_free_expr (class_expr); // gcc_assert (parmse.pre.head == NULL_TREE // && parmse.post.head == NULL_TREE); } Commenting out the assert allows the code to compile with -fcheck=bounds. The code was added in revision 241439 by Andre Vehreschild on 2016-10-22. Andre, the assert be removed or hidden behind flag_bounds_check?