This is the mail archive of the gcc@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: Fwd: constant hoisting out of loops


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



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