]> gcc.gnu.org Git - gcc.git/commitdiff
(ASM_OUTPUT_MI_THUNK): Handle functions returning an aggregate.
authorStan Cox <coxs@gnu.org>
Wed, 18 Sep 1996 20:49:46 +0000 (20:49 +0000)
committerStan Cox <coxs@gnu.org>
Wed, 18 Sep 1996 20:49:46 +0000 (20:49 +0000)
From-SVN: r12739

gcc/config/i386/unix.h

index bad6970037f2d84d3bf2f8ea6875393494d73d77..c74f2918dc5347a7baca1ff1b7361a22952d11b3 100644 (file)
@@ -150,42 +150,45 @@ Boston, MA 02111-1307, USA.  */
 
 /* 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");                                              \
-    }                                                                    \
+#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"                                                      \
+          : aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION))) ? "8(%esp)" \
+          : "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)
This page took 0.0583399999999999 seconds and 5 git commands to generate.