From: Ulrich Weigand Date: Tue, 17 Nov 2009 16:21:56 +0000 (+0000) Subject: re PR tree-optimization/41857 (Loop optimizer breaks __ea pointers with -mea64) X-Git-Tag: releases/gcc-4.5.0~2311 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5456cefc68db903dcb308729a3d68f619c703660;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 58ce8e4b89a5..7ca19723e457 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-11-17 Ulrich Weigand + + 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 * reload.c (find_reloads_address): Fix typo. diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c index 37bce5e2d2e5..d96b66b1aa8e 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); }