diff options
| -rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
| -rw-r--r-- | 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 <gellerich@de.ibm.com> + + * trans-expr.c (gfc_add_interface_mapping): For characters, dereference + pointer if necessary and then perform the cast. + 2006-09-11 Steven G. Kargl <kargl@gcc.gnu.org> * 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, |

