Commit 9c3cb360 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/65875 (ICE: Segmentation fault)

	PR tree-optimization/65875
	* tree-vrp.c (update_value_range): If in is_new case setting
	old_vr to VR_VARYING, also set new_vr to it.  Remove
	old_vr->type == VR_VARYING test.
	(vrp_visit_phi_node): Return SSA_PROP_VARYING instead of
	SSA_PROP_INTERESTING if update_value_range returned true,
	but new range is VR_VARYING.

	* gcc.c-torture/compile/pr65875.c: New test.

From-SVN: r222458
parent 97d87f75
2015-04-27 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/65875
* tree-vrp.c (update_value_range): If in is_new case setting
old_vr to VR_VARYING, also set new_vr to it. Remove
old_vr->type == VR_VARYING test.
(vrp_visit_phi_node): Return SSA_PROP_VARYING instead of
SSA_PROP_INTERESTING if update_value_range returned true,
but new range is VR_VARYING.
2015-04-27 Thomas Preud'homme <thomas.preudhomme@arm.com> 2015-04-27 Thomas Preud'homme <thomas.preudhomme@arm.com>
* combine.c (sign_extend_short_imm): New. * combine.c (sign_extend_short_imm): New.
......
2015-04-27 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/65875
* gcc.c-torture/compile/pr65875.c: New test.
2015-04-25 Marek Polacek <polacek@redhat.com> 2015-04-25 Marek Polacek <polacek@redhat.com>
PR c/52085 PR c/52085
......
/* PR tree-optimization/65875 */
int a, b, c, d, e, f, g;
void
foo (void)
{
long h = 0, i;
if (g < 0)
i = -g;
for (; b;)
for (; c;)
if (e)
h = 1;
for (; f;)
if (a)
break;
if (h > i)
while (h > i)
{
d = 0;
h--;
}
}
...@@ -886,13 +886,18 @@ update_value_range (const_tree var, value_range_t *new_vr) ...@@ -886,13 +886,18 @@ update_value_range (const_tree var, value_range_t *new_vr)
if (is_new) if (is_new)
{ {
/* Do not allow transitions up the lattice. The following /* Do not allow transitions up the lattice. The following
is slightly more awkward than just new_vr->type < old_vr->type is slightly more awkward than just new_vr->type < old_vr->type
because VR_RANGE and VR_ANTI_RANGE need to be considered because VR_RANGE and VR_ANTI_RANGE need to be considered
the same. We may not have is_new when transitioning to the same. We may not have is_new when transitioning to
UNDEFINED or from VARYING. */ UNDEFINED. If old_vr->type is VARYING, we shouldn't be
if (new_vr->type == VR_UNDEFINED called. */
|| old_vr->type == VR_VARYING) if (new_vr->type == VR_UNDEFINED)
set_value_range_to_varying (old_vr); {
BITMAP_FREE (new_vr->equiv);
set_value_range_to_varying (old_vr);
set_value_range_to_varying (new_vr);
return true;
}
else else
set_value_range (old_vr, new_vr->type, new_vr->min, new_vr->max, set_value_range (old_vr, new_vr->type, new_vr->min, new_vr->max,
new_vr->equiv); new_vr->equiv);
...@@ -8941,6 +8946,9 @@ update_range: ...@@ -8941,6 +8946,9 @@ update_range:
fprintf (dump_file, "\n"); fprintf (dump_file, "\n");
} }
if (vr_result.type == VR_VARYING)
return SSA_PROP_VARYING;
return SSA_PROP_INTERESTING; return SSA_PROP_INTERESTING;
} }
......
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