From bc21d3152f7644fcbd2acf98adbba270c0408c91 Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Thu, 13 Aug 2009 21:46:46 +0200 Subject: re PR fortran/40941 (gfc_typespec: put derived and cl into union) 2009-08-13 Janus Weil PR fortran/40941 * gfortran.h (gfc_typespec): Put 'derived' and 'cl' into union. * decl.c (build_struct): Make sure 'cl' is only used if type is BT_CHARACTER. * symbol.c (gfc_set_default_type): Ditto. * resolve.c (resolve_symbol, resolve_fl_derived): Ditto. (resolve_equivalence,resolve_equivalence_derived): Make sure 'derived' is only used if type is BT_DERIVED. * trans-io.c (transfer_expr): Make sure 'derived' is only used if type is BT_DERIVED or BT_INTEGER (special case: C_PTR/C_FUNPTR). * array.c: Mechanical replacements to accomodate union in gfc_typespec. * check.c: Ditto. * data.c: Ditto. * decl.c: Ditto. * dump-parse-tree.c: Ditto. * expr.c: Ditto. * interface.c: Ditto. * iresolve.c: Ditto. * match.c: Ditto. * misc.c: Ditto. * module.c: Ditto. * openmp.c: Ditto. * parse.c: Ditto. * primary.c: Ditto. * resolve.c: Ditto. * simplify.c: Ditto. * symbol.c: Ditto. * target-memory.c: Ditto. * trans-array.c: Ditto. * trans-common.c: Ditto. * trans-const.c: Ditto. * trans-decl.c: Ditto. * trans-expr.c: Ditto. * trans-intrinsic.c: Ditto. * trans-io.c: Ditto. * trans-stmt.c: Ditto. * trans-types.c: Ditto. From-SVN: r150725 --- gcc/fortran/trans-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/trans-common.c') diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index ca94567d633..5b1952aee4a 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -132,7 +132,7 @@ get_segment_info (gfc_symbol * sym, HOST_WIDE_INT offset) /* Make sure we've got the character length. */ if (sym->ts.type == BT_CHARACTER) - gfc_conv_const_charlen (sym->ts.cl); + gfc_conv_const_charlen (sym->ts.u.cl); /* Create the segment_info and fill it in. */ s = (segment_info *) gfc_getmem (sizeof (segment_info)); @@ -830,7 +830,7 @@ calculate_offset (gfc_expr *e) case AR_ELEMENT: n = element_number (&reference->u.ar); if (element_type->type == BT_CHARACTER) - gfc_conv_const_charlen (element_type->cl); + gfc_conv_const_charlen (element_type->u.cl); element_size = int_size_in_bytes (gfc_typenode_for_spec (element_type)); offset += n * element_size; -- cgit v1.2.1