Commit 12ead254 by Richard Biener Committed by Richard Biener

re PR middle-end/80533 (Alias analysis of zero length array does not recognize…

re PR middle-end/80533 (Alias analysis of zero length array does not recognize accesses beyond end of array)

2017-04-27  Richard Biener  <rguenther@suse.de>

	PR middle-end/80533
	* emit-rtl.c (set_mem_attributes_minus_bitpos): When
	stripping ARRAY_REFs from MEM_EXPR make sure we're not
	keeping a reference to a trailing array.

From-SVN: r247327
parent 3b2249aa
2017-04-27 Richard Biener <rguenther@suse.de>
PR middle-end/80533
* emit-rtl.c (set_mem_attributes_minus_bitpos): When
stripping ARRAY_REFs from MEM_EXPR make sure we're not
keeping a reference to a trailing array.
2017-04-27 Richard Biener <rguenther@suse.de>
PR middle-end/80539
* tree-chrec.c (chrec_fold_plus_poly_poly): Deal with not
being in loop-closed SSA form conservatively.
......
......@@ -1954,7 +1954,10 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
while (TREE_CODE (t2) == ARRAY_REF);
if (DECL_P (t2)
|| TREE_CODE (t2) == COMPONENT_REF)
|| (TREE_CODE (t2) == COMPONENT_REF
/* For trailing arrays t2 doesn't have a size that
covers all valid accesses. */
&& ! array_at_struct_end_p (t, false)))
{
attrs.expr = t2;
attrs.offset_known_p = false;
......
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