linux-mips
[Top] [All Lists]

A patch for mips.md

To: gcc-patches@gcc.gnu.org
Subject: A patch for mips.md
From: "H . J . Lu" <hjl@lucon.org>
Date: Wed, 6 Jun 2001 14:40:31 -0700
Cc: linux-mips@oss.sgi.com
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mutt/1.2.5i
On Linux/mips, I got

# gcc -O0  -c gcc/testsuite/gcc.c-torture/compile/20010107-1.c
/tmp/cc42wjvw.s: Assembler messages:
/tmp/cc42wjvw.s:22: Error: illegal operands `move

This patch seems to work for me.


H.J.
---
2001-06-06  H.J. Lu  (hjl@gnu.org)

        * config/mips/mips.md (call_internal2): Use "lw" if the target
        is not a register.
        (call_value_internal2): Likewise.
        (call_value_multiple_internal2): Likewise.

--- gcc/config/mips/mips.md.call        Fri Jun  1 23:28:12 2001
+++ gcc/config/mips/mips.md     Fri Jun  1 23:35:45 2001
@@ -9547,6 +9547,8 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j
     }
   else if (GET_CODE (target) == CONST_INT)
     return \"li\\t%^,%0\\n\\tjal\\t%2,%^\";
+  else if (GET_CODE (target) != REG)
+    return \"lw\\t%^,%0\\n\\tjal\\t%2,%^\";
   else if (REGNO (target) != PIC_FUNCTION_ADDR_REGNUM)
     return \"move\\t%^,%0\\n\\tjal\\t%2,%^\";
   else
@@ -9755,6 +9757,8 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j
     }
   else if (GET_CODE (target) == CONST_INT)
     return \"li\\t%^,%1\\n\\tjal\\t%3,%^\";
+  else if (GET_CODE (target) != REG)
+    return \"lw\\t%^,%1\\n\\tjal\\t%3,%^\";
   else if (REGNO (target) != PIC_FUNCTION_ADDR_REGNUM)
     return \"move\\t%^,%1\\n\\tjal\\t%3,%^\";
   else
@@ -9890,6 +9894,8 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j
     }
   else if (GET_CODE (target) == CONST_INT)
     return \"li\\t%^,%1\\n\\tjal\\t%4,%^\";
+  else if (GET_CODE (target) != REG)
+    return \"lw\\t%^,%1\\n\\tjal\\t%4,%^\";
   else if (REGNO (target) != PIC_FUNCTION_ADDR_REGNUM)
     return \"move\\t%^,%1\\n\\tjal\\t%4,%^\";
   else

<Prev in Thread] Current Thread [Next in Thread>
  • A patch for mips.md, H . J . Lu <=