[Bug fortran/95106] Bogus warning from module with long name and an equivalence

2020-06-05 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95106

--- Comment #7 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:371739d01d00ae4c55902e0937b73ddee7d66391

commit r9-8655-g371739d01d00ae4c55902e0937b73ddee7d66391
Author: Harald Anlauf 
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  

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.

(cherry picked from commit d176184d98a00ab379ae5959aed1908a79995e6b)

[Bug fortran/95106] Bogus warning from module with long name and an equivalence

2020-06-05 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95106

--- Comment #6 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

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

commit r10-8255-g1e20cd1b583347cb2ea8591a45d99df143f7c41a
Author: Harald Anlauf 
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  

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.

[Bug fortran/95106] Bogus warning from module with long name and an equivalence

2020-05-24 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95106

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #5 from anlauf at gcc dot gnu.org ---
Should be fixed, closing.

The test case assumes name mangling for equivalences as on Linux/x86.
If some platform has different conventions, I can add an appropriate
restriction.

Thanks for the report!

[Bug fortran/95106] Bogus warning from module with long name and an equivalence

2020-05-24 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95106

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Harald Anlauf :

https://gcc.gnu.org/g:d176184d98a00ab379ae5959aed1908a79995e6b

commit r11-594-gd176184d98a00ab379ae5959aed1908a79995e6b
Author: Harald Anlauf 
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  

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.

[Bug fortran/95106] Bogus warning from module with long name and an equivalence

2020-05-22 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95106

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |anlauf at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

--- Comment #3 from anlauf at gcc dot gnu.org ---
Patch submitted for review:

https://gcc.gnu.org/pipermail/fortran/2020-May/054373.html

[Bug fortran/95106] Bogus warning from module with long name and an equivalence

2020-05-21 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95106

--- Comment #2 from anlauf at gcc dot gnu.org ---
Something like

diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index bf163bc4f52..06313873002 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -242,8 +242,8 @@ 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];
+  char mangled_name[GFC_MAX_MANGLED_SYMBOL_LEN + 10];
+  char name[GFC_MAX_SYMBOL_LEN + 10];

   /* Get the name out of the common block pointer.  */
   strcpy (name, com->name);

prevents the truncation of the mangled name, including the .eq.0123_ part.

[Bug fortran/95106] Bogus warning from module with long name and an equivalence

2020-05-21 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95106

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 CC||anlauf at gcc dot gnu.org
   Last reconfirmed||2020-05-21
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Keywords||wrong-code
   Priority|P3  |P4

--- Comment #1 from anlauf at gcc dot gnu.org ---
The warning is not only bogus, but indicates that something goes wrong.

Doing an "nm" on the resulting object files, it seems one equivalence is
missing for names of length 60+.

For z1_59.o:

0020 C
m2345678901234567890123456789012345678901234567890123456789.eq.0_
0018 C
m2345678901234567890123456789012345678901234567890123456789.eq.1_

For z1_60.o:

0020 C
m23456789012345678901234567890123456789012345678901234567890.eq._

It seems it cannot disambiguate the two equivalences any more,
and treat them as a single common.