Implement vtable jumps for x86-64.
authorBo Thorsen <bo@suse.co.uk>
Mon, 9 Jul 2001 09:34:43 +0000 (09:34 +0000)
committerBo Thorsen <bo@gcc.gnu.org>
Mon, 9 Jul 2001 09:34:43 +0000 (11:34 +0200)
From-SVN: r43860

gcc/ChangeLog
gcc/config/i386/unix.h

index bd392efa6392f6d70aaccdfb7ae37978ed276081..8e52cfcd62cb6f7ff7aede4d96b13f4231453923 100644 (file)
@@ -1,3 +1,7 @@
+2001-07-09  Bo Thorsen  <bo@suse.co.uk>
+
+       * config/i386/unix.h (ASM_OUTPUT_MI_THUNK): Fix x86-64 vtable support.
+
 2001-07-09  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * final.c (output_addr_const): Use target opening and
index 508d4c89ecead6bb8db83532b62f6515766c27cc..25dec9ab3583d48936d2cc15a176b455478f5214 100644 (file)
@@ -106,7 +106,7 @@ do {                                                                            \
     xops[1] = gen_rtx_MEM (SImode, plus_constant (stack_pointer_rtx, 4));   \
   output_asm_insn ("add{l} {%0, %1|%1, %0}", xops);                        \
                                                                            \
-  if (flag_pic)                                                                    \
+  if (flag_pic && !TARGET_64BIT)                                           \
     {                                                                      \
       xops[0] = pic_offset_table_rtx;                                      \
       xops[1] = gen_label_rtx ();                                          \
@@ -124,6 +124,12 @@ do {                                                                           \
       asm_fprintf (FILE, "\tpop{l\t%%ebx|\t%%ebx}\n");                     \
       asm_fprintf (FILE, "\tjmp\t{*%%ecx|%%ecx}\n");                       \
     }                                                                      \
+  else if (flag_pic && TARGET_64BIT)                                       \
+    {                                                                      \
+      fprintf (FILE, "\tjmp *");                                           \
+      assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0));       \
+      fprintf (FILE, "@GOTPCREL(%RIP)\n");                                 \
+    }                                                                      \
   else                                                                     \
     {                                                                      \
       fprintf (FILE, "\tjmp ");                                                    \