Commit a787ccc3 by Richard Sandiford Committed by Richard Sandiford

expr.c (expand_assignment): Don't set MEM_KEEP_ALIAS_SET_P here.

gcc/
	* expr.c (expand_assignment): Don't set MEM_KEEP_ALIAS_SET_P here.
	* emit-rtl.c (set_mem_attributes_minus_bitpos): Handle DECL_BIT_FIELDs,
	using their size instead of the COMPONENT_REF's.

From-SVN: r193599
parent 3808f68e
2012-11-18 Richard Sandiford <rdsandiford@googlemail.com>
* expr.c (expand_assignment): Don't set MEM_KEEP_ALIAS_SET_P here.
* emit-rtl.c (set_mem_attributes_minus_bitpos): Handle DECL_BIT_FIELDs,
using their size instead of the COMPONENT_REF's.
2012-11-17 Matthias Klose <doko@ubuntu.com> 2012-11-17 Matthias Klose <doko@ubuntu.com>
* config/mips/t-linux64: Add multiarch names in MULTILIB_OSDIRNAMES. * config/mips/t-linux64: Add multiarch names in MULTILIB_OSDIRNAMES.
...@@ -1678,11 +1678,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, ...@@ -1678,11 +1678,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
attrs.align = MAX (attrs.align, TYPE_ALIGN (type)); attrs.align = MAX (attrs.align, TYPE_ALIGN (type));
/* If the size is known, we can set that. */ /* If the size is known, we can set that. */
if (TYPE_SIZE_UNIT (type) && host_integerp (TYPE_SIZE_UNIT (type), 1)) tree new_size = TYPE_SIZE_UNIT (type);
{
attrs.size_known_p = true;
attrs.size = tree_low_cst (TYPE_SIZE_UNIT (type), 1);
}
/* If T is not a type, we may be able to deduce some more information about /* If T is not a type, we may be able to deduce some more information about
the expression. */ the expression. */
...@@ -1741,13 +1737,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, ...@@ -1741,13 +1737,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
attrs.offset_known_p = true; attrs.offset_known_p = true;
attrs.offset = 0; attrs.offset = 0;
apply_bitpos = bitpos; apply_bitpos = bitpos;
if (DECL_SIZE_UNIT (t) && host_integerp (DECL_SIZE_UNIT (t), 1)) new_size = DECL_SIZE_UNIT (t);
{
attrs.size_known_p = true;
attrs.size = tree_low_cst (DECL_SIZE_UNIT (t), 1);
}
else
attrs.size_known_p = false;
attrs.align = DECL_ALIGN (t); attrs.align = DECL_ALIGN (t);
align_computed = true; align_computed = true;
} }
...@@ -1762,19 +1752,15 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, ...@@ -1762,19 +1752,15 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
align_computed = true; align_computed = true;
} }
/* If this is a field reference and not a bit-field, record it. */ /* If this is a field reference, record it. */
/* ??? There is some information that can be gleaned from bit-fields, else if (TREE_CODE (t) == COMPONENT_REF)
such as the word offset in the structure that might be modified.
But skip it for now. */
else if (TREE_CODE (t) == COMPONENT_REF
&& ! DECL_BIT_FIELD (TREE_OPERAND (t, 1)))
{ {
attrs.expr = t; attrs.expr = t;
attrs.offset_known_p = true; attrs.offset_known_p = true;
attrs.offset = 0; attrs.offset = 0;
apply_bitpos = bitpos; apply_bitpos = bitpos;
/* ??? Any reason the field size would be different than if (DECL_BIT_FIELD (TREE_OPERAND (t, 1)))
the size we got from the type? */ new_size = DECL_SIZE_UNIT (TREE_OPERAND (t, 1));
} }
/* If this is an array reference, look for an outer field reference. */ /* If this is an array reference, look for an outer field reference. */
...@@ -1860,6 +1846,12 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, ...@@ -1860,6 +1846,12 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
else else
as = TYPE_ADDR_SPACE (type); as = TYPE_ADDR_SPACE (type);
if (host_integerp (new_size, 1))
{
attrs.size_known_p = true;
attrs.size = tree_low_cst (new_size, 1);
}
/* If we modified OFFSET based on T, then subtract the outstanding /* If we modified OFFSET based on T, then subtract the outstanding
bit position offset. Similarly, increase the size of the accessed bit position offset. Similarly, increase the size of the accessed
object to contain the negative offset. */ object to contain the negative offset. */
......
...@@ -4818,8 +4818,6 @@ expand_assignment (tree to, tree from, bool nontemporal) ...@@ -4818,8 +4818,6 @@ expand_assignment (tree to, tree from, bool nontemporal)
done for MEM. Also set MEM_KEEP_ALIAS_SET_P if needed. */ done for MEM. Also set MEM_KEEP_ALIAS_SET_P if needed. */
if (volatilep) if (volatilep)
MEM_VOLATILE_P (to_rtx) = 1; MEM_VOLATILE_P (to_rtx) = 1;
if (component_uses_parent_alias_set (to))
MEM_KEEP_ALIAS_SET_P (to_rtx) = 1;
} }
if (optimize_bitfield_assignment_op (bitsize, bitpos, if (optimize_bitfield_assignment_op (bitsize, bitpos,
......
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