aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-affine.c
diff options
context:
space:
mode:
authorBin Cheng <bin.cheng@arm.com>2014-05-08 09:00:42 +0000
committerBin Cheng <amker@gcc.gnu.org>2014-05-08 09:00:42 +0000
commitd1f1a283e496aabb3974d20bb4b9cd4a76f2d9fa (patch)
tree43583932dd9ccbd3e8db656deaa80c6acaf018c1 /gcc/tree-affine.c
parentc7ad35388d4738e3b981c4dbdbf5cbfe7b441c95 (diff)
downloadgcc-d1f1a283e496aabb3974d20bb4b9cd4a76f2d9fa.zip
gcc-d1f1a283e496aabb3974d20bb4b9cd4a76f2d9fa.tar.gz
gcc-d1f1a283e496aabb3974d20bb4b9cd4a76f2d9fa.tar.bz2
tree-affine.c (tree_to_aff_combination): Handle MEM_REF for core part of address expressions.
* tree-affine.c (tree_to_aff_combination): Handle MEM_REF for core part of address expressions. From-SVN: r210204
Diffstat (limited to 'gcc/tree-affine.c')
-rw-r--r--gcc/tree-affine.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index 1d292c4..0b85778 100644
--- a/gcc/tree-affine.c
+++ b/gcc/tree-affine.c
@@ -328,7 +328,14 @@ tree_to_aff_combination (tree expr, tree type, aff_tree *comb)
if (bitpos % BITS_PER_UNIT != 0)
break;
aff_combination_const (comb, type, bitpos / BITS_PER_UNIT);
- core = build_fold_addr_expr (core);
+ if (TREE_CODE (core) == MEM_REF)
+ {
+ aff_combination_add_cst (comb, wi::to_widest (TREE_OPERAND (core, 1)));
+ core = TREE_OPERAND (core, 0);
+ }
+ else
+ core = build_fold_addr_expr (core);
+
if (TREE_CODE (core) == ADDR_EXPR)
aff_combination_add_elt (comb, core, 1);
else