public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/64692] New: Incorrect result for sourced allocate of class(*) array
@ 2015-01-20 15:54 antony at cosmologist dot info
  2015-01-24 11:21 ` [Bug fortran/64692] " dominiq at lps dot ens.fr
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: antony at cosmologist dot info @ 2015-01-20 15:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64692

            Bug ID: 64692
           Summary: Incorrect result for sourced allocate of class(*)
                    array
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antony at cosmologist dot info

The following code gives incorrect output in trunk ('array 1' and 'array 2'
should be the same):

module Y
contains

    subroutine AddArray(P)
    class(*), target, intent(in) :: P(:)
    class(*), pointer :: Pt(:)

        allocate(Pt(1:SIZE(P)), source= P)

    select type (P)
    type is (double precision)
      print *,'array 1',P
    end select

    select type (Pt )
    type is (double precision)
      print *,'array 2',Pt
    end select

   end subroutine

end module Y

program test
use Y
double precision P(2,2)

P(1:2,1)=[1.d0,2.d0]
P(1:2,2) = [3.d0,4.d0]
call AddArray(P(1:2,2))

end program test


The select types are just there to show the output, they aren't needed for the
bug.


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

end of thread, other threads:[~2015-07-03  8:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-20 15:54 [Bug fortran/64692] New: Incorrect result for sourced allocate of class(*) array antony at cosmologist dot info
2015-01-24 11:21 ` [Bug fortran/64692] " dominiq at lps dot ens.fr
2015-01-24 11:52 ` antony at cosmologist dot info
2015-01-25 15:52 ` vehre at gcc dot gnu.org
2015-02-11 17:00 ` vehre at gcc dot gnu.org
2015-02-11 17:17 ` dominiq at lps dot ens.fr
2015-07-03  8:21 ` vehre at gcc dot gnu.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).