public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/28425]  New: Derived type initialization via a derived type is broken
@ 2006-07-18 18:48 kargl at gcc dot gnu dot org
  2006-07-18 18:52 ` [Bug fortran/28425] " kargl at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: kargl at gcc dot gnu dot org @ 2006-07-18 18:48 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-08-20 18:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-18 18:48 [Bug fortran/28425] New: Derived type initialization via a derived type is broken kargl at gcc dot gnu dot org
2006-07-18 18:52 ` [Bug fortran/28425] " kargl at gcc dot gnu dot org
2006-08-04 16:56 ` pault at gcc dot gnu dot org
2006-08-06 18:35 ` patchapp at dberlin dot org
2006-08-20  5:47 ` pault at gcc dot gnu dot org
2006-08-20  8:21 ` pault at gcc dot gnu dot org
2006-08-20 18:08 ` pault at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).