From 95cb77e64faa8e0a5852b947d29681809ad695ab Mon Sep 17 00:00:00 2001 From: Wolfgang Gellerich Date: Wed, 13 Sep 2006 12:36:26 +0000 Subject: [PATCH] trans-expr.c (gfc_add_interface_mapping): For characters, dereference pointer if necessary and then perform the cast. 2006-09-13 Wolfgang Gellerich * trans-expr.c (gfc_add_interface_mapping): For characters, dereference pointer if necessary and then perform the cast. From-SVN: r116921 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/trans-expr.c | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 54db2002e94..2e88fbf8b3e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2006-09-13 Wolfgang Gellerich + + * trans-expr.c (gfc_add_interface_mapping): For characters, dereference + pointer if necessary and then perform the cast. + 2006-09-11 Steven G. Kargl * intrinsic.c: Update Copyright date. diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index dc5ac27b786..e477f9c0612 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -1386,11 +1386,10 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping, tmp = gfc_get_character_type_len (sym->ts.kind, NULL); tmp = build_pointer_type (tmp); if (sym->attr.pointer) - tmp = build_pointer_type (tmp); - - value = fold_convert (tmp, se->expr); - if (sym->attr.pointer) - value = build_fold_indirect_ref (value); + value = build_fold_indirect_ref (se->expr); + else + value = se->expr; + value = fold_convert (tmp, value); } /* If the argument is a scalar, a pointer to an array or an allocatable, -- 2.30.2