This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: pic problem on the x86
- To: grahams at rcp dot co dot uk
- Subject: Re: pic problem on the x86
- From: Richard Henderson <rth at cygnus dot com>
- Date: Mon, 15 Feb 1999 16:21:19 -0800
- Cc: egcs-patches at egcs dot cygnus dot com
- References: <12738.918937268@hurl.cygnus.com> <19990213132750.A8977@cygnus.com> <36C81356.490C@rcp.co.uk> <19990215103551.A18678@cygnus.com> <36C86C00.350A@rcp.co.uk>
On Mon, Feb 15, 1999 at 06:48:32PM +0000, Graham wrote:
> > > > * i386.c (legitimate_pic_address_disp_p): Remove static.
> > > > * i386.h (LEGITIMATE_PIC_OPERAND_P): Use it instead of
> > > > open-coding cases.
> >
> > I disbelieve this is the cause. I've had this patch applied to
> > a Cygnus branch since November sometime. I actually thought the
> > patch had already been in egcs.
> >
> > Tracking the real culprit now.
The real problem is that gas is lame and does not recognize @GOTOFF
except in a memory context, and so generates incorrect relocations.
The problem is excacerbated by a tiny bit of lameness in addsi3.
Fixing that allows lea in the right place and a complete bootstrap.
r~
* i386.md (addsi3): Allow lea for any constant_p.
Index: i386.md
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/i386/i386.md,v
retrieving revision 1.48
diff -c -p -d -r1.48 i386.md
*** i386.md 1999/02/02 19:06:58 1.48
--- i386.md 1999/02/16 00:12:17
***************
*** 3055,3061 ****
"*
{
if (REG_P (operands[0]) && REG_P (operands[1])
! && (REG_P (operands[2]) || GET_CODE (operands[2]) == CONST_INT)
&& REGNO (operands[0]) != REGNO (operands[1]))
{
if (REG_P (operands[2]) && REGNO (operands[0]) == REGNO (operands[2]))
--- 3055,3061 ----
"*
{
if (REG_P (operands[0]) && REG_P (operands[1])
! && (REG_P (operands[2]) || CONSTANT_P (operands[2]))
&& REGNO (operands[0]) != REGNO (operands[1]))
{
if (REG_P (operands[2]) && REGNO (operands[0]) == REGNO (operands[2]))