From 1bd10ce92ad3c457721ccb520564596611fa941c Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Sun, 24 May 2020 21:35:04 +0200 Subject: PR fortran/95106 - truncation of long symbol names with EQUIVALENCE For long module names, the generated name-mangled symbol was truncated, leading to bogus warnings about COMMON block mismatches. Provide sufficiently large temporaries. gcc/fortran/ 2020-05-24 Harald Anlauf PR fortran/95106 * trans-common.c (gfc_sym_mangled_common_id): Enlarge temporaries for name-mangling. gcc/testsuite/ 2020-05-24 Harald Anlauf PR fortran/95106 * gfortran.dg/equiv_11.f90: New test. --- gcc/fortran/trans-common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/trans-common.c') diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index bf163bc..3775a8b 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -242,8 +242,9 @@ static tree gfc_sym_mangled_common_id (gfc_common_head *com) { int has_underscore; - char mangled_name[GFC_MAX_MANGLED_SYMBOL_LEN + 1]; - char name[GFC_MAX_SYMBOL_LEN + 1]; + /* Provide sufficient space to hold "symbol.eq.1234567890__". */ + char mangled_name[GFC_MAX_MANGLED_SYMBOL_LEN + 1 + 16]; + char name[GFC_MAX_SYMBOL_LEN + 1 + 16]; /* Get the name out of the common block pointer. */ strcpy (name, com->name); -- cgit v1.1