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 tree-optimization/52589] New: VRP missed optimization
Date: Wed, 14 Mar 2012 16:13:00 -0000	[thread overview]
Message-ID: <bug-52589-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             Bug #: 52589
           Summary: VRP missed optimization
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org


extern void link_error (void);

void
foo (unsigned int s)
{
  if (s + 0x70000000 < 0xf0000000U)
    {
      if (s >= 0x80000000U && s < 0x90000000U)
        link_error ();
    }
}

void
bar (unsigned int s)
{
  if (s + 0x70000000 >= 0xf0000000U)
    {
      if (s < 0x80000000U || s >= 0x90000000U)
        link_error ();
    }
}

In the above testcase, bar is optimized fine (VRP adds an ASSERT_EXPR with
range [0x80000000, 0x8fffffff] and optimizes away the test), but in foo it
isn't - the range there is ~[0x80000000, 0x8ffffffff] and we don't handle the
VR_ANTI_RANGE somewhere where we should.
I've noticed this while working on PR52267 - the vrp65.c testcase that I'm
bootstrapping there right now needs to have 4 tests commented out (well,
replaced by checks of a few selected values from the range which VRP optimizes
out properly).


             reply	other threads:[~2012-03-14 15:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-14 16:13 jakub at gcc dot gnu.org [this message]
2012-03-14 18:01 ` [Bug tree-optimization/52589] " jakub at gcc dot gnu.org
2012-03-15  9:27 ` pinskia at gcc dot gnu.org
2012-06-29 12:56 ` glisse at gcc dot gnu.org
2012-06-29 13:12 ` rguenth at gcc dot gnu.org
2012-06-29 13:18 ` rguenth 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-52589-4@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).