+2009-11-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ PR tree-optimization/41857
+ * tree-ssa-address.c (move_hint_to_base): Use void pointer to
+ TYPE's address space instead of pointer to TYPE.
+
2009-11-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* reload.c (find_reloads_address): Fix typo.
{
unsigned i;
tree val = NULL_TREE;
+ int qual;
for (i = 0; i < addr->n; i++)
{
if (i == addr->n)
return;
- /* Cast value to appropriate pointer type. */
+ /* Cast value to appropriate pointer type. We cannot use a pointer
+ to TYPE directly, as the back-end will assume registers of pointer
+ type are aligned, and just the base itself may not actually be.
+ We use void pointer to the type's address space instead. */
+ qual = ENCODE_QUAL_ADDR_SPACE (TYPE_ADDR_SPACE (type));
+ type = build_qualified_type (void_type_node, qual);
parts->base = fold_convert (build_pointer_type (type), val);
aff_combination_remove_elt (addr, i);
}