Commit 7de80559 by Richard Guenther Committed by Richard Biener

re PR middle-end/26659 (gcc.target/powerpc/ppc-vector-memset.c fails on the mainline)

2006-03-14  Richard Guenther  <rguenther@suse.de>

	PR middle-end/26659
	* builtins.c (get_pointer_alignment): Prefer alignment
	information from decls over that from types.

From-SVN: r112048
parent 2f96b754
2006-03-14 Richard Guenther <rguenther@suse.de>
PR middle-end/26659
* builtins.c (get_pointer_alignment): Prefer alignment
information from decls over that from types.
2006-03-14 Andrew Pinski <pinskia@physics.uc.edu> 2006-03-14 Andrew Pinski <pinskia@physics.uc.edu>
PR target/26657 PR target/26657
......
...@@ -275,21 +275,24 @@ get_pointer_alignment (tree exp, unsigned int max_align) ...@@ -275,21 +275,24 @@ get_pointer_alignment (tree exp, unsigned int max_align)
case ADDR_EXPR: case ADDR_EXPR:
/* See what we are pointing at and look at its alignment. */ /* See what we are pointing at and look at its alignment. */
exp = TREE_OPERAND (exp, 0); exp = TREE_OPERAND (exp, 0);
inner = max_align;
while (handled_component_p (exp)) while (handled_component_p (exp))
{ {
if (TREE_CODE (exp) == COMPONENT_REF) if (TREE_CODE (exp) == COMPONENT_REF)
align = MIN (align, DECL_ALIGN (TREE_OPERAND (exp, 1))); inner = MIN (inner, DECL_ALIGN (TREE_OPERAND (exp, 1)));
exp = TREE_OPERAND (exp, 0); exp = TREE_OPERAND (exp, 0);
} }
if (TREE_CODE (exp) == FUNCTION_DECL) if (TREE_CODE (exp) == FUNCTION_DECL)
align = MIN (align, FUNCTION_BOUNDARY); align = FUNCTION_BOUNDARY;
else if (DECL_P (exp)) else if (DECL_P (exp))
align = MIN (align, DECL_ALIGN (exp)); align = MIN (inner, DECL_ALIGN (exp));
#ifdef CONSTANT_ALIGNMENT #ifdef CONSTANT_ALIGNMENT
else if (CONSTANT_CLASS_P (exp)) else if (CONSTANT_CLASS_P (exp))
align = MIN (align, (unsigned)CONSTANT_ALIGNMENT (exp, align)); align = CONSTANT_ALIGNMENT (exp, align);
#endif #endif
return align; else
align = MIN (align, inner);
return MIN (align, max_align);
default: default:
return align; return align;
......
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