aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-11-17 16:21:56 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2009-11-17 16:21:56 +0000
commit5456cefc68db903dcb308729a3d68f619c703660 (patch)
treeec58d132d92e5296133cf29f71a6fb3fd0d19c9c
parent263839d33b9fc3c1145b70c957ed733765661381 (diff)
downloadgcc-5456cefc68db903dcb308729a3d68f619c703660.zip
gcc-5456cefc68db903dcb308729a3d68f619c703660.tar.gz
gcc-5456cefc68db903dcb308729a3d68f619c703660.tar.bz2
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-address.c8
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 58ce8e4..7ca1972 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
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.
2009-11-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index 37bce5e..d96b66b 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -400,6 +400,7 @@ move_hint_to_base (tree type, struct mem_address *parts, tree base_hint,
{
unsigned i;
tree val = NULL_TREE;
+ int qual;
for (i = 0; i < addr->n; i++)
{
@@ -414,7 +415,12 @@ move_hint_to_base (tree type, struct mem_address *parts, tree base_hint,
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);
}