Commit f68396a1 by Richard Guenther Committed by Richard Biener

emit-rtl.c (set_mem_attributes_minus_bitpos): Remove dead code.

2012-06-12  Richard Guenther  <rguenther@suse.de>

	* emit-rtl.c (set_mem_attributes_minus_bitpos): Remove dead code.
	* alias.c (ao_ref_from_mem): MEM_EXPR is conservative, MEM_OFFSET
	and MEM_SIZE only refines it.  Reflect that and be less conservative
	if either of the latter is not known.

From-SVN: r188429
parent 891ca07d
2012-06-12 Richard Guenther <rguenther@suse.de>
* emit-rtl.c (set_mem_attributes_minus_bitpos): Remove dead code.
* alias.c (ao_ref_from_mem): MEM_EXPR is conservative, MEM_OFFSET
and MEM_SIZE only refines it. Reflect that and be less conservative
if either of the latter is not known.
2012-06-12 Jakub Jelinek <jakub@redhat.com> 2012-06-12 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/53589 PR rtl-optimization/53589
......
...@@ -326,17 +326,11 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) ...@@ -326,17 +326,11 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem)
ref->ref_alias_set = MEM_ALIAS_SET (mem); ref->ref_alias_set = MEM_ALIAS_SET (mem);
/* If MEM_OFFSET or MEM_SIZE are unknown we have to punt. /* If MEM_OFFSET or MEM_SIZE are unknown what we got from MEM_EXPR
Keep points-to related information though. */ is conservative, so trust it. */
if (!MEM_OFFSET_KNOWN_P (mem) if (!MEM_OFFSET_KNOWN_P (mem)
|| !MEM_SIZE_KNOWN_P (mem)) || !MEM_SIZE_KNOWN_P (mem))
{ return true;
ref->ref = NULL_TREE;
ref->offset = 0;
ref->size = -1;
ref->max_size = -1;
return true;
}
/* If the base decl is a parameter we can have negative MEM_OFFSET in /* If the base decl is a parameter we can have negative MEM_OFFSET in
case of promoted subregs on bigendian targets. Trust the MEM_EXPR case of promoted subregs on bigendian targets. Trust the MEM_EXPR
...@@ -345,6 +339,9 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) ...@@ -345,6 +339,9 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem)
&& (MEM_SIZE (mem) + MEM_OFFSET (mem)) * BITS_PER_UNIT == ref->size) && (MEM_SIZE (mem) + MEM_OFFSET (mem)) * BITS_PER_UNIT == ref->size)
return true; return true;
/* Otherwise continue and refine size and offset we got from analyzing
MEM_EXPR by using MEM_SIZE and MEM_OFFSET. */
ref->offset += MEM_OFFSET (mem) * BITS_PER_UNIT; ref->offset += MEM_OFFSET (mem) * BITS_PER_UNIT;
ref->size = MEM_SIZE (mem) * BITS_PER_UNIT; ref->size = MEM_SIZE (mem) * BITS_PER_UNIT;
......
...@@ -1838,15 +1838,6 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, ...@@ -1838,15 +1838,6 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
/* ??? Any reason the field size would be different than /* ??? Any reason the field size would be different than
the size we got from the type? */ the size we got from the type? */
} }
/* If this is an indirect reference, record it. */
else if (TREE_CODE (t) == MEM_REF)
{
attrs.expr = t;
attrs.offset_known_p = true;
attrs.offset = 0;
apply_bitpos = bitpos;
}
} }
/* If this is an indirect reference, record it. */ /* If this is an indirect reference, record it. */
......
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