public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Yuri Gribov <tetra2005@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Richard Biener <rguenther@suse.de>, trippels@gcc.gnu.org
Subject: [PATCH][PR 81089][PING] Fix -O3 bootstrap
Date: Thu, 15 Jun 2017 17:34:00 -0000	[thread overview]
Message-ID: <CAJOtW+53nwLgSb1QFSAq4jW1t+VZdB_=8fJH8ibhYuEamSz_dQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 436 bytes --]

On Thu, Jun 15, 2017 at 6:08 AM, Yuri Gribov <tetra2005@gmail.com> wrote:
> Hi all,
>
> This patch fixes regression at bootstrap-O3.
>
> Local x64 bootstrap-O3 has completed w/o errors. I didn't run regtests
> (I think it's not needed, given that new code can now run in fewer
> cases than before).
>
> Ok to commit? (if yes - could someone commit for me?)

Sorry for early reminder but this fixes bootstrap-O3 so is probly urgent.

-Y

[-- Attachment #2: pr-81089-1.patch --]
[-- Type: application/octet-stream, Size: 1322 bytes --]

From df879ff1cc8e2a9667871ec445adf3994ed6ebbe Mon Sep 17 00:00:00 2001
From: Yury Gribov <tetra2005@gmail.com>
Date: Wed, 14 Jun 2017 11:53:29 +0100
Subject: [PATCH] 2017-06-14  Yury Gribov  <tetra2005@gmail.com>

gcc/
	PR tree-optimization/81089
	* tree-vrp.c (is_masked_range_test): Validate operands of
	subexpression.
---
 gcc/tree-vrp.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index a7424a3..9ca3924 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -5651,8 +5651,9 @@ is_masked_range_test (tree name, tree valt, enum tree_code cond_code,
       || gimple_assign_rhs_code (def_stmt) != BIT_AND_EXPR)
     return false;
 
+  tree t = gimple_assign_rhs1 (def_stmt);
   tree maskt = gimple_assign_rhs2 (def_stmt);
-  if (TREE_CODE (maskt) != INTEGER_CST)
+  if (TREE_CODE (t) != SSA_NAME || TREE_CODE (maskt) != INTEGER_CST)
     return false;
 
   wide_int mask = maskt;
@@ -5663,11 +5664,9 @@ is_masked_range_test (tree name, tree valt, enum tree_code cond_code,
       || (val & mask) != val)
     return false;
 
-  tree t = gimple_assign_rhs1 (def_stmt);
-  tree type = TREE_TYPE (t);
-
   bool is_range = cond_code == EQ_EXPR;
 
+  tree type = TREE_TYPE (t);
   wide_int min = wi::min_value (type),
     max = wi::max_value (type);
 
-- 
2.7.4


             reply	other threads:[~2017-06-15 17:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-15 17:34 Yuri Gribov [this message]
2017-06-16  7:13 ` Richard Biener

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='CAJOtW+53nwLgSb1QFSAq4jW1t+VZdB_=8fJH8ibhYuEamSz_dQ@mail.gmail.com' \
    --to=tetra2005@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    --cc=trippels@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).