public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "drow at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/19828] [4.0 Regression] LIM is pulling out a pure function even though there is something which can modify global memory
Date: Wed, 09 Feb 2005 06:27:00 -0000	[thread overview]
Message-ID: <20050208192749.26140.qmail@sourceware.org> (raw)
In-Reply-To: <20050208190328.19828.pinskia@gcc.gnu.org>


------- Additional Comments From drow at gcc dot gnu dot org  2005-02-08 19:27 -------
Here's another related testcase.  If you uncomment the store to global_int,
LIM will move only func_const out of the loop.  With them both commented
out, however, the pure call gets moved out of the loop.  func_other may
modify global memory, though, so the pure call can not be moved.

int func_pure (void) __attribute__ ((pure));
int func_const (void) __attribute__ ((const));
void func_other (int);
int global_int;

int
func_loop (int arg)
{
  while (arg--)
    {
//      global_int = arg;
      func_other (func_pure ());
    }
}

int
func_loop_2 (int arg)
{
  while (arg--)
    {
//      global_int = arg;
      func_other (func_const ());
    }
}


-- 


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


  parent reply	other threads:[~2005-02-08 19:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-09  5:38 [Bug tree-optimization/19828] New: " pinskia at gcc dot gnu dot org
2005-02-09  5:54 ` [Bug tree-optimization/19828] " pinskia at gcc dot gnu dot org
2005-02-09  6:11 ` ian at airs dot com
2005-02-09  6:27 ` drow at gcc dot gnu dot org [this message]
2005-02-09  6:37 ` drow at gcc dot gnu dot org
2005-02-09  6:43 ` pinskia at gcc dot gnu dot org
2005-02-09 13:05 ` pinskia at gcc dot gnu dot org
2005-02-10 17:43 ` steven at gcc dot gnu dot org
2005-02-12 19:16 ` steven at gcc dot gnu dot org
2005-02-14  5:57 ` rakdver at gcc dot gnu dot org
2005-02-14  6:05 ` drow at gcc dot gnu dot org
2005-02-14  7:38 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
2005-02-14  8:18 ` drow at gcc dot gnu dot org
2005-02-14  8:52 ` ian at airs dot com
2005-02-14  9:12 ` joseph at codesourcery dot com
2005-02-18 21:16 ` jakub at gcc dot gnu dot org
2005-02-18 21:23 ` rakdver at gcc dot gnu dot org
2005-02-19 18:07 ` cvs-commit at gcc dot gnu dot org
2005-02-19 18:08 ` jakub at gcc dot gnu dot org
2005-02-20 22:57 ` pinskia 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=20050208192749.26140.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).