From: Yury Gribov Date: Fri, 16 Jun 2017 07:16:34 +0000 (+0000) Subject: re PR tree-optimization/81089 (ICE: tree check: expected ssa_name, have integer_cst... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=32e37414af3e1e236a2c7400c9d7178ede77ce4d;p=gcc.git re PR tree-optimization/81089 (ICE: tree check: expected ssa_name, have integer_cst in register_edge_assert_for_2, at tree-vrp.c:5023) 2017-06-16 Yury Gribov PR tree-optimization/81089 * tree-vrp.c (is_masked_range_test): Validate operands of subexpression. From-SVN: r249237 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index df4da476a6c..3f883c2b7a8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-06-16 Yury Gribov + + PR tree-optimization/81089 + * tree-vrp.c (is_masked_range_test): Validate operands of + subexpression. + 2017-06-15 Martin Sebor PR c++/80560 diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index a7424a3f8e2..9ca3924ea89 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);