Bug 13278 - derived type namelist I/O support missing, causes ICE
Summary: derived type namelist I/O support missing, causes ICE
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: tree-ssa
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, patch
: 13771 (view as bug list)
Depends on:
Blocks: 15502
  Show dependency treegraph
 
Reported: 2003-12-03 08:48 UTC by Steven Bosscher
Modified: 2004-08-25 16:59 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-04-26 04:03:09


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Bosscher 2003-12-03 08:48:36 UTC
This causes an ICE: 
 
--------------------------- 
module foo 
  type coords 
     real :: x,y,z 
  end type coords 
  type (coords) point 
end module foo 
 
program bar 
use foo 
   namelist /nml/ point 
   read (5,nml=nml) 
end program bar 
--------------------------- 
 
t.f90: In function `MAIN__': 
 
t.f90:11: internal compiler error: Bad namelist IO basetype (7) 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Andrew Pinski 2003-12-05 23:15:26 UTC
Confirmed.
Comment 2 Andrew Pinski 2004-01-20 15:17:32 UTC
*** Bug 13771 has been marked as a duplicate of this bug. ***
Comment 3 Tobias Schlüter 2004-06-02 13:55:58 UTC
Added 'namelist' to the summary.
Comment 4 Andrew Pinski 2004-08-16 18:42:59 UTC
Just to make a note that this is what causes galgel to fail to build.

And here is the patch <http://gcc.gnu.org/ml/gcc-patches/2004-08/msg00993.html>.
Comment 5 GCC Commits 2004-08-18 01:20:09 UTC
Subject: Bug 13278

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pbrook@gcc.gnu.org	2004-08-18 01:20:06

Modified files:
	gcc/fortran    : ChangeLog trans-io.c 
	libgfortran    : ChangeLog 
	libgfortran/io : io.h transfer.c write.c 

Log message:
	2004-08-18  Victor Leikehman  <lei@il.ibm.com>
	
	PR fortran/13278
	* trans-io.c (transfer_namelist_element): New. Recursively handle
	derived-type variables.  Pass string lengths.
	(build_dt): Code moved to build_namelist, with some
	changes and additions.
	(gfc_build_io_library_fndecls): Declare the fifth
	argument in st_set_nml_var_char -- string_length.
	libgfortran/
	* io/transfer.c (st_set_nml_var)
	* io/write.c (namelist_write): Allow var_name and var_name_len to be
	null. For strings, use string_length field instead of len.
	* io/io.h (struct namelist_type): New field string_length.
	(st_set_nml_var_char): New argument string_length.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.152&r2=1.153
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-io.c.diff?cvsroot=gcc&r1=1.10&r2=1.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.61&r2=1.62
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/io.h.diff?cvsroot=gcc&r1=1.6&r2=1.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/transfer.c.diff?cvsroot=gcc&r1=1.8&r2=1.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/write.c.diff?cvsroot=gcc&r1=1.9&r2=1.10

Comment 6 Andrew Pinski 2004-08-18 02:22:32 UTC
Fixed.