public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zsojka at seznam dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/47061] New: VRP doesn't propagate through x<<=1, but it does for x*=2
Date: Fri, 24 Dec 2010 15:28:00 -0000	[thread overview]
Message-ID: <bug-47061-4@http.gcc.gnu.org/bugzilla/> (raw)

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

           Summary: VRP doesn't propagate through x<<=1, but it does for
                    x*=2
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz


Created attachment 22850
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22850
testcase

The attached testcase should be optimised to "return 0;", as it is when
x <<= 1;
is replaced by
x *= 2;

$ gcc -O3 pr47061.c -fdump-tree-vrp -S -masm=intel
shows in the .vrp1/2 dumps (among others):

x_1: [-10, -9]
x_2: [-10, -8]
x_3: [-10, -7]
x_4: [-10, -6]
x_11: [-9, -8]
x_14: [-9, -7]
x_17: [-9, -6]
x_18: VARYING

...

<bb 10>:
  # x_4 = PHI <x_3(8), x_17(9)>
  x_18 = x_4 << 2;

Neither gcc version I tested works (3.3.6-4.6.0)


             reply	other threads:[~2010-12-24 15:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-24 15:28 zsojka at seznam dot cz [this message]
2010-12-24 15:54 ` [Bug tree-optimization/47061] " zsojka at seznam dot cz
2010-12-24 19:25 ` zsojka at seznam dot cz
2010-12-28 15:04 ` rguenth at gcc dot gnu.org
2012-06-29 14:25 ` rguenth at gcc dot gnu.org
2012-06-29 14:27 ` 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-47061-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).