------- Comment #9 from burnus at gcc dot gnu dot org  2010-02-25 23:38 -------
Reduced test case below. The problem is the call. On the trunk the call looks
as follows:
  set_set_v (&ru, D.1578);
which is complete nonesense. It should be:
  &ru.data[0].c.use
or something like that. If one removes the "comment" component, it works - but
only because then "&ru" and "&ru.data[0].c.use" point to the same memory -
otherwise it is as wrong as before.

! ------------------------
module mo_obs_rules
  type t_set
     integer :: use = 42
  end type t_set
  type t_rules
     character(len=40) :: comment
     type(t_set)       :: c (1)
  end type t_rules
  type (t_rules), save :: ru (1)
contains
  subroutine get_rule (c)
    type(t_set) :: c (:)
!    print *, ru(1)%c(1)%use ! 42 -> OK
!    print *,       c(1)%use ! 42 -> OK
    call set_set_v (ru(1)%c, c)
  contains
    subroutine set_set_v (src, dst)
      type(t_set), intent(in)    :: src(1)
      type(t_set), intent(inout) :: dst(1)
!      print *, src(1)%use ! garbage (should be 42)
!      print *, dst(1)%use ! 42 -> OK
    end subroutine set_set_v
  end subroutine get_rule
end module mo_obs_rules

program test
  use mo_obs_rules
  type(t_set) :: c (1)
  call get_rule (c)
end program test


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2010-02-25 21:42:55         |2010-02-25 23:38:17
               date|                            |


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

Reply via email to