http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58652
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> --- Patch for comment 0. The previous check didn't work as one added a component ref to from_expr: if (UNLIMITED_POLY (from_expr)) vtab = NULL; ... gfc_add_vptr_component (from_expr); --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -7641,3 +7641,4 @@ conv_intrinsic_move_alloc (gfc_code *code) /* Reset _vptr component to declared type. */ - if (UNLIMITED_POLY (from_expr)) + if (vtab == NULL) + /* Unlimited polymorphic. */ gfc_add_modify_loc (input_location, &block, from_se.expr, @@ -7697,3 +7698,4 @@ conv_intrinsic_move_alloc (gfc_code *code) /* Reset _vptr component to declared type. */ - if (UNLIMITED_POLY (from_expr)) + if (vtab == NULL) + /* Unlimited polymorphic. */ gfc_add_modify_loc (input_location, &block, from_se.expr,