From 3b45d6c4896ce08bf70adde2a392f1293ee3766b Mon Sep 17 00:00:00 2001 From: Brooks Moses Date: Mon, 28 May 2007 20:53:09 +0000 Subject: [PATCH] PR 31972/fortran PR 31972/fortran * target-memory.c (gfc_target_expr_size): Add handling for size of BT_HOLLERITH variables. * check.c (gfc_check_transfer): Reject BT_HOLLERITH variables in MOLD argument of TRANSFER. From-SVN: r125141 --- gcc/fortran/ChangeLog | 8 ++++++++ gcc/fortran/check.c | 7 +++++++ gcc/fortran/target-memory.c | 2 ++ 3 files changed, 17 insertions(+) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3062509406f..001e66e5339 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2007-05-28 Brooks Moses + + PR 31972/fortran + * target-memory.c (gfc_target_expr_size): Add handling + for size of BT_HOLLERITH variables. + * check.c (gfc_check_transfer): Reject BT_HOLLERITH + variables in MOLD argument of TRANSFER. + 2007-05-28 Brooks Moses * gfortran.h (gfc_expr): Remove from_H, add "representation" diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index 682dc8b90a2..e2290026714 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -2601,6 +2601,13 @@ try gfc_check_transfer (gfc_expr *source ATTRIBUTE_UNUSED, gfc_expr *mold ATTRIBUTE_UNUSED, gfc_expr *size) { + if (mold->ts.type == BT_HOLLERITH) + { + gfc_error ("'MOLD' argument of 'TRANSFER' intrinsic at %L must not be %s", + &mold->where, gfc_basic_typename (BT_HOLLERITH)); + return FAILURE; + } + if (size != NULL) { if (type_check (size, 2, BT_INTEGER) == FAILURE) diff --git a/gcc/fortran/target-memory.c b/gcc/fortran/target-memory.c index 194bc0bc52d..e23574417bd 100644 --- a/gcc/fortran/target-memory.c +++ b/gcc/fortran/target-memory.c @@ -102,6 +102,8 @@ gfc_target_expr_size (gfc_expr *e) return size_logical (e->ts.kind); case BT_CHARACTER: return size_character (e->value.character.length); + case BT_HOLLERITH: + return e->representation.length; case BT_DERIVED: type = gfc_typenode_for_spec (&e->ts); return int_size_in_bytes (type);