This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: x86-64 bootstrap fails on mainline
- From: Richard Henderson <rth at redhat dot com>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: gcc-bugs at gcc dot gnu dot org, Jan Hubicka <jh at suse dot cz>
- Date: Tue, 28 May 2002 18:28:03 -0700
- Subject: Re: x86-64 bootstrap fails on mainline
- References: <hobsb62gco.fsf@gee.suse.de>
On Fri, May 24, 2002 at 08:46:15AM +0200, Andreas Jaeger wrote:
> 45 cmpq $0, __cxa_finalize@GOTPCREL(%RIP)(%rip)
> 89 cmpq $0, _Jv_RegisterClasses@GOTPCREL(%RIP)(%rip)
Try this.
Longer term I suggest that the x86-64 port use some UNSPEC_PCREL
relocation marker every place it intends one.
r~
* config/i386/i386.c (output_pic_addr_const): Lowercase rip.
(print_operand_address): Only add rip for symbolic addresses
for which we do not have another relocation type.
Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.410
diff -c -p -d -u -r1.410 i386.c
--- i386.c 28 May 2002 20:27:45 -0000 1.410
+++ i386.c 29 May 2002 01:20:18 -0000
@@ -5822,7 +5822,7 @@ output_pic_addr_const (file, x, code)
fputs ("@GOTOFF", file);
break;
case UNSPEC_GOTPCREL:
- fputs ("@GOTPCREL(%RIP)", file);
+ fputs ("@GOTPCREL(%rip)", file);
break;
case UNSPEC_GOTTPOFF:
fputs ("@GOTTPOFF", file);
@@ -6615,7 +6615,13 @@ print_operand_address (file, addr)
output_addr_const (file, addr);
/* Use one byte shorter RIP relative addressing for 64bit mode. */
- if (GET_CODE (disp) != CONST_INT && TARGET_64BIT)
+ if (TARGET_64BIT
+ && (GET_CODE (addr) == SYMBOL_REF
+ || GET_CODE (addr) == LABEL_REF
+ || (GET_CODE (addr) == CONST
+ && GET_CODE (XEXP (addr, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF
+ && GET_CODE (XEXP (XEXP (addr, 0), 1)) == CONST_INT)))
fputs ("(%rip)", file);
}
else