public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][PR 81089][PING] Fix -O3 bootstrap
@ 2017-06-15 17:34 Yuri Gribov
  2017-06-16  7:13 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Yuri Gribov @ 2017-06-15 17:34 UTC (permalink / raw)
  To: GCC Patches; +Cc: Richard Biener, trippels

[-- 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][PR 81089][PING] Fix -O3 bootstrap
  2017-06-15 17:34 [PATCH][PR 81089][PING] Fix -O3 bootstrap Yuri Gribov
@ 2017-06-16  7:13 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2017-06-16  7:13 UTC (permalink / raw)
  To: Yuri Gribov; +Cc: GCC Patches, trippels

On Thu, 15 Jun 2017, Yuri Gribov wrote:

> 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.

Ok.

I'll commit it for you.

Richard.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-16  7:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15 17:34 [PATCH][PR 81089][PING] Fix -O3 bootstrap Yuri Gribov
2017-06-16  7:13 ` Richard Biener

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