public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95106] New: Bogus warning from module with long name and an equivalence
@ 2020-05-13 16:19 gscfq@t-online.de
  2020-05-21 20:15 ` [Bug fortran/95106] " anlauf at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2020-05-13 16:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95106

            Bug ID: 95106
           Summary: Bogus warning from module with long name and an
                    equivalence
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Name length 59 ok, suspicious warning for 60..63 :


$ cat z1_59.f90
module m2345678901234567890123456789012345678901234567890123456789
   real :: a(4), u(3,2)
   real :: b(4), v(4,2)
   equivalence (a(1),u(1,1)), (b(1),v(1,1))
end


$ cat z1_60.f90
module m23456789012345678901234567890123456789012345678901234567890
   real :: a(4), u(3,2)
   real :: b(4), v(4,2)
   equivalence (a(1),u(1,1)), (b(1),v(1,1))
end


$ cat z1_63.f90
module m23456789012345678901234567890123456789012345678901234567890123
   real :: a(4), u(3,2)
   real :: b(4), v(4,2)
   equivalence (a(1),u(1,1)), (b(1),v(1,1))
end


$ gfortran-11-20200510 -c z1_59.f90
$
$ gfortran-11-20200510 -c z1_60.f90
z1_60.f90:1:67:

    1 | module m23456789012345678901234567890123456789012345678901234567890
      |                                                                   1
Warning: Named COMMON block
'm23456789012345678901234567890123456789012345678901234567890.eq.1' at (1)
shall be of the same size as elsewhere (24 vs 32 bytes)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/95106] Bogus warning from module with long name and an equivalence
  2020-05-13 16:19 [Bug fortran/95106] New: Bogus warning from module with long name and an equivalence gscfq@t-online.de
@ 2020-05-21 20:15 ` anlauf at gcc dot gnu.org
  2020-05-21 20:49 ` anlauf at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-05-21 20:15 UTC (permalink / raw)
  To: gcc-bugs

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:

0000000000000020 C
m2345678901234567890123456789012345678901234567890123456789.eq.0_
0000000000000018 C
m2345678901234567890123456789012345678901234567890123456789.eq.1_

For z1_60.o:

0000000000000020 C
m23456789012345678901234567890123456789012345678901234567890.eq._

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/95106] Bogus warning from module with long name and an equivalence
  2020-05-13 16:19 [Bug fortran/95106] New: Bogus warning from module with long name and an equivalence gscfq@t-online.de
  2020-05-21 20:15 ` [Bug fortran/95106] " anlauf at gcc dot gnu.org
@ 2020-05-21 20:49 ` anlauf at gcc dot gnu.org
  2020-05-22 18:43 ` anlauf at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-05-21 20:49 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/95106] Bogus warning from module with long name and an equivalence
  2020-05-13 16:19 [Bug fortran/95106] New: Bogus warning from module with long name and an equivalence gscfq@t-online.de
  2020-05-21 20:15 ` [Bug fortran/95106] " anlauf at gcc dot gnu.org
  2020-05-21 20:49 ` anlauf at gcc dot gnu.org
@ 2020-05-22 18:43 ` anlauf at gcc dot gnu.org
  2020-05-24 19:35 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-05-22 18:43 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/95106] Bogus warning from module with long name and an equivalence
  2020-05-13 16:19 [Bug fortran/95106] New: Bogus warning from module with long name and an equivalence gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-05-22 18:43 ` anlauf at gcc dot gnu.org
@ 2020-05-24 19:35 ` cvs-commit at gcc dot gnu.org
  2020-05-24 19:39 ` anlauf at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-24 19:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95106

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:

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

commit r11-594-gd176184d98a00ab379ae5959aed1908a79995e6b
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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/95106] Bogus warning from module with long name and an equivalence
  2020-05-13 16:19 [Bug fortran/95106] New: Bogus warning from module with long name and an equivalence gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-05-24 19:35 ` cvs-commit at gcc dot gnu.org
@ 2020-05-24 19:39 ` anlauf at gcc dot gnu.org
  2020-06-05 19:55 ` cvs-commit at gcc dot gnu.org
  2020-06-05 20:35 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-05-24 19:39 UTC (permalink / raw)
  To: gcc-bugs

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!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/95106] Bogus warning from module with long name and an equivalence
  2020-05-13 16:19 [Bug fortran/95106] New: Bogus warning from module with long name and an equivalence gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2020-05-24 19:39 ` anlauf at gcc dot gnu.org
@ 2020-06-05 19:55 ` cvs-commit at gcc dot gnu.org
  2020-06-05 20:35 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-05 19:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95106

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

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

commit r10-8255-g1e20cd1b583347cb2ea8591a45d99df143f7c41a
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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/95106] Bogus warning from module with long name and an equivalence
  2020-05-13 16:19 [Bug fortran/95106] New: Bogus warning from module with long name and an equivalence gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2020-06-05 19:55 ` cvs-commit at gcc dot gnu.org
@ 2020-06-05 20:35 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-05 20:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95106

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

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

commit r9-8655-g371739d01d00ae4c55902e0937b73ddee7d66391
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.

    (cherry picked from commit d176184d98a00ab379ae5959aed1908a79995e6b)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-06-05 20:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 16:19 [Bug fortran/95106] New: Bogus warning from module with long name and an equivalence gscfq@t-online.de
2020-05-21 20:15 ` [Bug fortran/95106] " anlauf at gcc dot gnu.org
2020-05-21 20:49 ` anlauf at gcc dot gnu.org
2020-05-22 18:43 ` anlauf at gcc dot gnu.org
2020-05-24 19:35 ` cvs-commit at gcc dot gnu.org
2020-05-24 19:39 ` anlauf at gcc dot gnu.org
2020-06-05 19:55 ` cvs-commit at gcc dot gnu.org
2020-06-05 20:35 ` cvs-commit at gcc dot gnu.org

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).