public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45044] Different named COMMON block size: No warning
       [not found] <bug-45044-4@http.gcc.gnu.org/bugzilla/>
@ 2011-03-09 13:38 ` dominiq at lps dot ens.fr
  2011-08-30 13:27 ` burnus at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-03-09 13:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45044

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.03.09 13:38:24
     Ever Confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-03-09 13:38:24 UTC ---
Still around at revision 170786.


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

* [Bug fortran/45044] Different named COMMON block size: No warning
       [not found] <bug-45044-4@http.gcc.gnu.org/bugzilla/>
  2011-03-09 13:38 ` [Bug fortran/45044] Different named COMMON block size: No warning dominiq at lps dot ens.fr
@ 2011-08-30 13:27 ` burnus at gcc dot gnu.org
  2011-08-30 13:28 ` burnus at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-08-30 13:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45044

Bug 45044 depends on bug 45045, which changed state.

Bug 45045 Summary: Named COMMON with different size: No warning with -fwhole-file
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45045

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-08-30 13:24:47 UTC ---
*** Bug 45045 has been marked as a duplicate of this bug. ***


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

* [Bug fortran/45044] Different named COMMON block size: No warning
       [not found] <bug-45044-4@http.gcc.gnu.org/bugzilla/>
  2011-03-09 13:38 ` [Bug fortran/45044] Different named COMMON block size: No warning dominiq at lps dot ens.fr
  2011-08-30 13:27 ` burnus at gcc dot gnu.org
@ 2011-08-30 13:28 ` burnus at gcc dot gnu.org
  2011-08-30 21:48 ` burnus at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-08-30 13:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45044

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-08-30 13:26:23 UTC ---
Simple patch to print also a warning if a smaller named common block follows a
larger one.

TODO: Print the location of the other COMMON block. One can recover the line
number via DECL_SOURCE_FILE and DECL_SOURCE_LINE, but one still lacks the
column and the source-line string (cf. gfc_linebuf).


--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -392,4 +392,10 @@ build_common_decl (gfc_common_head *com, tree union_type,
bool is_init)
       tree size = TYPE_SIZE_UNIT (union_type);
+
+      if (!tree_int_cst_equal (DECL_SIZE_UNIT (decl), size)
+                 && strcmp (com->name, BLANK_COMMON_NAME))
+       gfc_warning ("Named COMMON block '%s' at %L shall be of the "
+                    "same size", com->name, &com->where);
+
       if (tree_int_cst_lt (DECL_SIZE_UNIT (decl), size))
-        {
+       {
          /* Named common blocks of the same name shall be of the same size
@@ -397,5 +403,2 @@ build_common_decl (gfc_common_head *com, tree union_type,
bool is_init)
             blank common blocks may be of different sizes.  */
-         if (strcmp (com->name, BLANK_COMMON_NAME))
-           gfc_warning ("Named COMMON block '%s' at %L shall be of the "
-                        "same size", com->name, &com->where);
          DECL_SIZE (decl) = TYPE_SIZE (union_type);


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

* [Bug fortran/45044] Different named COMMON block size: No warning
       [not found] <bug-45044-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2011-08-30 13:28 ` burnus at gcc dot gnu.org
@ 2011-08-30 21:48 ` burnus at gcc dot gnu.org
  2011-08-30 23:00 ` burnus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-08-30 21:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45044

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-08-30 21:33:18 UTC ---
I was thinking of using:

          gfc_gsymbol *gsym;
          gsym = gfc_get_gsymbol (com->name);
          gcc_assert (gsym->type == GSYM_COMMON);
          gfc_warning ("Named COMMON block '%s' at %L shall be of the "
                       "same size as at %L (%lu vs %lu bytes)", com->name,
                       &com->where, &gsym->where,

But that won't work reliably:

a) The byte size changes, while the position of (2) remains the same, e.g:
Warnung: Named COMMON block 'xx' at (1) shall be of the same size as at (2) (24
vs 4 bytes)
Warnung: Named COMMON block 'xx' at (1) shall be of the same size as at (2) (8
vs 24 bytes)

b) One get's even strange results if one has 4 bytes, 30 bytes, 4 bytes as then
(1) and (2) have the same bytes size but the error message claims that one is 4
and the other is 30 bytes wide.


I defer this and now only print the byte-size, cf.
  http://gcc.gnu.org/ml/fortran/2011-08/msg00254.html


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

* [Bug fortran/45044] Different named COMMON block size: No warning
       [not found] <bug-45044-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2011-08-30 21:48 ` burnus at gcc dot gnu.org
@ 2011-08-30 23:00 ` burnus at gcc dot gnu.org
  2011-10-09 19:38 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-08-30 23:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45044

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-08-30 22:09:55 UTC ---
Author: burnus
Date: Tue Aug 30 22:09:49 2011
New Revision: 178344

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178344
Log:
2011-08-30  Tobias Burnus  <burnus@net-b.de>

        PR fortran/45044
        * trans-common.c (build_common_decl): Warn if named common
        block's size is not everywhere the same.

