diff options
author | coxs <coxs@138bc75d-0d04-0410-961f-82ee72b054a4> | 1996-05-17 17:49:21 +0000 |
---|---|---|
committer | coxs <coxs@138bc75d-0d04-0410-961f-82ee72b054a4> | 1996-05-17 17:49:21 +0000 |
commit | e5a152e481640ee233d80e929e7e509bc391b014 (patch) | |
tree | 7ca4198e489d596bf7b254b7cc229aa91837267a /gcc/config/i386 | |
parent | 39b480923a8707d39627fcb2c1d935c988433a3a (diff) | |
download | gcc-e5a152e481640ee233d80e929e7e509bc391b014.tar.gz |
unix.h (ASM_OUTPUT_MI_THUNK): Define.
{att.h,bsd.h,sun386.h} (ASM_OUTPUT_MI_THUNK): Delete.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12010 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386')
-rw-r--r-- | gcc/config/i386/att.h | 11 | ||||
-rw-r--r-- | gcc/config/i386/bsd.h | 12 | ||||
-rw-r--r-- | gcc/config/i386/sun386.h | 11 | ||||
-rw-r--r-- | gcc/config/i386/unix.h | 41 |
4 files changed, 41 insertions, 34 deletions
diff --git a/gcc/config/i386/att.h b/gcc/config/i386/att.h index 3612cd2acfa..ef095b7a67f 100644 --- a/gcc/config/i386/att.h +++ b/gcc/config/i386/att.h @@ -93,14 +93,3 @@ do \ #define ASM_OUTPUT_LABELREF(FILE,NAME) \ fprintf (FILE, "%s", NAME) -/* Output code to add DELTA to the first argument, and then jump to FUNCTION. - Used for C++ multiple inheritance. */ - -#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ -do { \ - fprintf (FILE, "\taddl $%d,%s\n\tjmp ", DELTA, \ - i386_regparm > 0 ? "%eax" : "4(%esp)"); \ - assemble_name (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \ - fprintf (FILE, "\n"); \ -} while (0) - diff --git a/gcc/config/i386/bsd.h b/gcc/config/i386/bsd.h index 4f8bdfe1459..6bf7399dc31 100644 --- a/gcc/config/i386/bsd.h +++ b/gcc/config/i386/bsd.h @@ -123,18 +123,6 @@ Boston, MA 02111-1307, USA. */ #define ASM_OUTPUT_LABELREF(FILE,NAME) fprintf (FILE, "_%s", NAME) #endif /* not NO_UNDERSCORES */ -/* Output code to add DELTA to the first argument, and then jump to FUNCTION. - Used for C++ multiple inheritance. */ - -#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ -do { \ - fprintf (FILE, "\taddl $%d,%s\n\tjmp ", DELTA, \ - i386_regparm > 0 ? "%eax" : "4(%esp)"); \ - assemble_name (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \ - fprintf (FILE, "\n"); \ -} while (0) - - /* Sequent has some changes in the format of DBX symbols. */ #define DBX_NO_XREFS 1 diff --git a/gcc/config/i386/sun386.h b/gcc/config/i386/sun386.h index 0046e740324..6e2680789bd 100644 --- a/gcc/config/i386/sun386.h +++ b/gcc/config/i386/sun386.h @@ -141,14 +141,3 @@ do \ #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ fprintf (FILE, ".%s%d:\n", PREFIX, NUM) - -/* Output code to add DELTA to the first argument, and then jump to FUNCTION. - Used for C++ multiple inheritance. */ - -#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ -do { \ - fprintf (FILE, "\taddl $%d,%s\n\tjmp ", DELTA, \ - i386_regparm > 0 ? "%eax" : "4(%esp)"); \ - assemble_name (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \ - fprintf (FILE, "\n"); \ -} while (0) diff --git a/gcc/config/i386/unix.h b/gcc/config/i386/unix.h index f38fe270d89..237ff9a6423 100644 --- a/gcc/config/i386/unix.h +++ b/gcc/config/i386/unix.h @@ -146,3 +146,44 @@ Boston, MA 02111-1307, USA. */ #define FUNCTION_VALUE_REGNO_P(N) \ ((N) == 0 || ((N)== FIRST_FLOAT_REG && TARGET_FLOAT_RETURNS_IN_80387)) +/* Output code to add DELTA to the first argument, and then jump to FUNCTION. + Used for C++ multiple inheritance. */ +#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ +do { \ + tree parm; \ + \ + if (i386_regparm > 0) \ + parm = TYPE_ARG_TYPES (TREE_TYPE (function)); \ + else \ + parm = NULL_TREE; \ + for (; parm; parm = TREE_CHAIN (parm)) \ + if (TREE_VALUE (parm) == void_type_node) \ + break; \ + fprintf (FILE, "\taddl $%d,%s\n", DELTA, parm ? "%eax" : "4(%esp)"); \ + \ + if (flag_pic) \ + { \ + rtx xops[2]; \ + xops[0] = pic_offset_table_rtx; \ + xops[1] = (rtx) gen_label_rtx (); \ + \ + if (i386_regparm > 2) \ + abort (); \ + output_asm_insn ("push%L0 %0", xops); \ + output_asm_insn (AS1 (call,%P1), xops); \ + ASM_OUTPUT_INTERNAL_LABEL (FILE, "L", CODE_LABEL_NUMBER (xops[1])); \ + output_asm_insn (AS1 (pop%L0,%0), xops); \ + output_asm_insn ("addl $_GLOBAL_OFFSET_TABLE_+[.-%P1],%0", xops); \ + fprintf (FILE, "\tmovl "); \ + assemble_name \ + (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \ + fprintf (FILE, "@GOT(%%ebx),%%ecx\n\tpopl %%ebx\n\tjmp *%%ecx\n"); \ + } \ + else \ + { \ + fprintf (FILE, "\tjmp "); \ + assemble_name \ + (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \ + fprintf (FILE, "\n"); \ + } \ +} while (0) |