]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-affine.c (tree_to_aff_combination): Handle MEM_REF for core part of address...
authorBin Cheng <bin.cheng@arm.com>
Thu, 8 May 2014 09:00:42 +0000 (09:00 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Thu, 8 May 2014 09:00:42 +0000 (09:00 +0000)
* tree-affine.c (tree_to_aff_combination): Handle MEM_REF for
core part of address expressions.

From-SVN: r210204

gcc/ChangeLog
gcc/tree-affine.c

index 354cdb9378b41abb0cda73af698279731392fef8..e01f48558325929e4bed1e427d021914255da0ce 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-08  Bin Cheng  <bin.cheng@arm.com>
+
+       * tree-affine.c (tree_to_aff_combination): Handle MEM_REF for
+       core part of address expressions.
+
 2014-05-08  Alan Modra  <amodra@gmail.com>
 
        PR target/60737
index 1d292c4ad0973fbbe8c47bf5b3c6b4cdfc0f6c4b..0b8577836d61fe3d5dac4ffbee2bebbc3be99d6f 100644 (file)
@@ -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