> On Jun 11, 2018, at 3:04 PM, Jeff Law <l...@redhat.com> wrote:
>
> On 06/04/2018 09:02 AM, Paul Koning wrote:
>>
>> ...
>>
>> By "multiple memory operands" do you mean both source and dest in
>> memory?
> Yes and no :-) I suspect no real thought was given to what happens when
> there's more than one auto-inc in the pattern, regardless of what
> happens in the final instruction.
>
> I realize that in your case the operand appears twice in the RTL, but
> just once in the final output. One might argue that if the operands in
> the pattern are tied together via a match_dup that we ought to be able
> to support it. But I doubt anyone has thought much about it.
The description of matching constraint makes it clear that it's meant to be
different from match_dup. The way it's described is (paraphrasing) that it
acts like match_dup except if the operand it refers to has a side effect in it.
In that case, it matches an operand RTX with the side effect removed. The
example given is: if the referenced operand is *p++, the matching constraint
looks for *p.
And that indeed would be right. If I have a two-operand add instruction,
(set (mem (post_inc (reg))) (add (mem (reg)) operand2)))
would make sense. The documentation makes me expect such a thing to show up
and be recognized by a matching constraint. But the auto-inc code doesn't do
this, and what's more interesting, it seems that the old code (in flow.c)
didn't either.
paul