i386.c (output_pic_addr_const): Lowercase rip.
authorRichard Henderson <rth@redhat.com>
Wed, 29 May 2002 20:16:50 +0000 (13:16 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 29 May 2002 20:16:50 +0000 (13:16 -0700)
        * 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
gcc/config/i386/i386.c

index c7942cfffefef17407ec9a5836980b8c86db1b89..a7619317330f13e95a900c4747fe0937f25b167f 100644 (file)
@@ -1,3 +1,9 @@
+2002-05-29  Richard Henderson  <rth@redhat.com>
+
+       * 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  <thorpej@wasabisystems.com>
 
        * config/m68k/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define.
index 7e98741868d85ad2b681a1b9e79f142432edfe6a..5170c99a4c84318f62c415ca004432c9d584e6e6 100644 (file)
@@ -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