tree-ssa-address.c (copy_ref_info): Check NULL TMR_STEP when TMR_INDEX is non-NULL.
authorBin Cheng <bin.cheng@arm.com>
Mon, 23 May 2016 14:44:07 +0000 (14:44 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Mon, 23 May 2016 14:44:07 +0000 (14:44 +0000)
* tree-ssa-address.c (copy_ref_info): Check NULL TMR_STEP when
TMR_INDEX is non-NULL.

From-SVN: r236593

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

index d85700a6bb4636e0f76e87b3eb78fedaa69bef1c..311e632fd656a7c4c93e476a414c0a31315d54b8 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-23 Bin Cheng  <bin.cheng@arm.com>
+
+       * tree-ssa-address.c (copy_ref_info): Check NULL TMR_STEP when
+       TMR_INDEX is non-NULL.
+
 2016-05-23  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/71230
index 9e49f3d3f68bb58a91a795d419eedbbec17d71f7..b04545c2ed55a6908d2ef61b244cfdd7dcf89d02 100644 (file)
@@ -877,6 +877,10 @@ copy_ref_info (tree new_ref, tree old_ref)
              && TREE_CODE (old_ref) == MEM_REF
              && !(TREE_CODE (new_ref) == TARGET_MEM_REF
                   && (TMR_INDEX2 (new_ref)
+                      /* TODO: Below conditions can be relaxed if TMR_INDEX
+                         is an indcution variable and its initial value and
+                         step are aligned.  */
+                      || (TMR_INDEX (new_ref) && !TMR_STEP (new_ref))
                       || (TMR_STEP (new_ref)
                           && (TREE_INT_CST_LOW (TMR_STEP (new_ref))
                               < align)))))