diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-08-24 01:25:42 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2007-08-24 01:25:42 +0200 |
commit | 9b21a3805360cf92d94c3767743f85f992f8293d (patch) | |
tree | 8c453da406c283968faca7997474722567e1f1d5 /gcc/fortran/trans-decl.c | |
parent | c6f3d2f4636f58ed99c9d84898c7807c068da925 (diff) | |
download | gcc-9b21a3805360cf92d94c3767743f85f992f8293d.zip gcc-9b21a3805360cf92d94c3767743f85f992f8293d.tar.gz gcc-9b21a3805360cf92d94c3767743f85f992f8293d.tar.bz2 |
decl.c (variable_decl): Don't share charlen structs if length == NULL.
* decl.c (variable_decl): Don't share charlen structs if
length == NULL.
* trans-decl.c (create_function_arglist): Assert
f->sym->ts.cl->backend_decl is NULL instead of unsharing
charlen struct here.
* gfortran.dg/assumed_charlen_sharing.f90: New test.
From-SVN: r127748
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r-- | gcc/fortran/trans-decl.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index e9b9480..047ced9 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1458,25 +1458,8 @@ create_function_arglist (gfc_symbol * sym) if (!f->sym->ts.cl->length) { TREE_USED (length) = 1; - 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; - } + gcc_assert (!f->sym->ts.cl->backend_decl); + f->sym->ts.cl->backend_decl = length; } hidden_typelist = TREE_CHAIN (hidden_typelist); |