diff options
author | Harald Anlauf <anlauf@gmx.de> | 2020-05-24 21:35:04 +0200 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-17 13:04:13 -0300 |
commit | 1bd10ce92ad3c457721ccb520564596611fa941c (patch) | |
tree | 8d1cf3c77f723012460a9f3edf5b3054bad9c3c6 /gcc/fortran/trans-common.c | |
parent | 4c60129313ee6cc02e184c5d789e7ee86e6ec21e (diff) | |
download | gcc-1bd10ce92ad3c457721ccb520564596611fa941c.zip gcc-1bd10ce92ad3c457721ccb520564596611fa941c.tar.gz gcc-1bd10ce92ad3c457721ccb520564596611fa941c.tar.bz2 |
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 <anlauf@gmx.de>
PR fortran/95106
* trans-common.c (gfc_sym_mangled_common_id): Enlarge temporaries
for name-mangling.
gcc/testsuite/
2020-05-24 Harald Anlauf <anlauf@gmx.de>
PR fortran/95106
* gfortran.dg/equiv_11.f90: New test.
Diffstat (limited to 'gcc/fortran/trans-common.c')
-rw-r--r-- | gcc/fortran/trans-common.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); |