public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "george at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/35892] gfortran lost memory blocks
Date: Thu, 24 Apr 2008 08:30:00 -0000	[thread overview]
Message-ID: <20080424082941.23244.qmail@sourceware.org> (raw)
In-Reply-To: <bug-35892-14459@http.gcc.gnu.org/bugzilla/>



------- Comment #18 from george at gcc dot gnu dot org  2008-04-24 08:29 -------
I've investigated the PR code further.  The relevant parts of the code are
structured like so:

module mod
  integer aa, bb
  common /oof/ aa,bb
contains
  subroutine sub
  i = max(0,aa-1)
  print *, i, aa, bb
  end subroutine sub

  subroutine subb
  common /oof/ ic,id
  print *, ic, id
  end subroutine subb
end module

program test
  use mod
  common /oof/ ii,jj

  ii = 42
  jj = ii / 2
  print *, ii, jj
  call sub
  call subb
end program test

(A main program isn't in the PR, but I added one for debugging.)  The COMMON
appears both in the module scope, and in the local scope of one of the
procedures in the module.  When the storage layout is made for the COMMON at
module scope, the decls get thrown away too early if they are chained to the
(non-existent) procedure scope; further references to those identifiers in
procedure sub are in peril.  Chaining the decls to the global scope for
module-scope COMMON seems to be appropriate here and fixes the segfault for the
PR code.

I will rework the patch to include this case.  There is still the outstanding
problem of lost memory blocks unrelated to the original patch.   Any further
progress on that?


-- 


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


  parent reply	other threads:[~2008-04-24  8:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-09 17:24 [Bug fortran/35892] New: gfortran dies on file containing module and common KnowlesPJ at Cardiff dot ac dot uk
2008-04-09 17:25 ` [Bug fortran/35892] " KnowlesPJ at Cardiff dot ac dot uk
2008-04-09 18:32 ` [Bug fortran/35892] [4.4 regression] " burnus at gcc dot gnu dot org
2008-04-13 20:46 ` tkoenig at gcc dot gnu dot org
2008-04-18 14:42 ` jvdelisle at gcc dot gnu dot org
2008-04-18 15:10 ` jvdelisle at gcc dot gnu dot org
2008-04-18 16:24 ` jvdelisle at gcc dot gnu dot org
2008-04-18 17:13 ` kargl at gcc dot gnu dot org
2008-04-18 17:45 ` jvdelisle at gcc dot gnu dot org
2008-04-18 19:49 ` kargl at gcc dot gnu dot org
2008-04-18 21:28 ` jvdelisle at gcc dot gnu dot org
2008-04-18 21:32 ` jvdelisle at gcc dot gnu dot org
2008-04-19  0:08 ` kargl at gcc dot gnu dot org
2008-04-19  6:44 ` jvdelisle at gcc dot gnu dot org
2008-04-19  6:51 ` jvdelisle at gcc dot gnu dot org
2008-04-19  6:53 ` jvdelisle at gcc dot gnu dot org
2008-04-19 12:09 ` george at gcc dot gnu dot org
2008-04-19 21:12 ` [Bug fortran/35892] gfortran lost memory blocks jvdelisle at gcc dot gnu dot org
2008-04-24  8:30 ` george at gcc dot gnu dot org [this message]
2008-04-24  9:35 ` KnowlesPJ at Cardiff dot ac dot uk
2008-04-24 19:05 ` jvdelisle at gcc dot gnu dot org
2008-04-24 19:11 ` jvdelisle at gcc dot gnu dot org
2008-04-25  8:10 ` KnowlesPJ at Cardiff dot ac dot uk
2008-04-26  9:47 ` george at gcc dot gnu dot org
2008-04-26 10:19 ` george at gcc dot gnu dot org
2008-04-27  1:09 ` jvdelisle at gcc dot gnu dot 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=20080424082941.23244.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: 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).