public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/41478] Corrupted memory using PACK for derived-types with allocated components Date: Fri, 04 Dec 2009 20:34:00 -0000 [thread overview] Message-ID: <20091204203347.3507.qmail@sourceware.org> (raw) In-Reply-To: <bug-41478-15192@http.gcc.gnu.org/bugzilla/> ------- Comment #14 from tkoenig at gcc dot gnu dot org 2009-12-04 20:33 ------- The problem is with the allocatable components for intrinsics, at least. This has the same problem: program main type :: container_t integer, dimension(:), allocatable :: entry end type container_t type(container_t), dimension(2) :: a1, a2 integer :: i do i = 1, 2 allocate (a1(i)%entry (1), a2(i)%entry (1)) a1(i)%entry = 1 a2(i)%entry = 0 end do a1 = eoshift(a2, 1) end program main What we must do is to deallocate anything on the left hand side of the assignment, so instead of using a1 = eoshift(a2,1) we shoud loop over a1, deallocate everything, and then do the assignment. This looks like heavy front-end work, is anybody up for this? :-) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41478
next prev parent reply other threads:[~2009-12-04 20:34 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-09-26 20:05 [Bug fortran/41478] New: function "pack" causes double free violation reuter at physik dot uni-freiburg dot de 2009-09-26 20:06 ` [Bug fortran/41478] " reuter at physik dot uni-freiburg dot de 2009-09-26 21:16 ` kargl at gcc dot gnu dot org 2009-09-27 0:39 ` jvdelisle at gcc dot gnu dot org 2009-09-27 9:59 ` dominiq at lps dot ens dot fr 2009-09-27 10:36 ` rguenth at gcc dot gnu dot org 2009-09-27 11:45 ` dominiq at lps dot ens dot fr 2009-09-27 13:12 ` rguenth at gcc dot gnu dot org 2009-10-01 21:22 ` [Bug fortran/41478] Corrupted memory using PACK for derived-types with allocated components burnus at gcc dot gnu dot org 2009-10-20 19:56 ` janus at gcc dot gnu dot org 2009-10-20 20:06 ` janus at gcc dot gnu dot org 2009-10-20 20:15 ` janus at gcc dot gnu dot org 2009-10-20 20:54 ` janus at gcc dot gnu dot org 2009-10-21 3:04 ` jvdelisle at gcc dot gnu dot org 2009-12-04 20:34 ` tkoenig at gcc dot gnu dot org [this message] 2009-12-04 20:37 ` tkoenig at gcc dot gnu dot org 2009-12-04 21:04 ` tkoenig at gcc dot gnu dot org 2009-12-06 22:57 ` janus at gcc dot gnu dot org 2009-12-13 21:51 ` janus at gcc dot gnu dot org 2010-01-11 6:14 ` pault at gcc dot gnu dot org 2010-01-11 12:30 ` dominiq at lps dot ens dot fr 2010-01-11 12:51 ` pault at gcc dot gnu dot org 2010-01-11 13:06 ` burnus at gcc dot gnu dot org 2010-01-11 13:50 ` dominiq at lps dot ens dot fr 2010-01-11 14:04 ` dominiq at lps dot ens dot fr 2010-01-11 17:51 ` dominiq at lps dot ens dot fr 2010-01-11 18:23 ` pault at gcc dot gnu dot org 2010-01-14 6:18 ` pault at gcc dot gnu dot org 2010-01-14 6:20 ` pault at gcc dot gnu dot org 2010-02-07 3:55 ` hjl dot tools at gmail dot com
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=20091204203347.3507.qmail@sourceware.org \ --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: linkBe 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).