public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rakdver at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug regression/40886] [4.3/4.4/4.5 Regression] No loop counter reversal for simple loops anymore
Date: Fri, 07 Aug 2009 08:44:00 -0000	[thread overview]
Message-ID: <20090807084421.12135.qmail@sourceware.org> (raw)
In-Reply-To: <bug-40886-7834@http.gcc.gnu.org/bugzilla/>



------- Comment #3 from rakdver at gcc dot gnu dot org  2009-08-07 08:44 -------
(In reply to comment #1)
> The tree optimizers canonicalize the loop to
> 
> <bb 3>:
>   # i_5 = PHI <i_3(4), 0(2)>
>   # ivtmp.23_1 = PHI <ivtmp.23_4(4), 10(2)>
>   f2 ();
>   i_3 = i_5 + 1;
>   ivtmp.23_4 = ivtmp.23_1 - 1;
>   if (ivtmp.23_4 != 0)
>     goto <bb 4>;
>   else
>     goto <bb 5>;
> 
> <bb 4>:
>   goto <bb 3>;
> 
> But then IVOPTs chooses i as the induction variable again.

This is what I would expect it to do (I am somewhat surprised that 3.3 did
something else).  Ivopts at the moment do not know that comparing with 0 is
more efficient than comparing with any other expression.  In all other aspects,
i and ivtmp.23 have the same cost, so ivopts prefers to preserve the original
induction variable.

Altering determine_use_iv_cost_condition to take the cost of the comparison
into account should fix this.


-- 


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


  parent reply	other threads:[~2009-08-07  8:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-27 21:40 [Bug regression/40886] New: " andi-gcc at firstfloor dot org
2009-07-28 11:09 ` [Bug regression/40886] [4.3/4.4/4.5 Regression] " rguenth at gcc dot gnu dot org
2009-08-04 12:49 ` rguenth at gcc dot gnu dot org
2009-08-07  8:44 ` rakdver at gcc dot gnu dot org [this message]
2009-08-07  8:50 ` andi-gcc at firstfloor dot org
2009-08-07  8:54 ` rakdver at kam dot mff dot cuni dot cz
2009-08-07  9:39 ` andi-gcc at firstfloor dot org
2009-08-07  9:47 ` steven at gcc dot gnu dot org
2009-08-07  9:52 ` andi-gcc at firstfloor dot org
2009-08-16 21:42 ` rguenth at gcc dot gnu dot org
2010-02-09  4:57 ` spop at gcc dot gnu dot org
2010-02-09  6:00 ` spop at gcc dot gnu dot org
2010-02-09  8:30 ` rakdver at kam dot mff dot cuni dot cz
2010-02-09 17:17 ` spop at gcc dot gnu dot org
2010-02-11 15:46 ` spop at gcc dot gnu dot org
2010-02-11 15:47 ` [Bug regression/40886] [4.3/4.4 " spop at gcc dot gnu dot org
2010-05-22 18:33 ` rguenth at gcc dot gnu dot org
2010-06-09 11:21 ` andi-gcc at firstfloor dot org
2010-06-09 11:57 ` rguenth 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=20090807084421.12135.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).