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: defining add in a new port


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


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