public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/64986] class_to_type_4.f90: valgrind error: Invalid read/write of size 8
Date: Mon, 16 Feb 2015 15:36:00 -0000	[thread overview]
Message-ID: <bug-64986-4-LKrP6b8r20@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64986-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Reduced test

program test
  implicit none
  type t
    integer :: ii
  end type t
  type, extends(t) :: u
    real :: rr
  end type u
  type, extends(t) :: v
    real, allocatable :: rr(:)
  end type v
  type, extends(v) :: w
    real, allocatable :: rrr(:)
  end type w

  type(v) :: b(3)

  b = func7() ! scalar daughter type to array - alloc comps in parent type

contains

  function func7() result(res)
    class(v), allocatable :: res
    allocate (res, source = w(3,[10.0,20.0],[100,200]))
  end function func7

end program test

There is no problem with the original test once the following lines are
commented

  b = func7() ! scalar daughter type to array - alloc comps in parent type
  if (any (b(2)%rr .ne. [10.0,20.0])) call abort


  parent reply	other threads:[~2015-02-16 15:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 18:29 [Bug fortran/64986] New: " ubizjak at gmail dot com
2015-02-09 18:31 ` [Bug fortran/64986] " ubizjak at gmail dot com
2015-02-13 10:37 ` dominiq at lps dot ens.fr
2015-02-13 15:33 ` paul.richard.thomas at gmail dot com
2015-02-16 15:36 ` dominiq at lps dot ens.fr [this message]
2015-04-03  0:10 ` hp at gcc dot gnu.org
2015-04-03 10:01 ` dominiq at lps dot ens.fr
2015-04-03 12:23 ` dominiq at lps dot ens.fr
2015-04-16  5:06 ` hp at gcc dot gnu.org
2015-07-18 13:24 ` mikael at gcc dot gnu.org
2015-07-21 10:02 ` dominiq at lps dot ens.fr
2015-07-22 16:24 ` mikael at gcc dot gnu.org
2015-07-23  7:04 ` paul.richard.thomas at gmail dot com
2015-07-24 13:55 ` mikael at gcc dot gnu.org
2015-07-24 14:45 ` mikael at gcc dot gnu.org
2015-07-24 19:47 ` mikael at gcc dot gnu.org
2015-07-25 19:20 ` mikael at gcc dot gnu.org
2015-07-25 19:23 ` mikael at gcc dot gnu.org

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-64986-4-LKrP6b8r20@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).