public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pault at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/57117] [OOP] ICE for sourced allocation of a polymorphic entity using TRANSPOSE
Date: Wed, 28 Oct 2015 14:58:00 -0000	[thread overview]
Message-ID: <bug-57117-4-v3BVVYNmjn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57117-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 36609
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36609&action=edit
Draft patch for the PR

The two TODOs should be noted. These must be fixed before submission. However,
this patch does regtest without regressions.

The following version of the testcase runs correctly.

Cheers

Paul

  implicit none
  integer :: j, k
  type :: ti
   real(8) :: r
  end type
  type, extends (ti) :: ri
    integer :: i
  end type
  class(ti), allocatable :: x(:,:), z(:)

  allocate (z, source = [(ti (real (j)), j = 1, 9)])
  allocate(x(3,3), source=reshape(z, (/ 3,3 /)))
  call foo
  deallocate (z, x)

  allocate (z, source = [(ri (real (j), j), j = 1, 9)])
  allocate(x(3,3), source=reshape(z, (/ 3,3 /)))
  call foo
  deallocate (z, x)

contains
  subroutine foo
    select type (x)
      type is (ti)
        print *, "ti"
        print *, x%r
      type is (ri)
        print *, "ri"
        print *, x%r
        print *, x%i
      class default
        call abort
    end select
  end subroutine
end


  parent reply	other threads:[~2015-10-28 14:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-29 19:59 [Bug fortran/57117] New: ICE for sourced allocation of a UP entity that uses the transpose intrinsic Bader at lrz dot de
2013-04-29 21:34 ` [Bug fortran/57117] " dominiq at lps dot ens.fr
2013-04-30 12:22 ` [Bug fortran/57117] [OOP] ICE for sourced allocation of a polymorphic entity using TRANSPOSE janus at gcc dot gnu.org
2015-10-25 15:54 ` pault at gcc dot gnu.org
2015-10-28 14:58 ` pault at gcc dot gnu.org [this message]
2015-10-28 17:24 ` dominiq at lps dot ens.fr
2015-10-29 12:33 ` dominiq at lps dot ens.fr
2015-10-29 19:02 ` pault at gcc dot gnu.org
2015-10-30  8:38 ` dominiq at lps dot ens.fr
2015-10-30  9:29 ` paul.richard.thomas at gmail dot com
2015-10-30  9:39 ` dominiq at lps dot ens.fr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-57117-4-v3BVVYNmjn@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).