[Bug fortran/27546] [F2003] IMPORT not implemented

2006-11-18 Thread patchapp at dberlin dot org


--- Comment #11 from patchapp at dberlin dot org  2006-11-18 10:45 ---
Subject: Bug number PR27546

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01304.html


-- 


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



[Bug fortran/27546] [F2003] IMPORT not implemented

2006-11-15 Thread burnus at gcc dot gnu dot org


--- Comment #6 from burnus at gcc dot gnu dot org  2006-11-15 15:46 ---
Subject: Bug 27546

Author: burnus
Date: Wed Nov 15 15:46:42 2006
New Revision: 118857

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=118857
Log:
fortran/
2006-11-15  Tobias Burnus  [EMAIL PROTECTED]

   PR fortran/27546
   * decl.c (gfc_match_import,variable_decl):
 Add IMPORT support.
 (gfc_match_kind_spec): Fix typo in gfc_error.
   * gfortran.h (gfc_namespace, gfc_statement):
 Add IMPORT support.
   * parse.c (decode_statement,gfc_ascii_statement,
 verify_st_order): Add IMPORT support.
   * match.h: Add gfc_match_import.
   * gfortran.texi: Add IMPORT to the supported
 Fortran 2003 features.

testsuite/
 2006-11-15  Tobias Burnus  [EMAIL PROTECTED]

   PR fortran/27546
   * gfortran.dg/import.f90: New test.
   * gfortran.dg/import2.f90: New test.
   * gfortran.dg/import3.f90: New test.


Added:
trunk/gcc/testsuite/gfortran.dg/import.f90
trunk/gcc/testsuite/gfortran.dg/import2.f90
trunk/gcc/testsuite/gfortran.dg/import3.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/gfortran.texi
trunk/gcc/fortran/match.h
trunk/gcc/fortran/parse.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug fortran/27546] [F2003] IMPORT not implemented

2006-11-15 Thread burnus at gcc dot gnu dot org


--- Comment #7 from burnus at gcc dot gnu dot org  2006-11-15 16:22 ---
Fixed in 4.3 == trunk.


-- 

burnus at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug fortran/27546] [F2003] IMPORT not implemented

2006-11-15 Thread burnus at gcc dot gnu dot org


--- Comment #8 from burnus at gcc dot gnu dot org  2006-11-15 16:44 ---
Reopened. I should have really read this bugreport and tested the example of
comment 0. My test cases worked, but this one does not:

internal compiler error: module symbol dp in wrong namespace

#4  0x00478002 in gfc_create_module_variable (sym=0x10) at
fortran/trans-decl.c:2761
#5  0x004587de in traverse_ns (st=0xda3080, func=0x477f00
gfc_create_module_variable)
at fortran/symbol.c:2603
#6  0x004587c6 in traverse_ns (st=0xda25e0, func=0x477f00
gfc_create_module_variable)
at fortran/symbol.c:2606
#7  0x004648de in gfc_generate_module_code (ns=0x4) at
fortran/trans.c:672


Using only IMPORT:
   real (kind=dp) :: x
 1
Error: Parameter 'dp' at (1) has not been declared or is a variable, which does
not reduce to a constant expression


-- 

burnus at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |


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



[Bug fortran/27546] [F2003] IMPORT not implemented

2006-11-15 Thread burnus at gcc dot gnu dot org


--- Comment #9 from burnus at gcc dot gnu dot org  2006-11-15 17:06 ---
For
   IMPORT
the error occures in expr.c's check_init_expr
case EXPR_VARIABLE:
  if (e-symtree-n.sym-attr.flavor == FL_PARAMETER)
{
  t = simplify_parameter_variable (e, 0);
  break;
}
  gfc_error (Parameter '%s' at %L has not been declared or is 

It should have actually matched FL_PARAMETER, but for some reasons it has not.


For
  IMPORT :: dp
it happens in trans-decl.c's gfc_create_module_variable:
  /* Only output symbols from this module.  */
  if (sym-ns != module_namespace)
{
  /* I don't think this should ever happen.  */
  internal_error (module symbol %s in wrong namespace, sym-name);
}

I don't see immediately how to fix this. If someone has a good spontaneous idea
... otherwise I try to understand how it should work.


-- 

burnus at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords||ice-on-valid-code


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



[Bug fortran/27546] [F2003] IMPORT not implemented

2006-11-15 Thread burnus at gcc dot gnu dot org


--- Comment #10 from burnus at gcc dot gnu dot org  2006-11-15 20:50 ---
For dp (= kind) I really need to find out where to modify this. Somehow this is
not properly recognized as constant expression.
(Tested by using no import and commenting the check in variable_decl. This is
essentially what happens with import.)

 * * *

Some more tests:
If one changes the module to a program or only puts the dp into a module,
but the interface into a program, import :: dp works. (import does not.)
If the interface is in a module (same or different one than dp), the ICE
occurs.

Import does not work at all for kind=...; it works, however, for
type(mytype), regardless whether it is in a module or not. import :: mytype
does not work in a module.


-- 

burnus at gcc dot gnu dot org changed:

   What|Removed |Added

   Severity|enhancement |normal


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



[Bug fortran/27546] [F2003] IMPORT not implemented

2006-11-08 Thread patchapp at dberlin dot org


--- Comment #5 from patchapp at dberlin dot org  2006-11-08 10:05 ---
Subject: Bug number PR27546

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-11/msg00466.html


-- 


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



[Bug fortran/27546] [F2003] IMPORT not implemented

2006-11-07 Thread burnus at gcc dot gnu dot org


--- Comment #2 from burnus at gcc dot gnu dot org  2006-11-07 16:36 ---
Syntax:
  IMPORT [[ :: ] import-name-list]

May only appear in the interface body, i.e.
  interface
 import
is wrong, but
  interface
subroutine foo
  import
is ok.
(It would be nice if one could give a good error message for the first case -
as for the case that one puts it outside an interface block.)

Current check is in decl.c:1216.

One needs to reject also
 interface
   type bar
   end type bar
   subroutine
  import bar
if bar does not exists in the host scoping unit.


-- 

burnus at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||burnus at gcc dot gnu dot
   ||org


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



[Bug fortran/27546] [F2003] IMPORT not implemented

2006-11-07 Thread pault at gcc dot gnu dot org


--- Comment #3 from pault at gcc dot gnu dot org  2006-11-07 21:40 ---
Have removed the rejects-valid keyword.

Paul


-- 

pault at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords|rejects-valid   |


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



[Bug fortran/27546] [F2003] IMPORT not implemented

2006-11-07 Thread burnus at gcc dot gnu dot org


--- Comment #4 from burnus at gcc dot gnu dot org  2006-11-07 22:01 ---
Accept. I have almost finished that patch :-)


-- 

burnus at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |burnus at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2006-05-12 04:32:12 |2006-11-07 22:01:15
   date||


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



[Bug fortran/27546] [F2003] IMPORT not implemented

2006-05-11 Thread pinskia at gcc dot gnu dot org


--- Comment #1 from pinskia at gcc dot gnu dot org  2006-05-12 04:32 ---
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2006-05-12 04:32:12
   date||


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