Commit e729c8e0 by Richard Biener Committed by Richard Biener

re PR tree-optimization/83418 (ICE in…

re PR tree-optimization/83418 (ICE in extract_range_for_var_from_comparison_expr, at vr-values.c:448)

2017-12-14  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/83418
	* vr-values.c (vr_values::extract_range_for_var_from_comparison_expr):
	Instead of asserting we don't get unfolded comparisons deal with
	them.

	* gcc.dg/torture/pr83418.c: New testcase.

From-SVN: r255628
parent 6dfb83e8
2017-12-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/83418
* vr-values.c (vr_values::extract_range_for_var_from_comparison_expr):
Instead of asserting we don't get unfolded comparisons deal with
them.
2017-12-14 Jakub Jelinek <jakub@redhat.com> 2017-12-14 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/83396 PR bootstrap/83396
2017-12-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/83418
* gcc.dg/torture/pr83418.c: New testcase.
2017-12-14 Jakub Jelinek <jakub@redhat.com> 2017-12-14 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/83396 PR bootstrap/83396
......
/* { dg-do compile } */
void
yj (int j4)
{
int t3;
for (t3 = 0; t3 < 6; ++t3)
{
short int v4 = t3;
if (v4 == j4 || v4 > t3)
for (;;)
{
}
}
}
...@@ -445,11 +445,12 @@ vr_values::extract_range_for_var_from_comparison_expr (tree var, ...@@ -445,11 +445,12 @@ vr_values::extract_range_for_var_from_comparison_expr (tree var,
tree min, max, type; tree min, max, type;
value_range *limit_vr; value_range *limit_vr;
type = TREE_TYPE (var); type = TREE_TYPE (var);
gcc_assert (limit != var);
/* For pointer arithmetic, we only keep track of pointer equality /* For pointer arithmetic, we only keep track of pointer equality
and inequality. */ and inequality. If we arrive here with unfolded conditions like
if (POINTER_TYPE_P (type) && cond_code != NE_EXPR && cond_code != EQ_EXPR) _1 > _1 do not derive anything. */
if ((POINTER_TYPE_P (type) && cond_code != NE_EXPR && cond_code != EQ_EXPR)
|| limit == var)
{ {
set_value_range_to_varying (vr_p); set_value_range_to_varying (vr_p);
return; return;
......
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