diff options
author | Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> | 2004-07-15 20:43:50 +0200 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2004-07-15 20:43:50 +0200 |
commit | d157d9782201b9cd3b795add94e350506bc7d7e6 (patch) | |
tree | c4e4a7d1156338b62ca24aa663b9a89e1ea4e68d /gcc/fortran | |
parent | fdb510e7d6764f80d14dfd71dc56cce1b7c9b9f0 (diff) | |
download | gcc-d157d9782201b9cd3b795add94e350506bc7d7e6.zip gcc-d157d9782201b9cd3b795add94e350506bc7d7e6.tar.gz gcc-d157d9782201b9cd3b795add94e350506bc7d7e6.tar.bz2 |
re PR fortran/15129 (assumed size characters passed to subroutines incorrect)
fortran/
PR fortran/15129
* trans-decl.c (gfc_build_function_decl): Create a new chardecl
for every assumed length character dummy argument.
testsuite/
PR fortran/15129
* gfortran.dg/pr15129.f90: New test.
From-SVN: r84769
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 20 |
2 files changed, 25 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 78c2537..2667cb8 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 2004-07-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> + PR fortran/15129 + * trans-decl.c (gfc_build_function_decl): Create a new chardecl + for every assumed length character dummy argument. + +2004-07-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> + PR fortran/15324 * trans-array.c gfc_trans_g77_array, gfc_trans_dummy_array_bias): Don't call gfc_trans_string_init diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 24087c0..f7cfd97 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1180,7 +1180,25 @@ gfc_build_function_decl (gfc_symbol * sym) if (!f->sym->ts.cl->length) { TREE_USED (length) = 1; - f->sym->ts.cl->backend_decl = length; + if (!f->sym->ts.cl->backend_decl) + f->sym->ts.cl->backend_decl = length; + else + { + /* there is already another variable using this + gfc_charlen node, build a new one for this variable + and chain it into the list of gfc_charlens. + This happens for e.g. in the case + CHARACTER(*)::c1,c2 + since CHARACTER declarations on the same line share + the same gfc_charlen node. */ + gfc_charlen *cl; + + cl = gfc_get_charlen (); + cl->backend_decl = length; + cl->next = f->sym->ts.cl->next; + f->sym->ts.cl->next = cl; + f->sym->ts.cl = cl; + } } parm = TREE_CHAIN (parm); |