On 02/23/2017 02:02 AM, Richard Biener wrote:
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index 84c0b11..a82e164 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -176,7 +176,7 @@ clear_bytes_written_by (sbitmap live_bytes, gimple
*stmt, ao_ref *ref)
/* Verify we have the same base memory address, the write
has a known size and overlaps with REF. */
if (valid_ao_ref_for_dse (&write)
- && write.base == ref->base
+ && operand_equal_p (write.base, ref->base, 0)
As you've identified size and offset match you are really interested
in comparing the base addresses and thus should use OEP_ADDRESS_OF.
I pondered that, but (perhaps incorrectly) thought that OEP_ADDRESS_OF
was an optimization and that a more simple o_e_p with no flags was safer.
I'm happy to change it, particularly if it's a correctness issue (in
which case I think we've designed a horrible API for o_e_p, but such is
life). In fact, I've already bootstrapped and regression tested that
change.
jeff