public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bonzini at gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/30931] [4.1 Regression] Simple test case loops infinitely with -O1 -fstrength-reduce.
Date: Fri, 23 Feb 2007 14:30:00 -0000	[thread overview]
Message-ID: <20070223143033.31505.qmail@sourceware.org> (raw)
In-Reply-To: <bug-30931-11700@http.gcc.gnu.org/bugzilla/>



------- Comment #10 from bonzini at gnu dot org  2007-02-23 14:30 -------
No, i (which is in %edx) *is* being incremented.  It's the strength-reduced
derived induction variable that is constructed in a wrong way.  The optimized
code looks like:

void bug (struct s *p)
{
  int i;
  struct s *pp = p;
  for (i=0; i < 2; i++)
    {
      goto loop_cond;

     loop:
      /* ??? I think gcc assumes that pp (%eax) is an induction variable of
         the inner loop... */
      pp[-1].first = 0;
     loop_cond:
      if (!pp[0].first)
        goto break_out_of_inner_loop;
      if (pp[0].done)
        goto loop;

     break_out_of_inner_loop;
      pp++; /* actually adds sizeof (struct s) in the asm code */
      i++;
    }
}


-- 


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


  parent reply	other threads:[~2007-02-23 14:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-22 22:39 [Bug rtl-optimization/30931] New: " bergner at gcc dot gnu dot org
2007-02-22 22:40 ` [Bug rtl-optimization/30931] " bergner at gcc dot gnu dot org
2007-02-22 23:27 ` steven at gcc dot gnu dot org
2007-02-22 23:29 ` pinskia at gcc dot gnu dot org
2007-02-22 23:32 ` bergner at gcc dot gnu dot org
2007-02-23 10:03 ` rguenth at gcc dot gnu dot org
2007-02-23 14:06 ` bergner at gcc dot gnu dot org
2007-02-23 14:13 ` [Bug rtl-optimization/30931] [4.1 Regression] " rguenth at gcc dot gnu dot org
2007-02-23 14:17 ` bergner at gcc dot gnu dot org
2007-02-23 14:17 ` bergner at gcc dot gnu dot org
2007-02-23 14:30 ` bonzini at gnu dot org [this message]
2007-02-23 14:32 ` bonzini at gnu dot org
2007-02-26 19:18 ` ebotcazou at gcc dot gnu dot org
2007-02-27 20:21 ` [Bug rtl-optimization/30931] [4.1 regression] infinite loop " ebotcazou at gcc dot gnu dot org
2007-02-27 20:23 ` ebotcazou 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=20070223143033.31505.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).