This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/28425] New: Derived type initialization via a derived type is broken
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jul 2006 18:48:14 -0000
- Subject: [Bug fortran/28425] New: Derived type initialization via a derived type is broken
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
It appears that the initialization of a derived type that includes
a derived type is broken. Consider the following code.
!
! Original version sent by Vivek Rao on 18 Jan 06
! Modified by Steve Kargl to remove IO
!
module foo_mod
implicit none
type :: date_m
integer :: month
end type date_m
type :: file_info
type(date_m) :: date
end type file_info
end module foo_mod
program prog
use foo_mod
implicit none
type(date_m) :: dat
type(file_info) :: xx
dat = date_m(1)
xx = file_info(dat)
if (xx%date%month /= 1) call abort
end program prog
the original tree looks like
MAIN__ ()
{
struct date_m dat;
struct file_info xx;
_gfortran_set_std (70, 127, 0);
{
struct date_m date_m.0;
date_m.0.month = 1;
dat = date_m.0;
}
{
struct file_info file_info.1;
xx = file_info.1;
}
if (xx.date.month != 1)
{
_gfortran_abort ();
}
else
{
(void) 0;
}
}
--
Summary: Derived type initialization via a derived type is broken
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kargl at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28425