public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/51502] [4.6/4.7 Regression] Potentially wrong code generation due to wrong implict_pure check
Date: Sun, 11 Dec 2011 21:01:00 -0000	[thread overview]
Message-ID: <bug-51502-4-0UJruOgzTz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-51502-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-12-11 20:56:54 UTC ---
The problem occurs in expr.c:


  if (!pointer && gfc_implicit_pure (NULL) && gfc_impure_variable (sym))
    gfc_current_ns->proc_name->attr.implicit_pure = 0;

assumes that gfc_current_ns points to the current procedure, which
is wrong in the case of blocks.

Maybe it would make sense to have a global gfc_proc_name?

Also, the logic in gfc_implicit_pure() appears to be wrong
because it does not look for parent namespaces.


  parent reply	other threads:[~2011-12-11 20:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-11 17:15 [Bug fortran/51502] New: [4.6/4.7 Regression] Potentially wrong code " burnus at gcc dot gnu.org
2011-12-11 17:43 ` [Bug fortran/51502] [4.6/4.7 Regression] Potentially wrong code generation " burnus at gcc dot gnu.org
2011-12-11 20:36 ` tkoenig at gcc dot gnu.org
2011-12-11 21:01 ` tkoenig at gcc dot gnu.org [this message]
2011-12-12  8:20 ` jakub at gcc dot gnu.org
2011-12-28 22:52 ` tkoenig at gcc dot gnu.org
2011-12-31  8:50 ` tkoenig at gcc dot gnu.org
2012-01-01 16:13 ` tkoenig at gcc dot gnu.org
2012-01-01 16:14 ` tkoenig at gcc dot gnu.org
2012-01-01 16:28 ` tkoenig 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-51502-4-0UJruOgzTz@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).