unrecognizable insn

Jim Wilson jimw@sifive.com
Mon Aug 19 23:10:00 GMT 2019


On Sun, Aug 18, 2019 at 12:23 AM William Tambe <tambewilliam@gmail.com> wrote:
>
> A simpler question from me should have been:
>
> What should a define_constraint look like to match the following operand ?
> (mem/f/c:SI (mem/c:SI (reg/f:SI 0 %sp)))

Does your target actually support memory indirect addressing modes?
These are uncommon.

This looks more like a mistake with REG_OK_STRICT.  Before register
allocation, we can accept (mem (reg)) where reg is a pseudo reg,
assuming it will get allocated to a hard reg later.  But during
register allocation, we must reject (mem (reg)) where reg is a
psuedo-reg, because this means the reg was not allocated to a hard
register, and is instead mapped to a stack slot.  Once register
allocation finished, the (mem (reg)) will be changed to (mem (mem
(stack-slot-address)) which is unlikely to be a valid address.  You
can see this if you look at the RTL dumps.  The code that decides
whether it is OK to accept a pseudo-reg here is controlled by
REG_OK_STRICT.  See for instance the definition of
REGNO_MODE_OK_FOR_BASE_P in working ports.  Or if you defined the
TARGET_LEGITIMATE_ADDRESS_P hook, this is controlled by the "strict"
argument.  In strict mode, you need to reject pseudo-regs, and in
non-strict mode you accept pseudo-regs.

Jim



More information about the Gcc-help mailing list