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: [PR debug/45673] fix more MEM_REF -fcompare-debug lossage


On Wed, Oct 6, 2010 at 9:18 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Oct 06, 2010 at 01:51:28AM -0300, Alexandre Oliva wrote:
>> On Oct ?5, 2010, Richard Guenther <richard.guenther@gmail.com> wrote:
>>
>> > On Tue, Oct 5, 2010 at 6:41 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
>> >> On Oct ?2, 2010, Richard Guenther <richard.guenther@gmail.com> wrote:
>> >>
>> >>> MEM-REFs _explicitly_ are supposed to ignore the type of the first
>> >>> operand.
>> >>
>> >> And indeed we do ignore it, except in dumps, in which we look at them to
>> >> decide whether to print an explicit conversion, and this is where
>> >> differences kick in.
>>
>> > The question is why the types differ -g vs. -g0 - I think they should not.
>>
>> They differ because we consider them the same, and thus mem attr caching
>> will happily reuse either one for the other. ?Debug insns just change
>> which one gets the shared slot first.
>>
>> The proposed patch just ensures we don't share the slot, so that
>> MEM_ATTRs won't vary like this.
>
> I think it would be better to avoid using operand_equal_p to test whether
> to share MEM_ATTRs slot. ?Best would be to gather statistics about
> how often we share because MEM_EXPR' == MEM_EXPR'', how often the only
> differences are in just caused by unshare_expr and no other changes
> and how often we accept something differing more than that.
> I hope just writing a comparison function that would require operand
> equality except for IS_EXPR_CODE_CLASS and for expressions require
> everything to be the same (well, perhaps for constants do operand_equal_p),
> but the operands which would be checked the same way recursively, would
> share most of what we share and would ensure that we print always the same.
> Remember operand_equal_p does swap commutative operands etc. for comparison.

Indeed.  I think MEM_ATTR sharing wants a lexical compare, not a
semantic one as operand_equal_p provides.

Considering to remove MEM_ATTR sharing alltogether also makes
sense given that no longer pruning MEM_EXPR that aggressively
very likely resulted in way less sharing than we had before.

Richard.

> ? ? ? ?Jakub
>


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