]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/41857 (Loop optimizer breaks __ea pointers with -mea64)
authorUlrich Weigand <uweigand@de.ibm.com>
Tue, 17 Nov 2009 16:21:56 +0000 (16:21 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Tue, 17 Nov 2009 16:21:56 +0000 (16:21 +0000)
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

gcc/ChangeLog
gcc/tree-ssa-address.c

index 58ce8e4b89a5245a5e70f6b8115763d800e6d797..7ca19723e457d6758ba571f29d070e7500e60f1f 100644 (file)
@@ -1,3 +1,9 @@
+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.
index 37bce5e2d2e5849345e5489d8d08b973f7bc963c..d96b66b1aa8e46a4651f6d4d53ccbc20fca669c5 100644 (file)
@@ -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);
 }