This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
A patch for i386.c
- To: egcs-patches at egcs dot cygnus dot com
- Subject: A patch for i386.c
- From: hjl at lucon dot org (H.J. Lu)
- Date: Mon, 13 Sep 1999 10:57:58 -0700 (PDT)
gcc.c-torture/compile/calls.c fails on Solaris/x86 with the native as
and will fail on Linux/x86 with the next Linux binutils since gcc
generates invalid asm code. This patch fixes it.
--
H.J. Lu (hjl@gnu.org)
---
Sat Jul 17 15:27:05 1999 H.J. Lu (hjl@gnu.org)
* config/i386/i386.c (call_insn_operand): Return 0 if the
operand is an integer.
(expander_call_insn_operand): Likewise.
--- /work/gnu/import/gcc-2.95/egcs/gcc/config/i386/i386.c Thu May 27 15:13:20 1999
+++ gcc/config/i386/i386.c Sat Jul 17 16:47:53 1999
@@ -1390,7 +1390,11 @@ call_insn_operand (op, mode)
if (GET_CODE (op) == MEM
&& ((CONSTANT_ADDRESS_P (XEXP (op, 0))
/* This makes a difference for PIC. */
- && general_operand (XEXP (op, 0), Pmode))
+ && general_operand (XEXP (op, 0), Pmode)
+ /* We shouldn't generate "call constant". It doesn't work
+ on Solaris/x86 and Linux/x86 with the latest Linux
+ binutils. It may not work on other x86 platforms. */
+ && GET_CODE (XEXP (op, 0)) != CONST_INT)
|| (GET_CODE (XEXP (op, 0)) == REG
&& XEXP (op, 0) != arg_pointer_rtx
&& ! (REGNO (XEXP (op, 0)) >= FIRST_PSEUDO_REGISTER
@@ -1409,7 +1413,11 @@ expander_call_insn_operand (op, mode)
enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == MEM
- && (CONSTANT_ADDRESS_P (XEXP (op, 0))
+ && ((CONSTANT_ADDRESS_P (XEXP (op, 0))
+ /* We shouldn't generate "call constant". It doesn't work
+ on Solaris/x86 and Linux/x86 with the latest Linux
+ binutils. It may not work on other x86 platforms. */
+ && GET_CODE (XEXP (op, 0)) != CONST_INT)
|| (GET_CODE (XEXP (op, 0)) == REG
&& XEXP (op, 0) != arg_pointer_rtx
&& ! (REGNO (XEXP (op, 0)) >= FIRST_PSEUDO_REGISTER