aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-8.c15
-rw-r--r--gcc/tree-ssa-scopedtables.c11
4 files changed, 36 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 00885e6..6a1e932 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2019-07-02 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/58483
+ * tree-ssa-scopedtables.c (avail_expr_hash): Use OEP_ADDRESS_OF
+ for MEM_REF base hashing.
+ (equal_mem_array_ref_p): Likewise for base comparison.
+
2019-07-01 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/rs6000.md (signbit<mode>2_dm): Make this a
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9d9569d..e3a6b79 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-07-02 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/58483
+ * gcc.dg/tree-ssa/ssa-dom-cse-8.c: New testcase.
+
2019-07-01 Andreas Krebbel <krebbel@linux.ibm.com>
* gcc.target/s390/vector/vec-shift-2.c: New test.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-8.c
new file mode 100644
index 0000000..b419ce7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-8.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fgimple -fdump-tree-dom2" } */
+
+int __GIMPLE (ssa,startwith("dom"))
+foo (void *p)
+{
+ int _2;
+
+ __BB(2):
+ __MEM <int> ((char *)p_1(D) + 4) = 20;
+ _2 = __MEM <const int> ((int *)p_1(D) + 4);
+ return _2;
+}
+
+/* { dg-final { scan-tree-dump "return 20;" "dom2" } } */
diff --git a/gcc/tree-ssa-scopedtables.c b/gcc/tree-ssa-scopedtables.c
index e08e24d..50413eb 100644
--- a/gcc/tree-ssa-scopedtables.c
+++ b/gcc/tree-ssa-scopedtables.c
@@ -494,7 +494,9 @@ avail_expr_hash (class expr_hash_elt *p)
{
enum tree_code code = MEM_REF;
hstate.add_object (code);
- inchash::add_expr (base, hstate);
+ inchash::add_expr (base, hstate,
+ TREE_CODE (base) == MEM_REF
+ ? OEP_ADDRESS_OF : 0);
hstate.add_object (offset);
hstate.add_object (size);
return hstate.end ();
@@ -540,7 +542,12 @@ equal_mem_array_ref_p (tree t0, tree t1)
if (rev0 != rev1 || maybe_ne (sz0, sz1) || maybe_ne (off0, off1))
return false;
- return operand_equal_p (base0, base1, 0);
+ return operand_equal_p (base0, base1,
+ (TREE_CODE (base0) == MEM_REF
+ || TREE_CODE (base0) == TARGET_MEM_REF)
+ && (TREE_CODE (base1) == MEM_REF
+ || TREE_CODE (base1) == TARGET_MEM_REF)
+ ? OEP_ADDRESS_OF : 0);
}
/* Compare two hashable_expr structures for equivalence. They are