public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/49419] [4.6/4.7 regression] gcc -O2 miscompiles gp2c
Date: Wed, 15 Jun 2011 12:19:00 -0000	[thread overview]
Message-ID: <bug-49419-4-EpSsOVh12N@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49419-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-06-15 12:19:00 UTC ---
So, i_47 which is the i value on entry of the second loop is determined to be
[0, +INF(OVF)] and something goes wrong afterwards.  The bug will be there, but
I should note that VRP should easily prove that i never overflows.
Simpler testcases for that:
void bar (void);

void foo (int x, int y)
{
  if (x < y)
    {
      if (x == __INT_MAX__)
        bar ();
    }
}

void baz (int x, int y, int z)
{
  if (x < y || x < z)
    {
      if (x == __INT_MAX__)
        bar ();
    }
}

Here IMNSHO vrp should optimize the call to bar away, as when x is smaller than
some variable of the same type, it can't be the maximum of that type, because
even if the other number is __INT_MAX__, x must be smaller than that.


  parent reply	other threads:[~2011-06-15 12:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-15 11:11 [Bug target/49419] New: " doko at ubuntu dot com
2011-06-15 11:41 ` [Bug target/49419] " rguenth at gcc dot gnu.org
2011-06-15 11:55 ` mikpe at it dot uu.se
2011-06-15 11:56 ` jakub at gcc dot gnu.org
2011-06-15 12:19 ` jakub at gcc dot gnu.org [this message]
2011-06-15 12:30 ` jakub at gcc dot gnu.org
2011-06-15 15:00 ` jakub at gcc dot gnu.org
2011-06-15 16:04 ` [Bug tree-optimization/49419] " jakub at gcc dot gnu.org
2011-06-16  7:46 ` jakub at gcc dot gnu.org
2011-06-16  7:55 ` jakub at gcc dot gnu.org
2011-06-16  8:19 ` jakub at gcc dot gnu.org
2011-06-16 18:19 ` jakub at gcc dot gnu.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=bug-49419-4-EpSsOVh12N@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).