+2006-03-17 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/26721
+ * builtins.c (get_pointer_alignment): For component style references
+ adjust alignment to the component type alignment. Make sure
+ to adjust alignment for component access of constants.
+
2006-03-17 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.md (strlensi): Emit barrier after
inner = max_align;
while (handled_component_p (exp))
{
+ /* Fields in a structure can be packed, honour DECL_ALIGN
+ of the FIELD_DECL. For all other references the conservative
+ alignment is the element type alignment. */
if (TREE_CODE (exp) == COMPONENT_REF)
inner = MIN (inner, DECL_ALIGN (TREE_OPERAND (exp, 1)));
+ else
+ inner = MIN (inner, TYPE_ALIGN (TREE_TYPE (exp)));
exp = TREE_OPERAND (exp, 0);
}
if (TREE_CODE (exp) == FUNCTION_DECL)
align = MIN (inner, DECL_ALIGN (exp));
#ifdef CONSTANT_ALIGNMENT
else if (CONSTANT_CLASS_P (exp))
- align = CONSTANT_ALIGNMENT (exp, align);
+ align = MIN (inner, (unsigned)CONSTANT_ALIGNMENT (exp, align));
#endif
else
align = MIN (align, inner);