Commit 5456cefc by Ulrich Weigand Committed by Ulrich Weigand

re PR tree-optimization/41857 (Loop optimizer breaks __ea pointers with -mea64)

	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.

From-SVN: r154255
parent 263839d3
2009-11-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> 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. * reload.c (find_reloads_address): Fix typo.
2009-11-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> 2009-11-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
...@@ -400,6 +400,7 @@ move_hint_to_base (tree type, struct mem_address *parts, tree base_hint, ...@@ -400,6 +400,7 @@ move_hint_to_base (tree type, struct mem_address *parts, tree base_hint,
{ {
unsigned i; unsigned i;
tree val = NULL_TREE; tree val = NULL_TREE;
int qual;
for (i = 0; i < addr->n; i++) for (i = 0; i < addr->n; i++)
{ {
...@@ -414,7 +415,12 @@ move_hint_to_base (tree type, struct mem_address *parts, tree base_hint, ...@@ -414,7 +415,12 @@ move_hint_to_base (tree type, struct mem_address *parts, tree base_hint,
if (i == addr->n) if (i == addr->n)
return; 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); parts->base = fold_convert (build_pointer_type (type), val);
aff_combination_remove_elt (addr, i); aff_combination_remove_elt (addr, i);
} }
......
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