[Bug fortran/37400] [4.4 Regression] implicit character(len=*,kind=kind('A')) (Q) ... no longer gives the right answer.
--- Comment #5 from burnus at gcc dot gnu dot org 2008-09-08 07:21 --- Subject: Bug 37400 Author: burnus Date: Mon Sep 8 07:19:46 2008 New Revision: 140100 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=140100 Log: 2008-09-07 Tobias Burnus [EMAIL PROTECTED] PR fortran/37400 * symbol.c (gfc_set_default_type): Copy char len. 2008-09-07 Tobias Burnus [EMAIL PROTECTED] PR fortran/37400 * gfortran.dg/implicit_12.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/implicit_12.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/symbol.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37400
[Bug fortran/37400] [4.4 Regression] implicit character(len=*,kind=kind('A')) (Q) ... no longer gives the right answer.
--- Comment #6 from burnus at gcc dot gnu dot org 2008-09-08 07:38 --- FIXED on the trunk (4.4.0). (I'm not sure whether it fully works with 4.3.x - I get a segmentation fault after the third line is correctly printed. The cause that it was failing on 4.4 was the patch for PR 36476; but it was not the underlying reason for the bug.) -- burnus at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37400
[Bug fortran/37400] [4.4 Regression] implicit character(len=*,kind=kind('A')) (Q) ... no longer gives the right answer.
--- Comment #1 from burnus at gcc dot gnu dot org 2008-09-07 07:50 --- The problem is that for implicit character(len=*,kind=kind('A')) (Q) the length of the first parameter string is used everywhere. The following fixes it, but I have no idea why it is a regression / why it worked before. (I'm almost positive that we will forget to do something similar for deferred derived-type len parameter of F2003.) Index: symbol.c === --- symbol.c(Revision 140081) +++ symbol.c(Arbeitskopie) @@ -257,6 +257,12 @@ gfc_set_default_type (gfc_symbol *sym, i sym-ts = *ts; sym-attr.implicit_type = 1; + if (ts-cl) +{ + sym-ts.cl = gfc_get_charlen (); + *sym-ts.cl = *ts-cl; +} + if (sym-attr.is_bind_c == 1) { /* BIND(C) variables should not be implicitly declared. */ -- burnus at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords||wrong-code Last reconfirmed|-00-00 00:00:00 |2008-09-07 07:50:29 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37400
[Bug fortran/37400] [4.4 Regression] implicit character(len=*,kind=kind('A')) (Q) ... no longer gives the right answer.
--- Comment #2 from domob at gcc dot gnu dot org 2008-09-07 08:34 --- (In reply to comment #1) The problem is that for implicit character(len=*,kind=kind('A')) (Q) the length of the first parameter string is used everywhere. The following fixes it, but I have no idea why it is a regression / why it worked before. Could this have something to do with my used-before-typed patch that might have changed a little when/why symbols get their IMPLICIT type? Other than that, I can't imagine anything, either. But your patch looks good, just intuitively... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37400
[Bug fortran/37400] [4.4 Regression] implicit character(len=*,kind=kind('A')) (Q) ... no longer gives the right answer.
--- Comment #3 from dominiq at lps dot ens dot fr 2008-09-07 09:13 --- Subject: Re: [4.4 Regression] implicit character(len=*,kind=kind('A')) (Q) ... no longer gives the right answer. But your patch looks good, just intuitively... The patch works as expected, at least on my quick tests. I'll do a full regtesting this afternoon. Thanks for the quick fix. Dominique -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37400
[Bug fortran/37400] [4.4 Regression] implicit character(len=*,kind=kind('A')) (Q) ... no longer gives the right answer.
--- Comment #4 from dominiq at lps dot ens dot fr 2008-09-07 21:10 --- Regtests passed without regressions on i686-apple-darwin9. Thanks again for the patch. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37400
[Bug fortran/37400] [4.4 Regression] implicit character(len=*,kind=kind('A')) (Q) ... no longer gives the right answer.
-- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||pinskia at gcc dot gnu dot ||org Target Milestone|--- |4.4.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37400