Commit 9714f1a7 by Richard Biener

tree-optimization/93661 properly guard tree_to_poly_int64

2020-02-11  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/93661
	PR tree-optimization/93662
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Properly guard
	tree_to_poly_int64.
	* tree-sra.c (get_access_for_expr): Likewise.

	* gcc.dg/pr93661.c: New testcase.
parent dfffecb8
2020-02-11 Richard Biener <rguenther@suse.de>
PR tree-optimization/93661
PR tree-optimization/93662
* tree-ssa-sccvn.c (vn_reference_lookup_3): Properly guard
tree_to_poly_int64.
* tree-sra.c (get_access_for_expr): Likewise.
2020-02-10 Jakub Jelinek <jakub@redhat.com> 2020-02-10 Jakub Jelinek <jakub@redhat.com>
PR target/93637 PR target/93637
......
2020-02-11 Richard Biener <rguenther@suse.de>
PR tree-optimization/93661
PR tree-optimization/93662
* gcc.dg/pr93661.c: New testcase.
2020-02-12 Patrick Palka <ppalka@redhat.com> 2020-02-12 Patrick Palka <ppalka@redhat.com>
PR c++/69448 PR c++/69448
......
...@@ -3605,8 +3605,10 @@ get_access_for_expr (tree expr) ...@@ -3605,8 +3605,10 @@ get_access_for_expr (tree expr)
if (tree basesize = DECL_SIZE (base)) if (tree basesize = DECL_SIZE (base))
{ {
poly_int64 sz = tree_to_poly_int64 (basesize); poly_int64 sz;
if (offset < 0 || known_le (sz, offset)) if (offset < 0
|| !poly_int_tree_p (basesize, &sz)
|| known_le (sz, offset))
return NULL; return NULL;
} }
......
...@@ -2504,6 +2504,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *data_, ...@@ -2504,6 +2504,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *data_,
/* For now handle clearing memory with partial defs. */ /* For now handle clearing memory with partial defs. */
else if (known_eq (ref->size, maxsize) else if (known_eq (ref->size, maxsize)
&& integer_zerop (gimple_call_arg (def_stmt, 1)) && integer_zerop (gimple_call_arg (def_stmt, 1))
&& tree_fits_poly_int64_p (len)
&& tree_to_poly_int64 (len).is_constant (&leni) && tree_to_poly_int64 (len).is_constant (&leni)
&& offset.is_constant (&offseti) && offset.is_constant (&offseti)
&& offset2.is_constant (&offset2i) && offset2.is_constant (&offset2i)
......
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