+2018-02-25 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/78238
+ * gfortran.h (gfc_integer_4_kind): Define.
+ * resolve.c (resolve_select_type): Make sure that the
+ kind of c->high is gfc_integer_4_kind.
+
2018-02-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/30792
extern int gfc_character_storage_size;
#define gfc_logical_4_kind 4
+#define gfc_integer_4_kind 4
/* symbol.c */
void gfc_clear_new_implicit (void);
{
vtab = gfc_find_derived_vtab (c->ts.u.derived);
gcc_assert (vtab);
- c->high = gfc_get_int_expr (gfc_default_integer_kind, NULL,
+ c->high = gfc_get_int_expr (gfc_integer_4_kind, NULL,
c->ts.u.derived->hash_value);
}
else
gcc_assert (vtab && CLASS_DATA (vtab)->initializer);
e = CLASS_DATA (vtab)->initializer;
c->high = gfc_copy_expr (e);
+ if (c->high->ts.kind != gfc_integer_4_kind)
+ {
+ gfc_typespec ts;
+ ts.kind = gfc_integer_4_kind;
+ ts.type = BT_INTEGER;
+ gfc_convert_type_warn (c->high, &ts, 2, 0);
+ }
}
e = gfc_lval_expr_from_sym (vtab);
+2018-02-25 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/78238
+ * gfortran.dg/select_type_40.f90: New test.
+
2018-02-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/30792
--- /dev/null
+! { dg-do compile }
+! { dg-additional-options "-fdefault-integer-8" }
+! PR 78238 - this used to cause an ICE.
+! Original test cae by Gerhard Steinmetz
+class(*), allocatable :: q
+select type (x => q)
+type is (real)
+end select
+end