From edfe859577f8230c1dc6ff13fcbcf5f93bdbcf14 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 29 May 2002 13:16:50 -0700 Subject: [PATCH] i386.c (output_pic_addr_const): Lowercase rip. * 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. From-SVN: r54017 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c7942cfffef..a7619317330 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-05-29 Richard Henderson + + * 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. + 2002-05-29 Jason Thorpe * config/m68k/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 7e98741868d..5170c99a4c8 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -5826,7 +5826,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); @@ -6619,7 +6619,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 -- 2.30.2