2011-08-30  Tobias Burnus  <burnus@net-b.de>

        PR fortran/45044
        * gfortran.dg/common_14.f90: New.
        * gfortran.dg/common_resize_1.f: Add two dg-warning.


Added:
    trunk/gcc/testsuite/gfortran.dg/common_14.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-common.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/common_resize_1.f


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

* [Bug fortran/45044] Different named COMMON block size: No warning
       [not found] <bug-45044-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2011-08-30 23:00 ` burnus at gcc dot gnu.org
@ 2011-10-09 19:38 ` burnus at gcc dot gnu.org
  2011-10-10  6:54 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-10-09 19:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45044

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-10-09 19:37:52 UTC ---
Author: burnus
Date: Sun Oct  9 19:37:47 2011
New Revision: 179729

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179729
Log:
2011-10-09  Tobias Burnus  <burnus@net-b.de>

        PR fortran/45044
        * trans-common.c (translate_common): Fix -Walign-commons
        check.

2011-10-09  Tobias Burnus  <burnus@net-b.de>

        PR fortran/45044
        * gfortran.dg/common_14.f90: Compile with -Wno-align-commons.
        * gfortran.dg/common_16.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/common_16.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-common.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/common_14.f90


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

* [Bug fortran/45044] Different named COMMON block size: No warning
       [not found] <bug-45044-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2011-10-09 19:38 ` burnus at gcc dot gnu.org
@ 2011-10-10  6:54 ` burnus at gcc dot gnu.org
  2014-01-13 15:13 ` dominiq at lps dot ens.fr
  2014-01-13 15:44 ` dominiq at lps dot ens.fr
  8 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-10-10  6:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45044

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-10-10 06:53:29 UTC ---
(In reply to comment #6)
> New Revision: 179729
> URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179729

Wrong PR number. This patch was for PR 50273 ([4.5/4.6/4.7 Regression]
-Walign-commons no longer effective).


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

* [Bug fortran/45044] Different named COMMON block size: No warning
       [not found] <bug-45044-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2011-10-10  6:54 ` burnus at gcc dot gnu.org
@ 2014-01-13 15:13 ` dominiq at lps dot ens.fr
  2014-01-13 15:44 ` dominiq at lps dot ens.fr
  8 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-01-13 15:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45044

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |4.7.3, 4.8.2, 4.9.0
         Resolution|---                         |FIXED
      Known to fail|                            |4.6.4

--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Starting with 4.7 (r178509, 2011-09-04) one gets

common /com/ a, b
            1
Warning: Named COMMON block 'com' at (1) shall be of the same size as elsewhere
(8 vs 12 bytes)

r177649 (2011-08-11) doe give the warning.

Closing as FIXED.


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

* [Bug fortran/45044] Different named COMMON block size: No warning
       [not found] <bug-45044-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2014-01-13 15:13 ` dominiq at lps dot ens.fr
@ 2014-01-13 15:44 ` dominiq at lps dot ens.fr
  8 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-01-13 15:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45044

--- Comment #9 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Revision 178344

Author:    burnus
Date:    Tue Aug 30 22:09:49 2011 UTC (2 years, 4 months ago)
Changed paths:    5
Log Message:    
2011-08-30  Tobias Burnus  <burnus@net-b.de>

        PR fortran/45044
        * trans-common.c (build_common_decl): Warn if named common
        block's size is not everywhere the same.

2011-08-30  Tobias Burnus  <burnus@net-b.de>

        PR fortran/45044
        * gfortran.dg/common_14.f90: New.
        * gfortran.dg/common_resize_1.f: Add two dg-warning.


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

end of thread, other threads:[~2014-01-13 15:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-45044-4@http.gcc.gnu.org/bugzilla/>
2011-03-09 13:38 ` [Bug fortran/45044] Different named COMMON block size: No warning dominiq at lps dot ens.fr
2011-08-30 13:27 ` burnus at gcc dot gnu.org
2011-08-30 13:28 ` burnus at gcc dot gnu.org
2011-08-30 21:48 ` burnus at gcc dot gnu.org
2011-08-30 23:00 ` burnus at gcc dot gnu.org
2011-10-09 19:38 ` burnus at gcc dot gnu.org
2011-10-10  6:54 ` burnus at gcc dot gnu.org
2014-01-13 15:13 ` dominiq at lps dot ens.fr
2014-01-13 15:44 ` dominiq at lps dot ens.fr

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