This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: defining add in a new port
- From: Ian Lance Taylor <iant at google dot com>
- To: Jean-Marc Saffroy <jean-marc dot saffroy at joguin dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 28 Jan 2011 09:44:52 -0800
- Subject: Re: defining add in a new port
- References: <4D42EDDE.6040802@joguin.com>
Jean-Marc Saffroy <jean-marc.saffroy@joguin.com> writes:
> error: insn does not satisfy its constraints:
> (insn 1424 1423 141 (set (reg:DI 2 r2)
> (plus:DI (reg:DI 2 r2)
> (const_int 40 [0x28])))
> /home/jmsaffroy/cygnus/src/newlib/libc/time/strptime.c:165 24 {adddi3}
> (expr_list:REG_EQUIV (plus:DI (reg/f:DI 70 a6)
> (const_int 40 [0x28]))
> (nil)))
You should find out what is creating this insn. Is it being created by
reload, or is it being created by some pass that runs after reload?
It is likely that you need to make adddi3 a define_expand which tests
reload_in_progress and reload_completed. If those are the case, you
will need to explicitly convert
(set (reg:DI DREG1) (plus:DI (reg:DI DREG2) (const_int N)))
into
(set (reg:DI DREG1) (const_int N))
(set (reg:DI DREG1) (plus:DI (reg:DI DREG1) (REG:DI DREG2)))
For a much more sophisticated version of this, see, e.g., addsi3 in the
ARM target.
Ian