public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/51218] [4.7 Regression] Potential optimization bug due to implicit_pure?
Date: Mon, 21 Nov 2011 21:08:00 -0000	[thread overview]
Message-ID: <bug-51218-4-AxWan2lp4V@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-51218-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #18 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2011-11-21 20:21:01 UTC ---
On Mon, Nov 21, 2011 at 08:02:20PM +0000, burnus at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51218
> 
> --- Comment #17 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-21 20:02:20 UTC ---
> (In reply to comment #16)
> > One thing it relies on is that the compiler recognizes
> > that the bad function are not pure, as they have a
> > side effect (e.g. accessing module variable call_level).
> > If a side effect is able to disable critical optimizations,
> > then I'm optimistic that the code will work on most platforms.
> > 
> > Now as promised, here's the reduced example:
> 
> Thanks for the example!
> 
> Untested patch:
> 
> --- a/gcc/fortran/resolve.c
> +++ b/gcc/fortran/resolve.c
> @@ -3257,6 +3255,7 @@ pure_subroutine (gfc_code *c, gfc_symbol *sym)
>    else if (gfc_pure (NULL))
>      gfc_error ("Subroutine call to '%s' at %L is not PURE", sym->name,
>                &c->loc);
> +  gfc_current_ns->proc_name->attr.implicit_pure = 0;
>  }

Harald's example has function calls not subroutines.  I would
expect that you need to set this in pure_function as well.

Also, does this type of change inhibit reason why 
implicit_pure was added in the first place?


  parent reply	other threads:[~2011-11-21 20:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18 23:14 [Bug fortran/51218] New: [4.7 Regression] Potential optimization bug anlauf at gmx dot de
2011-11-18 23:24 ` [Bug fortran/51218] " anlauf at gmx dot de
2011-11-19  0:05 ` dominiq at lps dot ens.fr
2011-11-19  0:41 ` dominiq at lps dot ens.fr
2011-11-19  2:06 ` kargl at gcc dot gnu.org
2011-11-19  5:39 ` sgk at troutmask dot apl.washington.edu
2011-11-19  9:28 ` anlauf at gmx dot de
2011-11-19  9:29 ` tkoenig at gcc dot gnu.org
2011-11-19 10:35 ` [Bug fortran/51218] [4.7 Regression] Potential optimization bug due to implicit_pure? anlauf at gmx dot de
2011-11-19 10:58 ` burnus at gcc dot gnu.org
2011-11-19 11:31 ` anlauf at gmx dot de
2011-11-19 11:44 ` tkoenig at netcologne dot de
2011-11-19 12:11 ` anlauf at gmx dot de
2011-11-19 16:34 ` sgk at troutmask dot apl.washington.edu
2011-11-19 16:48 ` sgk at troutmask dot apl.washington.edu
2011-11-19 17:44 ` kargl at gcc dot gnu.org
2011-11-21  9:05 ` burnus at gcc dot gnu.org
2011-11-21 19:48 ` anlauf at gmx dot de
2011-11-21 20:40 ` burnus at gcc dot gnu.org
2011-11-21 21:08 ` sgk at troutmask dot apl.washington.edu [this message]
2011-11-21 21:25 ` [Bug fortran/51218] [4.6/4.7 " burnus at gcc dot gnu.org
2011-11-22 23:11 ` anlauf at gmx dot de
2011-11-24 18:31 ` burnus at gcc dot gnu.org
2011-11-24 21:54 ` burnus at gcc dot gnu.org
2011-11-24 21:57 ` burnus at gcc dot gnu.org
2011-11-25 17:42 ` tkoenig at netcologne dot de
2011-11-25 18:49 ` burnus at gcc dot gnu.org
2011-11-26 12:15 ` tkoenig at netcologne dot de

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-51218-4-AxWan2lp4V@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).