Commit ccef6716 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/88444 (ICE: tree check: expected ssa_name, have…

re PR tree-optimization/88444 (ICE: tree check: expected ssa_name, have integer_cst in live_on_edge, at tree-vrp.c:468; or ICE: tree check: expected ssa_name, have integer_cst in get_value_range, at vr-values.c:84)

	PR tree-optimization/88444
	* tree-vrp.c (register_edge_assert_for_2): Only register assertions
	for conversions if rhs1 is a SSA_NAME.

	* gcc.dg/pr88444.c: New test.

From-SVN: r267026
parent 5b238a45
2018-12-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/88444
* tree-vrp.c (register_edge_assert_for_2): Only register assertions
for conversions if rhs1 is a SSA_NAME.
2018-12-11 Dimitar Dimitrov <dimitar@dinux.eu>
* cfgexpand.c (asm_clobber_reg_is_valid): Also produce
2018-12-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/88444
* gcc.dg/pr88444.c: New test.
2018-12-11 Dimitar Dimitrov <dimitar@dinux.eu>
* gcc.target/i386/pr52813.c: New test.
......
/* PR tree-optimization/88444 */
/* { dg-do compile } */
/* { dg-options "-O1 -ftree-vrp -fno-tree-ccp -fno-tree-forwprop -fno-tree-fre" } */
int v;
int
foo (int, int);
static inline int
bar (long int x)
{
return !!x ? x : 1;
}
static inline void
baz (int x)
{
v += foo (0, 0) + bar (x);
}
void
qux (void)
{
int a = 0;
v = v || foo (0, 0);
v = v || foo (0, 0);
v = v || foo (0, 0);
baz (a);
}
......@@ -2894,6 +2894,7 @@ register_edge_assert_for_2 (tree name, edge e,
{
name2 = gimple_assign_rhs1 (def_stmt);
if (CONVERT_EXPR_CODE_P (rhs_code)
&& TREE_CODE (name2) == SSA_NAME
&& INTEGRAL_TYPE_P (TREE_TYPE (name2))
&& TYPE_UNSIGNED (TREE_TYPE (name2))
&& prec == TYPE_PRECISION (TREE_TYPE (name2))
......@@ -2990,6 +2991,7 @@ register_edge_assert_for_2 (tree name, edge e,
wide_int rmin, rmax;
tree rhs1 = gimple_assign_rhs1 (def_stmt);
if (INTEGRAL_TYPE_P (TREE_TYPE (rhs1))
&& TREE_CODE (rhs1) == SSA_NAME
/* Make sure the relation preserves the upper/lower boundary of
the range conservatively. */
&& (comp_code == NE_EXPR
......@@ -3054,6 +3056,7 @@ register_edge_assert_for_2 (tree name, edge e,
{
names[1] = gimple_assign_rhs1 (def_stmt2);
if (!CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt2))
|| TREE_CODE (names[1]) != SSA_NAME
|| !INTEGRAL_TYPE_P (TREE_TYPE (names[1]))
|| (TYPE_PRECISION (TREE_TYPE (name2))
!= TYPE_PRECISION (TREE_TYPE (names[1]))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment