This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: define_split question
- From: Ian Lance Taylor <iant at google dot com>
- To: Lars Poeschel <larsi at wh2 dot tu-dresden dot de>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 24 Jan 2007 07:45:33 -0800
- Subject: Re: define_split question
- References: <200701241303.29952.larsi@wh2.tu-dresden.de>
Lars Poeschel <larsi@wh2.tu-dresden.de> writes:
> I have the following statement, which fails with general compiler errror in
> gen_rtx_SUBREG, at emit-rtl.c:729
>
> (define_split
> [(set (match_operand:DI 0 "memory_operand" "=m")
> (match_operand:DI 1 "register_operand" "r"))]
> ""
> [(set (mem:SI (match_dup 0) )
> (subreg:SI (match_dup 1) 0))
> (set (mem:SI (plus:SI (match_dup 0) (const_int 4)))
> (subreg:SI (match_dup 1) 1))]
> "")
>
> What I want to do is implementing the movdi on a 32 bit platform. This split
> is a special case for memory destination and register source. I want to split
> the 64 bit move into 2 32 bit moves. What am I doing wrong ? Anyone an idea ?
In general, with some exceptions, you shouldn't use an explicit subreg
in an insn pattern. You should instead just use (match_dup N), and in
your C code use operands[N] = simplify_gen_subreg (...).
Otherwise you can wind up with a subreg of a subreg which is
forbidden.
Ian