public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Giuliano Belinassi <giulianob@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/autopar_devel] PR fortran/95106 - truncation of long symbol names with EQUIVALENCE
Date: Sat, 22 Aug 2020 21:32:25 +0000 (GMT)	[thread overview]
Message-ID: <20200822213225.B4B85393BC18@sourceware.org> (raw)

https://gcc.gnu.org/g:1bd10ce92ad3c457721ccb520564596611fa941c

commit 1bd10ce92ad3c457721ccb520564596611fa941c
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sun May 24 21:35:04 2020 +0200

    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.

Diff:
---
 gcc/fortran/ChangeLog                  |  6 ++++++
 gcc/fortran/trans-common.c             |  5 +++--
 gcc/testsuite/ChangeLog                |  5 +++++
 gcc/testsuite/gfortran.dg/equiv_11.f90 | 12 ++++++++++++
 4 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 55d5dae3cf5..7ddc2b81945 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2020-05-24  Harald Anlauf  <anlauf@gmx.de>
+
+	PR fortran/95106
+	* trans-common.c (gfc_sym_mangled_common_id): Enlarge temporaries
+	for name-mangling.
+
 2020-05-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
 	PR libfortran/95191
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index bf163bc4f52..3775a8bea74 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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 80fd33dac18..2710d2ee490 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-24  Harald Anlauf  <anlauf@gmx.de>
+
+	PR fortran/95106
+	* gfortran.dg/equiv_11.f90: New test.
+
 2020-05-23  Patrick Palka  <ppalka@redhat.com>
 
 	PR c++/94038
diff --git a/gcc/testsuite/gfortran.dg/equiv_11.f90 b/gcc/testsuite/gfortran.dg/equiv_11.f90
new file mode 100644
index 00000000000..0f4a1ab5c32
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/equiv_11.f90
@@ -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__} } }


                 reply	other threads:[~2020-08-22 21:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200822213225.B4B85393BC18@sourceware.org \
    --to=giulianob@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).