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 tree-optimization/34244] [4.3 Regression] VRP/SCEV miscompiles Firefox
Date: Tue, 27 Nov 2007 17:00:00 -0000	[thread overview]
Message-ID: <20071127170047.1424.qmail@sourceware.org> (raw)
In-Reply-To: <bug-34244-10053@http.gcc.gnu.org/bugzilla/>



------- Comment #5 from rakdver at gcc dot gnu dot org  2007-11-27 17:00 -------
> # of iteration analysis records an assumption that offset_46 >= 0.  However,
> this is simplified to true, as the value range of offset_46 is set to [0,0] by
> vrp (which seems to be wrong); so the problem is probably somewhere else in
> vrp.

So the problem is the following:  we have a code like

if (something)
  offset = 100;
else
  offset = -100;

while (offset > 0)
  offset--;

if (offset == 0)
  launch_nuclear_rockets ();

VRP starts simulating the code, first executing the true branch of the if
(something) condition, getting offset = 100.  It then proceeds with the loop,
determining that number of iterations is offset (since we just now believe that
offset==100, this is correct, without any assumptions), thus the final value of
offset is 0 and the nuclear war always starts.

Later, VRP evaluates the false branch of the if (something) condition, setting
the value range of offset to [-100,100], and proceeds to re-evaluate the
effects of the loop.  However, scev caches the number of iterations of the
loop, so it is not re-evaluated, and we keep believing that the number of
iterations is always offset.


-- 


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


  parent reply	other threads:[~2007-11-27 17:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-27 11:12 [Bug tree-optimization/34244] New: " rguenth at gcc dot gnu dot org
2007-11-27 11:30 ` [Bug tree-optimization/34244] " rguenth at gcc dot gnu dot org
2007-11-27 12:04 ` pinskia at gcc dot gnu dot org
2007-11-27 13:57 ` rakdver at gcc dot gnu dot org
2007-11-27 14:04 ` rguenther at suse dot de
2007-11-27 16:48 ` rakdver at gcc dot gnu dot org
2007-11-27 17:00 ` rakdver at gcc dot gnu dot org [this message]
2007-11-27 22:21 ` mmitchel at gcc dot gnu dot org
2007-11-28 15:47 ` rguenth at gcc dot gnu dot org
2007-11-28 16:05 ` rakdver at kam dot mff dot cuni dot cz
2007-11-28 16:13 ` rguenther at suse dot de
2007-11-29  4:29 ` rakdver at gcc dot gnu dot org
2007-11-30  0:32 ` rakdver at gcc dot gnu dot org
2007-11-30  7:20 ` jakub at gcc dot gnu dot org
2007-11-30  8:56 ` hjl at lucon dot org
2007-11-30 13:24 ` jakub at gcc dot gnu dot org
2008-05-31 13:02 ` rguenth at gcc dot gnu dot org
2008-06-06 20:08 ` 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=20071127170047.1424.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).