Commit 3c2f6fae by Richard Biener Committed by Richard Biener

re PR middle-end/91267 (SEGV in value_range_base::equal_p)

2019-07-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91267
	* vr-values.c (vr_values::update_value_range): Add early return
	for effectively VARYING lattice entry.

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

From-SVN: r273874
parent f33b9c40
2019-07-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/91267
* vr-values.c (vr_values::update_value_range): Add early return
for effectively VARYING lattice entry.
2019-07-29 Richard Sandiford <richard.sandiford@arm.com>
PR debug/86638
......
2019-07-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/91267
* gcc.dg/torture/pr91267.c: New testcase.
2019-07-29 Richard Sandiford <richard.sandiford@arm.com>
* c-c++-common/guality/Og-dce-1.c: New test.
......
/* { dg-do compile } */
void bar (void);
void baz (int);
char *qux (void);
int a, b;
void
foo (int f, char *d)
{
char *e;
while (d)
{
if (f)
if (e)
bar ();
baz (e - (d + a));
b = e - d;
d = qux ();
}
}
......@@ -202,8 +202,12 @@ vr_values::update_value_range (const_tree var, value_range *new_vr)
new_vr->intersect (&nr);
}
/* Update the value range, if necessary. */
/* Update the value range, if necessary. If we cannot allocate a lattice
entry for VAR keep it at VARYING. This happens when DOM feeds us stmts
with SSA names allocated after setting up the lattice. */
old_vr = get_lattice_entry (var);
if (!old_vr)
return false;
is_new = !old_vr->equal_p (*new_vr, /*ignore_equivs=*/false);
if (is_new)
......
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