On Sun, Mar 21, 2010 at 3:43 AM, Jim Wilson <wil...@codesourcery.com> wrote:
> On Sun, 2010-03-21 at 03:40 +0800, fanqifei wrote:
>> foor_expand_move is changed and it works now.
>> However, I still don't understand why there was no such error if below
>> condition was used and foor_expand_move was not changed.
>> Both below condition and "(register_operand(operands[0], SImode) ||
>> register_operand(operands[1],SImode)) ..." does not accept mem&&mem.
>
> The define_expand is used for generating RTL.  The RTL expander calls
> the define_expand, which checks for MEM&CONST, and then falls through
> generating the mem copy insn.
>
> The define_insn is used for matching RTL.  After it has been generated,
> we look at the movsi define_insn, and see that MEM&MEM doesn't match, so
> you get an error for unrecognized RTL.
>
> The define_expand must always match the define_insn(s).  They are used
> in different phases, and they aren't checked against each other when gcc
> is built.  If there is a mismatch, then you get a run-time error for
> unrecognized rtl.
>
> Jim
>
>
>
Great thanks for your explanation.
I will look into the internal reason why they must match although that
is beyond my work and what I know.

Thanks again!
-- 
-Qifei Fan
http://freshtime.org

Reply via email to