public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/67121] [6 Regression] wrong code at -O3 on x86_64-linux-gnu
Date: Wed, 05 Aug 2015 10:43:00 -0000	[thread overview]
Message-ID: <bug-67121-4-LK31m8rZ5H@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-67121-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67121

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm.

Visiting statement:
h_38 = (char) pretmp_48;
Found new range for h_38: VARYING

...

Visiting statement:
_42 = (int) h_38;
Intersecting
  [-128, 127]
and
  [0, 127]
to
  [0, 127]
Found new range for _42: [0, 127]

so it seems that the old value-range for _42 is bad:

  # RANGE [0, 127] NONZERO 127
  _42 = (int) h_38;

Before if-conversion we have

  <bb 2>:
  a[0] = 1;
  f = 0;
  pretmp_48 = c;

  <bb 3>:
  # f.4_36 = PHI <0(2), _19(6)>
  # ivtmp_59 = PHI <9(2), ivtmp_28(6)>
  h_9 = (char) pretmp_48;
  if (h_9 >= 0)
    goto <bb 4>;
  else
    goto <bb 10>;

  <bb 4>:
  # RANGE [0, 127] NONZERO 127
  _10 = (int) h_9;

while after:

  <bb 2>:
  a[0] = 1;
  f = 0;
  pretmp_48 = c;

  <bb 3>:
  # f.4_36 = PHI <0(2), _19(4)>
  # ivtmp_59 = PHI <9(2), ivtmp_28(4)>
  h_9 = (char) pretmp_48;
  # RANGE [0, 127] NONZERO 127
  _10 = (int) h_9;
...
  prephitmp_3 = h_9 >= 0 ? _14 : _38;

so if-conversion has to reset value-range info on stmts previously
conditionally
executed.


  parent reply	other threads:[~2015-08-05 10:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05  7:49 [Bug tree-optimization/67121] New: " su at cs dot ucdavis.edu
2015-08-05  9:12 ` [Bug tree-optimization/67121] [6 Regression] " mpolacek at gcc dot gnu.org
2015-08-05 10:43 ` rguenth at gcc dot gnu.org [this message]
2015-08-05 13:06 ` mpolacek at gcc dot gnu.org
2015-08-05 14:17 ` rguenth at gcc dot gnu.org
2015-08-05 14:18 ` [Bug tree-optimization/67121] [5 " rguenth at gcc dot gnu.org
2015-08-05 14:18 ` [Bug tree-optimization/67121] [6 " rguenth at gcc dot gnu.org
2015-09-21  9:56 ` [Bug tree-optimization/67121] [5 " rguenth at gcc dot gnu.org
2015-09-21  9:58 ` 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-67121-4-LK31m8rZ5H@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).