Commit dee75828 by Richard Biener Committed by Richard Biener

re PR tree-optimization/88427 (ICE: tree check: expected integer_cst, have…

re PR tree-optimization/88427 (ICE: tree check: expected integer_cst, have plus_expr in get_len, at tree.h:5617)

2018-12-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/88427
	* vr-values.c (vr_values::extract_range_from_phi_node):
	Handle symbolic ranges conservatively when trying to drop
	to Inf +- 1.

	* gcc.dg/pr88427.c: New testcase.

From-SVN: r266955
parent 4a902ec8
2018-12-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/88427
* vr-values.c (vr_values::extract_range_from_phi_node):
Handle symbolic ranges conservatively when trying to drop
to Inf +- 1.
2018-12-10 Martin Jambor <mjambor@suse.cz> 2018-12-10 Martin Jambor <mjambor@suse.cz>
PR ipa/88214 PR ipa/88214
2018-12-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/88427
* gcc.dg/pr88427.c: New testcase.
2018-12-10 Jakub Jelinek <jakub@redhat.com> 2018-12-10 Jakub Jelinek <jakub@redhat.com>
PR ipa/87955 PR ipa/87955
......
/* { dg-do compile } */
/* { dg-options "-O2 -fno-tree-dce -fno-tree-fre -Wno-div-by-zero" } */
void
uj (int eq, int s4)
{
short int tm = 0;
for (;;)
if (eq == s4)
{
tm += !!s4;
if (tm == s4)
{
eq += tm;
for (;;)
eq /= 0;
}
}
}
...@@ -2891,8 +2891,9 @@ vr_values::extract_range_from_phi_node (gphi *phi, value_range *vr_result) ...@@ -2891,8 +2891,9 @@ vr_values::extract_range_from_phi_node (gphi *phi, value_range *vr_result)
if (cmp_min < 0) if (cmp_min < 0)
new_min = lhs_vr->min (); new_min = lhs_vr->min ();
else if (cmp_min > 0 else if (cmp_min > 0
&& tree_int_cst_lt (vrp_val_min (vr_result->type ()), && (TREE_CODE (vr_result->min ()) != INTEGER_CST
vr_result->min ())) || tree_int_cst_lt (vrp_val_min (vr_result->type ()),
vr_result->min ())))
new_min = int_const_binop (PLUS_EXPR, new_min = int_const_binop (PLUS_EXPR,
vrp_val_min (vr_result->type ()), vrp_val_min (vr_result->type ()),
build_int_cst (vr_result->type (), 1)); build_int_cst (vr_result->type (), 1));
...@@ -2901,8 +2902,9 @@ vr_values::extract_range_from_phi_node (gphi *phi, value_range *vr_result) ...@@ -2901,8 +2902,9 @@ vr_values::extract_range_from_phi_node (gphi *phi, value_range *vr_result)
if (cmp_max > 0) if (cmp_max > 0)
new_max = lhs_vr->max (); new_max = lhs_vr->max ();
else if (cmp_max < 0 else if (cmp_max < 0
&& tree_int_cst_lt (vr_result->max (), && (TREE_CODE (vr_result->max ()) != INTEGER_CST
vrp_val_max (vr_result->type ()))) || tree_int_cst_lt (vr_result->max (),
vrp_val_max (vr_result->type ()))))
new_max = int_const_binop (MINUS_EXPR, new_max = int_const_binop (MINUS_EXPR,
vrp_val_max (vr_result->type ()), vrp_val_max (vr_result->type ()),
build_int_cst (vr_result->type (), 1)); build_int_cst (vr_result->type (), 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