2015-01-22 Wei Mi <wmi@google.com>
authorwmi <wmi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Jan 2015 17:59:23 +0000 (17:59 +0000)
committerwmi <wmi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Jan 2015 17:59:23 +0000 (17:59 +0000)
        PR rtl-optimization/64557
        * dse.c (record_store): Call get_addr for mem_addr.
        (check_mem_read_rtx): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220010 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dse.c

index 90b3987..3b89501 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-22  Wei Mi  <wmi@google.com>
+
+       PR rtl-optimization/64557
+       * dse.c (record_store): Call get_addr for mem_addr.
+       (check_mem_read_rtx): Likewise.
+
 2015-01-22  Eric Botcazou  <ebotcazou@adacore.com>
 
        * fold-const.c (const_binop): Add early return for non-tcc_binary.
index ea6f245..2bb20d7 100644 (file)
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -1575,6 +1575,10 @@ record_store (rtx body, bb_info_t bb_info)
            = rtx_group_vec[group_id];
          mem_addr = group->canon_base_addr;
        }
+      /* get_addr can only handle VALUE but cannot handle expr like:
+        VALUE + OFFSET, so call get_addr to get original addr for
+        mem_addr before plus_constant.  */
+      mem_addr = get_addr (mem_addr);
       if (offset)
        mem_addr = plus_constant (get_address_mode (mem), mem_addr, offset);
     }
@@ -2188,6 +2192,10 @@ check_mem_read_rtx (rtx *loc, bb_info_t bb_info)
            = rtx_group_vec[group_id];
          mem_addr = group->canon_base_addr;
        }
+      /* get_addr can only handle VALUE but cannot handle expr like:
+        VALUE + OFFSET, so call get_addr to get original addr for
+        mem_addr before plus_constant.  */
+      mem_addr = get_addr (mem_addr);
       if (offset)
        mem_addr = plus_constant (get_address_mode (mem), mem_addr, offset);
     }