From: Richard Stallman Date: Sat, 20 Mar 1993 06:54:26 +0000 (+0000) Subject: (movqi): In address reg case, if d0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2bb3413d31c03a097df9dd8015a430aa9cdb1926;p=platform%2Fupstream%2Fgcc.git (movqi): In address reg case, if d0 appears in the address, use d1 instead as intermediate reg. From-SVN: r3797 --- diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index dc8c45a..c31ba9b 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -931,10 +931,24 @@ /* Moving a byte into an address register is not possible. */ /* Use d0 as an intermediate, but don't clobber its contents. */ if (ADDRESS_REG_P (operands[0]) && GET_CODE (operands[1]) == MEM) - return \"exg %/d0,%0\;move%.b %1,%/d0\;exg %/d0,%0\"; + { + /* If the address of operand 1 uses d0, choose d1 as intermediate. */ + if (refers_to_regno_p (0, 1, operands[1], NULL_RTX)) + return \"exg %/d1,%0\;move%.b %1,%/d1\;exg %/d1,%0\"; + /* Otherwise d0 is usable. + (An effective address on the 68k can't use two d-regs.) */ + else + return \"exg %/d0,%0\;move%.b %1,%/d0\;exg %/d0,%0\"; + } + /* Likewise for moving from an address reg. */ if (ADDRESS_REG_P (operands[1]) && GET_CODE (operands[0]) == MEM) - return \"exg %/d0,%1\;move%.b %/d0,%0\;exg %/d0,%1\"; + { + if (refers_to_regno_p (0, 1, operands[0], NULL_RTX)) + return \"exg %/d1,%1\;move%.b %/d1,%0\;exg %/d1,%1\"; + else + return \"exg %/d0,%1\;move%.b %/d0,%0\;exg %/d0,%1\"; + } /* clr and st insns on 68000 read before writing. This isn't so on the 68010, but we have no alternative for it. */