+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
+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.
--- /dev/null
+/* { 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" } } */
{
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 ();
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