@@ -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);
new file mode 100644
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! { dg-options "-fsecond-underscore" }
+! PR fortran/95106
+
+module m2345678901234567890123456789012345678901234567890123456789_123
+ implicit none
+ real :: a(4), u(3,2)
+ real :: b(4), v(4,2)
+ equivalence (a(1),u(1,1)), (b(1),v(1,1))
+end
+! { dg-final { scan-assembler {m2345678901234567890123456789012345678901234567890123456789_123.eq.0__} } }
+! { dg-final { scan-assembler {m2345678901234567890123456789012345678901234567890123456789_123.eq.1__} } }