aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-types.c
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2019-06-20 11:56:50 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2019-06-20 11:56:50 +0000
commit877ef6287904af71c811883a7a6e985ca10281ec (patch)
treed4708a67002a1d913d41760bb9133963403c464d /gcc/fortran/trans-types.c
parent1194e1971ac9ab84b633ee14c5a77f0e475990ab (diff)
downloadgcc-877ef6287904af71c811883a7a6e985ca10281ec.zip
gcc-877ef6287904af71c811883a7a6e985ca10281ec.tar.gz
gcc-877ef6287904af71c811883a7a6e985ca10281ec.tar.bz2
re PR fortran/90937 (ICE: in gfc_get_symbol_decl, at fortran/trans-decl.c:1538)
2019-06-20 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/90937 * trans-types.c (get_formal_from_actual_arglist): Get symbol from current namespace so it will be freed later. If symbol is of type character, get an empty character length. 2019-06-20 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/90937 * gfortran.dg/external_procedure_4.f90: New test. From-SVN: r272506
Diffstat (limited to 'gcc/fortran/trans-types.c')
-rw-r--r--gcc/fortran/trans-types.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index d236f37b..1dbb842 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -2997,7 +2997,7 @@ get_formal_from_actual_arglist (gfc_symbol *sym, gfc_actual_arglist *actual_args
if (a->expr)
{
snprintf (name, GFC_MAX_SYMBOL_LEN, "_formal_%d", var_num ++);
- gfc_get_symbol (name, NULL, &s);
+ gfc_get_symbol (name, gfc_current_ns, &s);
if (a->expr->ts.type == BT_PROCEDURE)
{
s->attr.flavor = FL_PROCEDURE;
@@ -3005,6 +3005,10 @@ get_formal_from_actual_arglist (gfc_symbol *sym, gfc_actual_arglist *actual_args
else
{
s->ts = a->expr->ts;
+
+ if (s->ts.type == BT_CHARACTER)
+ s->ts.u.cl = gfc_get_charlen ();
+
s->ts.deferred = 0;
s->ts.is_iso_c = 0;
s->ts.is_c_interop = 0;