public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/31522] [4.3 Regression] False overflow warning with division phi nodes
Date: Tue, 10 Apr 2007 07:57:00 -0000	[thread overview]
Message-ID: <20070410075648.16005.qmail@sourceware.org> (raw)
In-Reply-To: <bug-31522-6528@http.gcc.gnu.org/bugzilla/>



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-04-10 08:56 -------
IR after assert insertion (plus annotate with ranges found):
f (x)
{
  int y;
  int D.1599;

<bb 2>:
  if (x_2(D) <= 4) goto <L2>; else goto <L1>;

<L1>:;
  x_7 = ASSERT_EXPR <x_2(D), x_2(D) > 4>; // x_7: [5, +INF] 
  y_4 = x_7 / 4; // y_4: [1, 536870911]

  # y_1 = PHI <1(2), y_4(3)> // y_1: [1, +INF(OVF)]
<L2>:;
  D.1599_5 = y_1 <= 0;
  return D.1599_5;

}


Can someone explain how we go from the union of [1,1] and [1, 536870911]  to
get an inf with an overflow?

Here is another example but this time without a division and just plain obvious
no overflow as everything are just compares:
int f(int x)
{
  int y;
  if (x>536870911) y =1;
  else {
  if (x<0)  x = 1;
  y = x <=  0;
  }
  return y > 2;
}


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |blocker
            Summary|[4.3 Regression] False      |[4.3 Regression] False
                   |overflow warning with       |overflow warning with
                   |division                    |division phi nodes


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


  parent reply	other threads:[~2007-04-10  7:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-10  7:28 [Bug tree-optimization/31522] New: [4.3 Regression] False overflow warning with division pinskia at gcc dot gnu dot org
2007-04-10  7:28 ` [Bug tree-optimization/31522] " pinskia at gcc dot gnu dot org
2007-04-10  7:30 ` pinskia at gcc dot gnu dot org
2007-04-10  7:57 ` pinskia at gcc dot gnu dot org [this message]
2007-04-10 12:39 ` [Bug tree-optimization/31522] [4.3 Regression] False overflow warning with phi nodes rguenth at gcc dot gnu dot org
2007-04-11  5:34 ` [Bug tree-optimization/31522] " pinskia at gcc dot gnu dot org
2007-04-11  6:15 ` ian at airs dot com
2007-04-11  6:38 ` pinskia at gcc dot gnu dot org
2007-04-11  7:04 ` ian at airs dot com
2007-04-11  8:14 ` rguenth at gcc dot gnu dot org
2007-04-17  5:33 ` ian at gcc dot gnu dot org
2007-04-17 18:09 ` ian at airs dot com

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=20070410075648.16005.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).