[Bug fortran/38657] [4.3/4.4 Regression] PUBLIC/PRIVATE Common blocks
--- Comment #6 from pault at gcc dot gnu dot org 2009-01-05 16:32 --- (In reply to comment #1) Assuming no local problems and a clean tree (looks like), the following commit might have caused the regression: r130257 | fxcoudert | 2007-11-17 14:46:53 +0100 (Sat, 17 Nov 2007) | 6 lines http://gcc.gnu.org/viewcvs?view=revrevision=130257 PR fortran/30285 * module.c (struct written_common, written_commons): New structure. (compare_written_commons, free_written_common, write_common_0): New functions. (write_common): Call recursive function write_common_0. I have been tinkering with this and have made the above testcase work. However, legal cases that rename TESTCHAR on USE test3 (with appropriate PUBLIC statements of course) are failing. I am preparing a large envelope to track what happens to the names. Paul -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38657
[Bug fortran/38657] [4.3/4.4 Regression] PUBLIC/PRIVATE Common blocks
--- Comment #7 from pault at gcc dot gnu dot org 2009-01-05 17:35 --- I'm just about to post a patch. Paul -- pault at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |pault at gcc dot gnu dot org |dot org | Status|NEW |ASSIGNED Last reconfirmed|2009-01-02 19:04:21 |2009-01-05 17:35:55 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38657
[Bug fortran/38657] [4.3/4.4 Regression] PUBLIC/PRIVATE Common blocks
--- Comment #3 from mikael at gcc dot gnu dot org 2009-01-05 14:35 --- (In reply to comment #2) The .mod looks OK though - as far I can see (rearrangements; only one testcommon1 etc. instead of two). The test2.mod is wrong I think. Without USE TEST3: [...] (('testcommon1' 2 0 0 'testcommon1') ('testcommon2' 3 0 0 'testcommon2') ('testcommon3' 4 0 0 'testcommon3')) () (2 'testchar' 'test2' 'testchar' 1 ((VARIABLE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN IN_COMMON) (CHARACTER 1 0 0 CHARACTER (( CONSTANT (INTEGER 4 0 0 INTEGER ()) 0 '80'))) 0 0 () () 0 () () () 0 0) 3 'testint' 'test2' 'testint' 1 ((VARIABLE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN IN_COMMON) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0) 4 'testreal' 'test2' 'testreal' 1 ((VARIABLE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN IN_COMMON) (REAL 4 0 0 REAL ()) 0 0 () () 0 () () () 0 0) ) ('testchar' 0 2) With USE TEST3: [...] (('testcommon1' 2 0 0 'testcommon1') ('testcommon2' 3 0 0 'testcommon2') ('testcommon3' 4 0 0 'testcommon3')) () (5 'testchar' 'test2' 'testchar' 1 ((VARIABLE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN IN_COMMON) (CHARACTER 1 0 0 CHARACTER (( CONSTANT (INTEGER 4 0 0 INTEGER ()) 0 '80'))) 0 0 () () 0 () () () 0 0) 3 'testint' 'test3' 'testint' 1 ((VARIABLE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN IN_COMMON) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0) 2 'testchar' 'test3' 'testchar' 1 ((VARIABLE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN IN_COMMON) (CHARACTER 1 0 0 CHARACTER ((CONSTANT ( INTEGER 4 0 0 INTEGER ()) 0 '80'))) 0 0 () () 0 () () () 0 0) 4 'testreal' 'test3' 'testreal' 1 ((VARIABLE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN IN_COMMON) (REAL 4 0 0 REAL ()) 0 0 () () 0 () () () 0 0) ) ('testchar' 0 5) With USE TEST3, testreal, testint and testchar are included from module test3, which is wrong because everything is private in test3. We should either have variables from both test2 and test3, or only variables from test2. Furthermore, the 'testcommon1' common refers to 2, which is the wrong testchar (that from test3). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38657
[Bug fortran/38657] [4.3/4.4 Regression] PUBLIC/PRIVATE Common blocks
--- Comment #2 from burnus at gcc dot gnu dot org 2009-01-05 14:18 --- If one compares the dumps, one finds an additional + extern character(kind=1) testchar[1:80]; in the failing version. Thus while the working version accesses testcommon1.testchar[1]{lb: 1 sz: 1} the failing uses testchar[1]{lb: 1 sz: 1} The .mod looks OK though - as far I can see (rearrangements; only one testcommon1 etc. instead of two). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38657
[Bug fortran/38657] [4.3/4.4 Regression] PUBLIC/PRIVATE Common blocks
--- Comment #5 from mikael at gcc dot gnu dot org 2009-01-05 14:54 --- (In reply to comment #4) With USE TEST3, sym-backend_decl is not set. Interestingly, the backend_decl for test3's testchar is set. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38657
[Bug fortran/38657] [4.3/4.4 Regression] PUBLIC/PRIVATE Common blocks
--- Comment #8 from pault at gcc dot gnu dot org 2009-01-05 19:46 --- Subject: Bug 38657 Author: pault Date: Mon Jan 5 19:46:06 2009 New Revision: 143090 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=143090 Log: 2009-01-05 Paul Thomas pa...@gcc.gnu.org PR fortran/38657 * module.c (write_common_0): Use the name of the symtree rather than the common block, to determine if the common has been written. 2009-01-05 Paul Thomas pa...@gcc.gnu.org PR fortran/38657 * gfortran.dg/module_commons_3.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/module_commons_3.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/module.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38657
[Bug fortran/38657] [4.3/4.4 Regression] PUBLIC/PRIVATE Common blocks
--- Comment #1 from burnus at gcc dot gnu dot org 2009-01-05 13:35 --- I checked my old trunk builds: 2007-11-05-r129891 - works 2007-11-20-r130310 - fails (= 25 fortran/ commits) Assuming no local problems and a clean tree (looks like), the following commit might have caused the regression: r130257 | fxcoudert | 2007-11-17 14:46:53 +0100 (Sat, 17 Nov 2007) | 6 lines http://gcc.gnu.org/viewcvs?view=revrevision=130257 PR fortran/30285 * module.c (struct written_common, written_commons): New structure. (compare_written_commons, free_written_common, write_common_0): New functions. (write_common): Call recursive function write_common_0. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38657
[Bug fortran/38657] [4.3/4.4 Regression] PUBLIC/PRIVATE Common blocks
--- Comment #4 from mikael at gcc dot gnu dot org 2009-01-05 14:47 --- without USE TEST3, gfc_get_symbol_decl (sym=testchar) returns sym-backend_decl because it is set. With USE TEST3, sym-backend_decl is not set, and we create the declaration. As testchar is included from test2 we set the assembler name to __test2_MOD_testchar. Thus the linker message. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38657
[Bug fortran/38657] [4.3/4.4 Regression] PUBLIC/PRIVATE Common blocks
-- jv244 at cam dot ac dot uk changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2009-01-02 19:04:21 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38657
[Bug fortran/38657] [4.3/4.4 Regression] PUBLIC/PRIVATE Common blocks
-- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||pinskia at gcc dot gnu dot ||org Summary|[Regression, 4.4, 4.3] |[4.3/4.4 Regression] |PUBLIC/PRIVATE Common blocks|PUBLIC/PRIVATE Common blocks Target Milestone|--- |4.3.3 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38657
[Bug fortran/38657] [4.3/4.4 Regression] PUBLIC/PRIVATE Common blocks
-- jakub at gcc dot gnu dot org changed: What|Removed |Added Priority|P3 |P4 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38657