This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][PR tree-optimization/79578] Use operand_equal_p rather than pointer equality for base test


On Thu, Feb 23, 2017 at 10:06 PM, Jeff Law <law@redhat.com> wrote:
> 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.

It's indeed an optimization to use OEP_ADDRESS_OF and 0 is more conservative.

Richard.

> jeff
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]