This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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|0000-00-00 00:00:00         |2008-09-07 07:50:29
               date|                            |


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]