https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125947

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Dhruv Chawla from comment #0)
> Looks like the same issue as PR125716.

Yes it is because:
      "GP2FP": 2

is the cost for octeontx81. The reason for that is because the cost on
octeonxt81 to move between the gprs and fprs was cheap/same as the cost for a
normal move IIRC.

Also reload/LRA treats 2 as a special cost meaning no need for "reloading"
between the register classes. There is a section on that even:
```
@defmac REGISTER_MOVE_COST (@var{mode}, @var{from}, @var{to})
A C expression for the cost of moving data of mode @var{mode} from a
register in class @var{from} to one in class @var{to}.  The classes are
expressed using the enumeration values such as @code{GENERAL_REGS}.  A
value of 2 is the default; other values are interpreted relative to
that.

It is not required that the cost always equal 2 when @var{from} is the
same as @var{to}; on some machines it is expensive to move between
registers if they are not general registers.

If reload sees an insn consisting of a single @code{set} between two
hard registers, and --if @code{REGISTER_MOVE_COST} applied to their
classes returns a value of 2, reload does not check to ensure that the
constraints of the insn are met.  Setting a cost of other than 2 will
allow reload to verify that the constraints are met.--  You should do this
if the @samp{mov@var{m}} pattern's constraints do not allow such copying.
```

Note the part where I marked with -- around it here.

*** This bug has been marked as a duplicate of bug 125716 ***

Reply via email to