x86-64 bootstrap fails on mainline
Richard Henderson
rth@redhat.com
Tue May 28 18:28:00 GMT 2002
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
More information about the Gcc-bugs
mailing list