]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
alpha-protos.h (alpha_output_mi_thunk_osf): Update signature to match target.h.
authorMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 20 Oct 2002 18:52:01 +0000 (18:52 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 20 Oct 2002 18:52:01 +0000 (18:52 +0000)
* alpha-protos.h (alpha_output_mi_thunk_osf): Update signature to
match target.h.
* arm-protos.h, arm.c (arm_output_mi_thunk): Likewise.
* cris-protos.h, cris.c (cris_asm_output_mi_thunk): Likewise.
* frv-protos.h, frv.c (frv_asm_output_mi_thunk): Likewise.
* i386-protos.h, i386.c (x86_output_mi_vcall_thunk,
x86_output_mi_thunk): Likewise.
* i960-protos.h, i960.c (i960_output_mi_thunk): Likewise.
* ia64-protos.h, ia64.c (ia64_output_mi_thunk): Likewise.
* m68k-protos.h, m68k.c (m68k_output_mi_thunk): Likewise.
* mmix-protos.h, mmix.c (mmix_asm_output_mi_thunk): Likewise.
* rs6000-protos.h, rs6000.c (output_mi_thunk): Likewise.
* s390-protos.h, s390.c (s390_output_mi_thunk): Likewise.
* stormy16-protos.h, stormy16.c (xstormy16_asm_output_mi_thunk):
Likewise.
* vax-protos.h, vax.c (vax_output_mi_thunk): Likewise.

* target.h (gcc_target): Update output_mi_thunk and
output_mi_vcall_thunk to take a HOST_WIDE_INT delta and
vcall_index.

* config/alpha/alpha.c: Replace ASM_OUTPUT_MI_THUNK with
TARGET_ASM_OUTPUT_MI_THUNK in comments.
* config/alpha/vms.h (ASM_OUTPUT_MI_THUNK): Don't #undef it.
(TARGET_ASM_OUTPUT_MI_THUNK): #undef it.
* config/frv/frv.h (DEFAULT_VTABLE_THUNKS): Remove definition.
* config/i386/i386-protos.h (x86_output_mi_vcall_thunk): Update
signature.
* config/i386/i386.c (x86_output_mi_vcall_thunk): Likewise.
* config/i386/openbsd.h: Replace ASM_OUTPUT_MI_THUNK with
TARGET_ASM_OUTPUT_MI_THUNK in comments.
* config/i960/i960.h (ASM_OUTPUT_MI_THUNK): Don't define.
(TARGET_ASM_OUTPUT_MI_THUNK): Do define.
* config/m68k/openbsd.h: Replace ASM_OUTPUT_MI_THUNK with
TARGET_ASM_OUTPUT_MI_THUNK in comments.
* config/rs6000/rs6000.c (rs6000_ra_ever_killed): Remove #ifdef
ASM_OUTPUT_MI_THUNK and replace with check of targetm.

* doc/tm.texi (TARGET_ASM_OUTPUT_MI_THUNK): Update signature.
(TARGET_ASM_OUTPU_MI_VCALL_THUNK): Likewise.

From-SVN: r58333

40 files changed:
gcc/ChangeLog
gcc/config/alpha/alpha-protos.h
gcc/config/alpha/alpha.c
gcc/config/alpha/vms.h
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.c
gcc/config/cris/cris-protos.h
gcc/config/cris/cris.c
gcc/config/d30v/d30v.h
gcc/config/frv/frv-protos.h
gcc/config/frv/frv.c
gcc/config/frv/frv.h
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/openbsd.h
gcc/config/i960/i960-protos.h
gcc/config/i960/i960.c
gcc/config/i960/i960.h
gcc/config/ia64/ia64-protos.h
gcc/config/ia64/ia64.c
gcc/config/m68k/m68k-protos.h
gcc/config/m68k/m68k.c
gcc/config/m68k/openbsd.h
gcc/config/mmix/mmix-protos.h
gcc/config/mmix/mmix.c
gcc/config/pa/pa-protos.h
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/config/s390/s390-protos.h
gcc/config/s390/s390.c
gcc/config/sparc/openbsd.h
gcc/config/stormy16/stormy16-protos.h
gcc/config/stormy16/stormy16.c
gcc/config/vax/vax-protos.h
gcc/config/vax/vax.c
gcc/cp/ChangeLog
gcc/cp/method.c
gcc/cp/optimize.c
gcc/doc/tm.texi
gcc/target.h

index 06c5603687cc5c84a28fa1ecaf973aba93289530..871011a429ddd47d3a9001fece1b32a171363712 100644 (file)
@@ -1,3 +1,47 @@
+2002-10-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+            Mark Mitchell  <mark@codesourcery.com>
+
+       * alpha-protos.h (alpha_output_mi_thunk_osf): Update signature to
+       match target.h.
+       * arm-protos.h, arm.c (arm_output_mi_thunk): Likewise.
+       * cris-protos.h, cris.c (cris_asm_output_mi_thunk): Likewise.
+       * frv-protos.h, frv.c (frv_asm_output_mi_thunk): Likewise.
+       * i386-protos.h, i386.c (x86_output_mi_vcall_thunk,
+       x86_output_mi_thunk): Likewise.
+       * i960-protos.h, i960.c (i960_output_mi_thunk): Likewise.
+       * ia64-protos.h, ia64.c (ia64_output_mi_thunk): Likewise.
+       * m68k-protos.h, m68k.c (m68k_output_mi_thunk): Likewise.
+       * mmix-protos.h, mmix.c (mmix_asm_output_mi_thunk): Likewise.
+       * rs6000-protos.h, rs6000.c (output_mi_thunk): Likewise.
+       * s390-protos.h, s390.c (s390_output_mi_thunk): Likewise.
+       * stormy16-protos.h, stormy16.c (xstormy16_asm_output_mi_thunk):
+       Likewise.
+       * vax-protos.h, vax.c (vax_output_mi_thunk): Likewise.
+       
+       * target.h (gcc_target): Update output_mi_thunk and
+       output_mi_vcall_thunk to take a HOST_WIDE_INT delta and
+       vcall_index.
+
+       * config/alpha/alpha.c: Replace ASM_OUTPUT_MI_THUNK with
+       TARGET_ASM_OUTPUT_MI_THUNK in comments.
+       * config/alpha/vms.h (ASM_OUTPUT_MI_THUNK): Don't #undef it.
+       (TARGET_ASM_OUTPUT_MI_THUNK): #undef it.
+       * config/frv/frv.h (DEFAULT_VTABLE_THUNKS): Remove definition.
+       * config/i386/i386-protos.h (x86_output_mi_vcall_thunk): Update
+       signature.
+       * config/i386/i386.c (x86_output_mi_vcall_thunk): Likewise.
+       * config/i386/openbsd.h: Replace ASM_OUTPUT_MI_THUNK with
+       TARGET_ASM_OUTPUT_MI_THUNK in comments.
+       * config/i960/i960.h (ASM_OUTPUT_MI_THUNK): Don't define.
+       (TARGET_ASM_OUTPUT_MI_THUNK): Do define.
+       * config/m68k/openbsd.h: Replace ASM_OUTPUT_MI_THUNK with
+       TARGET_ASM_OUTPUT_MI_THUNK in comments.
+       * config/rs6000/rs6000.c (rs6000_ra_ever_killed): Remove #ifdef
+       ASM_OUTPUT_MI_THUNK and replace with check of targetm.
+
+       * doc/tm.texi (TARGET_ASM_OUTPUT_MI_THUNK): Update signature.
+       (TARGET_ASM_OUTPU_MI_VCALL_THUNK): Likewise.
+       
 2002-10-19  Brad Lucier  <lucier@math.purdue.edu>
 
        * real.c (do_add): Fix 0+0 sign corner case.
index e52e4f461bc5bd51b69be933fe391c4f73e8f338..92b6d5544c72e1915958b2d808483243a0ff84c8 100644 (file)
@@ -141,8 +141,7 @@ extern rtx function_arg PARAMS ((CUMULATIVE_ARGS, enum machine_mode,
                                 tree, int));
 extern void alpha_start_function PARAMS ((FILE *, const char *, tree));
 extern void alpha_end_function PARAMS ((FILE *, const char *, tree));
-extern void alpha_output_mi_thunk_osf PARAMS ((FILE *, tree,
-                                              HOST_WIDE_INT, tree));
+extern void alpha_output_mi_thunk_osf PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
 
 #ifdef REAL_VALUE_TYPE
 extern int check_float_value PARAMS ((enum machine_mode,
index 4e491377ca2b4448a99c92d3ceba7bbf77bbf373..b6bcc324ab3baa33e6038d4b2b068b3975f51d8f 100644 (file)
@@ -6700,10 +6700,11 @@ alpha_sa_mask (imaskP, fmaskP)
   unsigned int i;
 
   /* Irritatingly, there are two kinds of thunks -- those created with
-     ASM_OUTPUT_MI_THUNK and those with DECL_THUNK_P that go through
-     the regular part of the compiler.  In the ASM_OUTPUT_MI_THUNK case
-     we don't have valid register life info, but assemble_start_function
-     wants to output .frame and .mask directives.  */
+     TARGET_ASM_OUTPUT_MI_THUNK and those with DECL_THUNK_P that go
+     through the regular part of the compiler.  In the
+     TARGET_ASM_OUTPUT_MI_THUNK case we don't have valid register life
+     info, but assemble_start_function wants to output .frame and
+     .mask directives.  */
   if (current_function_is_thunk && !no_new_pseudos)
     {
       *imaskP = 0;
index f1b8884df266df900b3a7a01ef488b57c6a1ffdf..8df61564e722c25faee975e8b17c4dd2e3de0563 100644 (file)
@@ -454,7 +454,7 @@ do {                                                                        \
   sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
 
 /* ??? VMS uses different linkage.  */
-#undef ASM_OUTPUT_MI_THUNK
+#undef TARGET_ASM_OUTPUT_MI_THUNK
 
 #undef ASM_SPEC
 #undef ASM_FINAL_SPEC
index eac8dbbbb410690b8ef72ad326b6fb69000910b7..d1fd43b39c7f761821fe64c3d6ca7bc991d9cc6f 100644 (file)
@@ -194,7 +194,7 @@ extern int  arm_dllexport_p                 PARAMS ((tree));
 extern int  arm_dllimport_p            PARAMS ((tree));
 extern void arm_mark_dllexport                 PARAMS ((tree));
 extern void arm_mark_dllimport                 PARAMS ((tree));
-extern void arm_output_mi_thunk         PARAMS ((FILE *, tree, int, tree));
+extern void arm_output_mi_thunk         PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
 #endif
 
 extern void arm_init_builtins          PARAMS ((void));
index 6971a53b2d949fba4094ba66f1d644b686cc8635..fa046e10860b8a847f37b49db1069c2dda9c678f 100644 (file)
@@ -11135,7 +11135,7 @@ void
 arm_output_mi_thunk (file, thunk, delta, function)
      FILE *file;
      tree thunk ATTRIBUTE_UNUSED;
-     int delta;
+     HOST_WIDE_INT delta;
      tree function;
 {
   int mi_delta = delta;
index 4db5a2a54b4a1fc1232e9df8145b2f45b0557f36..a86ae714bd8a5e21d92f929452ece28ebe66cb11 100644 (file)
@@ -54,7 +54,7 @@ extern rtx cris_expand_builtin_va_arg PARAMS ((tree, tree));
 
 #ifdef STDIO_INCLUDED
 # ifdef TREE_CODE
-extern void cris_asm_output_mi_thunk PARAMS ((FILE *, tree, int, tree));
+extern void cris_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
 # endif
 #endif
 
index 7edd8bd1916addbae596928357de4ff864bc87f3..4128742a5bc25d90d9885f677738ed908207453b 100644 (file)
@@ -2570,23 +2570,27 @@ cris_override_options ()
   init_machine_status = cris_init_machine_status;
 }
 
-/* The ASM_OUTPUT_MI_THUNK worker.  */
+/* The TARGET_ASM_OUTPUT_MI_THUNK worker.  */
 
 void
 cris_asm_output_mi_thunk (stream, thunkdecl, delta, funcdecl)
      FILE *stream;
      tree thunkdecl ATTRIBUTE_UNUSED;
-     int delta;
+     HOST_WIDE_INT delta;
      tree funcdecl;
 {
   if (delta > 0)
-    fprintf (stream, "\tadd%s %d,$%s\n",
-            ADDITIVE_SIZE_MODIFIER (delta), delta,
-            reg_names[CRIS_FIRST_ARG_REG]);
+    {
+      fprintf (stream, "\tadd%s ", ADDITIVE_SIZE_MODIFIER (delta));
+      fprintf (stream, HOST_WIDE_INT_PRINT_DEC, delta);
+      fprintf (stream, ",$%s\n", reg_names[CRIS_FIRST_ARG_REG]);
+    }
   else if (delta < 0)
-    fprintf (stream, "\tsub%s %d,$%s\n",
-            ADDITIVE_SIZE_MODIFIER (-delta), -delta,
-            reg_names[CRIS_FIRST_ARG_REG]);
+    {
+      fprintf (stream, "\tsub%s ", ADDITIVE_SIZE_MODIFIER (-delta));
+      fprintf (stream, HOST_WIDE_INT_PRINT_DEC, -delta);
+      fprintf (stream, ",$%s\n", reg_names[CRIS_FIRST_ARG_REG]);
+    }
 
   if (flag_pic)
     {
index dc0ac2099758b88c0e454ebb09d561c5b506af41..32cff3c2bb5460e7519aa57252f02b08e28773ec 100644 (file)
@@ -1908,7 +1908,7 @@ typedef struct d30v_stack {
    frontend will generate a less efficient heavyweight thunk that calls
    FUNCTION instead of jumping to it.  The generic approach does not support
    varargs.  */
-/* #define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) */
+/* #define TARGET_ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) */
 
 /* A C structure for machine-specific, per-function data.
    This is added to the cfun structure.  */
index c3f13f5772d4e25a461f97efadee5598ca904aee..5965c58b29594cf5eeff4ca1ea8b8c43948153db 100644 (file)
@@ -115,8 +115,7 @@ extern rtx frv_index_memory                 PARAMS ((rtx,
                                                         int));
 
 #ifdef TREE_CODE
-extern void frv_asm_output_mi_thunk            PARAMS ((FILE *, tree, long,
-                                                        tree));
+extern void frv_asm_output_mi_thunk            PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
 #endif /* TREE_CODE */
 
 extern const char *frv_asm_output_opcode
index a49b1572669eb629ff1f96471348ce7704248b41..39a1cd77b98d79dd70164b18c0b43ff489a2b7bd 100644 (file)
@@ -1870,7 +1870,7 @@ void
 frv_asm_output_mi_thunk (file, thunk_fndecl, delta, function)
      FILE *file;
      tree thunk_fndecl ATTRIBUTE_UNUSED;
-     long delta;
+     HOST_WIDE_INT delta;
      tree function;
 {
   const char *name_func = XSTR (XEXP (DECL_RTL (function), 0), 0);
@@ -1880,12 +1880,16 @@ frv_asm_output_mi_thunk (file, thunk_fndecl, delta, function)
 
   /* Do the add using an addi if possible */
   if (IN_RANGE_P (delta, -2048, 2047))
-    fprintf (file, "\taddi %s,#%ld,%s\n", name_arg0, delta, name_arg0);
+    fprintf (file, "\taddi %s,#%d,%s\n", name_arg0, (int) delta, name_arg0);
   else
     {
       const char *name_add = reg_names[TEMP_REGNO];
-      fprintf (file, "\tsethi%s #hi(%ld),%s\n", parallel, delta, name_add);
-      fprintf (file, "\tsetlo #lo(%ld),%s\n", delta, name_add);
+      fprintf (file, "\tsethi%s #hi(", parallel);
+      fprintf (file, HOST_WIDE_INT_PRINT_DEC, delta);
+      fprintf (file, "),%s\n", name_add);
+      fprintf (file, "\tsetlo #lo(");
+      fprintf (file, HOST_WIDE_INT_PRINT_DEC, delta);
+      fprintf (file, "),%s\n", name_add);
       fprintf (file, "\tadd %s,%s,%s\n", name_add, name_arg0, name_arg0);
     }
 
index 8fc43a4687953c560db687db3314dc94f59b7b98..f8c2755f1c37f3a35a3be1b78edeb410d25b42d0 100644 (file)
@@ -748,18 +748,6 @@ extern int g_switch_set;          /* whether -G xx was passed.  */
    Defined in svr4.h.  */
 #define PCC_BITFIELD_TYPE_MATTERS 1
 
-/* GNU CC supports two ways of implementing C++ vtables: traditional or with
-   so-called "thunks".  The flag `-fvtable-thunk' chooses between them.  Define
-   this macro to be a C expression for the default value of that flag.  If
-   `DEFAULT_VTABLE_THUNKS' is 0, GNU CC uses the traditional implementation by
-   default.  The "thunk" implementation is more efficient (especially if you
-   have provided an implementation of `ASM_OUTPUT_MI_THUNK', but is not binary
-   compatible with code compiled using the traditional implementation.  If you
-   are writing a new ports, define `DEFAULT_VTABLE_THUNKS' to 1.
-
-   If you do not define this macro, the default for `-fvtable-thunk' is 0.  */
-#define DEFAULT_VTABLE_THUNKS 1
-
 \f
 /* Layout of Source Language Data Types.  */
 
index c3b7c308349e168eca138fb75970f89fcadff2c1..b38a65ac7dcb9c676110a97cfd1ec8362845071f 100644 (file)
@@ -211,8 +211,8 @@ extern tree ix86_handle_shared_attribute PARAMS ((tree *, tree, tree, int, bool
 extern unsigned int i386_pe_section_type_flags PARAMS ((tree, const char *,
                                                        int));
 extern void i386_pe_asm_named_section PARAMS ((const char *, unsigned int));
-extern void x86_output_mi_thunk PARAMS ((FILE *, tree, int, tree));
-extern void x86_output_mi_vcall_thunk PARAMS ((FILE *, tree, int, int, tree));
+extern void x86_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
+extern void x86_output_mi_vcall_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
 extern int x86_field_alignment PARAMS ((tree, int));
 #endif
 
index 11602573dd4fbdacc3ce5659473e1ebf2044064a..299bd826326228ef9ea523a2bfb8379b27fe8310 100644 (file)
@@ -13906,8 +13906,8 @@ void
 x86_output_mi_vcall_thunk (file, thunk, delta, vcall_index, function)
      FILE *file;
      tree thunk ATTRIBUTE_UNUSED;
-     int delta;
-     int vcall_index;
+     HOST_WIDE_INT delta;
+     HOST_WIDE_INT vcall_index;
      tree function;
 {
   rtx xops[3];
@@ -14010,7 +14010,7 @@ void
 x86_output_mi_thunk (file, thunk, delta, function)
      FILE *file;
      tree thunk;
-     int delta;
+     HOST_WIDE_INT delta;
      tree function;
 {
   x86_output_mi_vcall_thunk (file, thunk, delta, /*vcall_index=*/0, 
index 8f54026539b001a6a3c5188b529820eacaeced36..b792450d1f7540a8c44a5330917d7cca601d9ea9 100644 (file)
@@ -97,7 +97,7 @@ Boston, MA 02111-1307, USA.  */
 #undef ASM_PREFERRED_EH_DATA_FORMAT
 
 
-/* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h.  */
+/* Note that we pick up TARGET_ASM_OUTPUT_MI_THUNK from unix.h.  */
 
 #undef ASM_COMMENT_START
 #define ASM_COMMENT_START ";#"
index b7b74dc013029c1afd97bcfd9787129e561f5830..594e07dd190cb8560e8776a113503cf578e00f0f 100644 (file)
@@ -86,7 +86,7 @@ extern void i960_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, enum machine
 extern tree i960_build_va_list PARAMS ((void));
 extern int i960_final_reg_parm_stack_space PARAMS ((int, tree));
 extern int i960_reg_parm_stack_space PARAMS ((tree));
-extern void i960_output_mi_thunk PARAMS ((FILE *, tree, int, tree));
+extern void i960_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
 #endif /* TREE_CODE */
 
 extern int process_pragma PARAMS ((int(*)(void), void(*)(int), const char *));
index fe38d45c5a2d9e855e65ee0ba349b96271f86992..40717783d55ea6cf14500fe4d31f07eed319d240 100644 (file)
@@ -2829,7 +2829,7 @@ void
 i960_output_mi_thunk (file, thunk, delta, function)
      FILE *file;
      tree thunk ATTRIBUTE_UNUSED;
-     int delta;
+     HOST_WIDE_INT delta;
      tree function;
 {
   int d = delta;
index 11932e967f870c3520c83f905dee188b66aea3d1..ac24ece0fa93b7ca46208dce7aa2fddc6582a75f 100644 (file)
@@ -1466,4 +1466,4 @@ extern int rtx_equal_function_value_matters;
 
 /* Output code to add DELTA to the first argument, and then jump to FUNCTION.
    Used for C++ multiple inheritance.  */
-#define ASM_OUTPUT_MI_THUNK i960_output_mi_thunk
+#define TARGET_ASM_OUTPUT_MI_THUNK i960_output_mi_thunk
index 6efb266a83b1501d2f733c23bb7a93b51d39b31f..c4a43cc03081d13cfa1bc2635ca87fe4bd487152 100644 (file)
@@ -121,7 +121,7 @@ extern int ia64_function_arg_pass_by_reference PARAMS((CUMULATIVE_ARGS *,
                                                       tree, int));
 extern int ia64_return_in_memory PARAMS((tree));
 extern void ia64_asm_output_external PARAMS((FILE *, tree, const char *));
-extern void ia64_output_mi_thunk PARAMS((FILE *, tree, int, tree));
+extern void ia64_output_mi_thunk PARAMS((FILE *, tree, HOST_WIDE_INT, tree));
 #endif /* TREE_CODE */
 
 extern int ia64_register_move_cost PARAMS((enum machine_mode, enum reg_class,
index 5fa9927f157045e025e5ae518cb3788dd9510570..2b74f433e5b69010e9a1fac42576937cc3c55fa1 100644 (file)
@@ -8163,7 +8163,7 @@ void
 ia64_output_mi_thunk (file, thunk, delta, function)
      FILE *file;
      tree thunk ATTRIBUTE_UNUSED;
-     int delta;
+     HOST_WIDE_INT delta;
      tree function;
 {
   if (CONST_OK_FOR_I (delta))                                          
index 33accb90b7f30febc87f0f1a691f3542eee277b5..3beec986ae480af3c5b5231b7e68e46468296658 100644 (file)
@@ -65,7 +65,7 @@ extern rtx legitimize_pic_address PARAMS ((rtx, enum machine_mode, rtx));
 #endif /* RTX_CODE */
 
 #ifdef TREE_CODE
-extern void m68k_output_mi_thunk PARAMS ((FILE *, tree, int, tree));
+extern void m68k_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
 #endif /* TREE_CODE */
 
 extern int flags_in_68881 PARAMS ((void));
index 8a1a729283867ac99497aa8271c7fba680bdd22c..f5fb6cf829fe4eea0ea6ee2b11148c405df79cec 100644 (file)
@@ -3840,15 +3840,19 @@ void
 m68k_output_mi_thunk (file, thunk, delta, function)
      FILE *file;
      tree thunk ATTRIBUTE_UNUSED;
-     int delta;
+     HOST_WIDE_INT d;
      tree function;
 {
   if (delta > 0 && delta <= 8)                                         
-    asm_fprintf (file, "\taddq.l %I%d,4(%Rsp)\n", delta);              
+    asm_fprintf (file, "\taddq.l %I%d,4(%Rsp)\n", (int) delta);
   else if (delta < 0 && delta >= -8)                                   
-    asm_fprintf (file, "\tsubq.l %I%d,4(%Rsp)\n", -delta);             
+    asm_fprintf (file, "\tsubq.l %I%d,4(%Rsp)\n", (int) -delta);
   else                                                                 
-    asm_fprintf (file, "\tadd.l %I%d,4(%Rsp)\n", delta);               
+    {
+      asm_fprintf (file, "\tadd.l %I");
+      fprintf (file, HOST_WIDE_INT_PRINT_DEC, delta);          
+      asm_fprintf (file, ",4(%Rsp)\n", delta);         
+    }
                                                                        
   if (flag_pic)                                                                
     {                                                                  
index 666350f8bb260488bb9d2693075ed913fd8ada6a..8d62bdd6fd1574f6260bd3f242d21f9ebcbe7221 100644 (file)
@@ -1,5 +1,5 @@
 /* Configuration file for an m68k OpenBSD target.
-   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -86,7 +86,7 @@ Boston, MA 02111-1307, USA.  */
 #define DWARF2_UNWIND_INFO 0
 
 
-/* TODO: ASM_OUTPUT_MI_THUNK is busted. I need to figure out 
+/* TODO: TARGET_ASM_OUTPUT_MI_THUNK is busted. I need to figure out 
    what bra func@PLTPC means under linux, and find the corresponding 
    construction for our gas/pic setup.  */
 #if 0
@@ -95,7 +95,7 @@ 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)       \
+#define TARGET_ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION)        \
 do {                                                                   \
   if (DELTA > 0 && DELTA <= 8)                                         \
     asm_fprintf (FILE, "\taddq.l %I%d,4(%Rsp)\n", DELTA);              \
index e8ef95e9895b8a13118ae13e8431b217ce5a9569..0328df183d3f64e2743282218f96c61592a1d996 100644 (file)
@@ -80,7 +80,7 @@ extern void mmix_asm_output_aligned_local
   PARAMS ((FILE *, const char *, int, int));
 extern void mmix_asm_declare_register_global
   PARAMS ((FILE *, tree, int, const char *));
-extern void mmix_asm_output_mi_thunk PARAMS ((FILE *, tree, int, tree));
+extern void mmix_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
 
 /* Need tree.h and rtl.h */
 # ifdef RTX_CODE
index be1d25ef4de9c88f4f4124dffd20ecaab18d7d3e..e79e873f31690495d3855ed3d92ed25dd4762bbe 100644 (file)
@@ -770,13 +770,13 @@ mmix_target_asm_function_epilogue (stream, locals_size)
   fputc ('\n', stream);
 }
 
-/* ASM_OUTPUT_MI_THUNK.  */
+/* TARGET_ASM_OUTPUT_MI_THUNK.  */
 
 void
 mmix_asm_output_mi_thunk (stream, fndecl, delta, func)
      FILE * stream;
      tree fndecl ATTRIBUTE_UNUSED;
-     int delta;
+     HOST_WIDE_INT delta;
      tree func;
 {
   /* If you define STRUCT_VALUE to 0, rather than use STRUCT_VALUE_REGNUM,
@@ -785,9 +785,9 @@ mmix_asm_output_mi_thunk (stream, fndecl, delta, func)
   const char *regname = reg_names[MMIX_FIRST_INCOMING_ARG_REGNUM];
 
   if (delta >= 0 && delta < 65536)
-    fprintf (stream, "\tINCL %s,%d\n", regname, delta);
+    fprintf (stream, "\tINCL %s,%d\n", regname, (int)delta);
   else if (delta < 0 && delta >= -255)
-    fprintf (stream, "\tSUBU %s,%s,%d\n", regname, regname, -delta);
+    fprintf (stream, "\tSUBU %s,%s,%d\n", regname, regname, (int)-delta);
   else
     {
       mmix_output_register_setting (stream, 255, delta, 1);
index 89942f5c2d6da0cad5965ce778579c263c0400f5..bbdd6891e4bd9d7b2633629ab609df92f42ea83d 100644 (file)
@@ -126,7 +126,7 @@ extern int eq_neq_comparison_operator PARAMS ((rtx, enum machine_mode));
 extern int insn_refs_are_delayed PARAMS ((rtx));
 #endif /* RTX_CODE */
 
-/* Prototype function used in macro ASM_OUTPUT_MI_THUNK.  */
+/* Prototype function used in macro TARGET_ASM_OUTPUT_MI_THUNK.  */
 extern void pa_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
 
 /* Prototype function used in macro CONST_OK_FOR_LETTER_P.  */
index 7dc0f9f77425629d82e87b611b09c94ec2ffb1f9..08540e37348c3f20dec9b9d47b297ed69572ab8a 100644 (file)
@@ -150,7 +150,7 @@ extern void setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
                                            enum machine_mode, tree,
                                            int *, int));
 extern struct rtx_def *rs6000_va_arg PARAMS ((tree, tree));
-extern void output_mi_thunk PARAMS ((FILE *, tree, int, tree));
+extern void output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
 extern int function_ok_for_sibcall PARAMS ((tree));
 #ifdef ARGS_SIZE_RTX
 /* expr.h defines ARGS_SIZE_RTX and `enum direction' */
index 73b8db111ef04d5ee34d2b94faaec7cd48bd607c..dcee67b020a8906bdeb433b849023b386e845eee 100644 (file)
@@ -9456,10 +9456,9 @@ rs6000_ra_ever_killed ()
   rtx reg;
   rtx insn;
 
-#ifdef ASM_OUTPUT_MI_THUNK
-  if (current_function_is_thunk)
+  if (targetm.asm_out.output_mi_thunk && current_function_is_thunk)
     return 0;
-#endif
+
   /* regs_ever_live has LR marked as used if any sibcalls are present,
      but this should not force saving and restoring in the
      pro/epilogue.  Likewise, reg_set_between_p thinks a sibcall
@@ -11236,7 +11235,7 @@ void
 output_mi_thunk (file, thunk_fndecl, delta, function)
      FILE *file;
      tree thunk_fndecl ATTRIBUTE_UNUSED;
-     int delta;
+     HOST_WIDE_INT delta;
      tree function;
 {
   const char *this_reg =
@@ -11254,9 +11253,9 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
   if (delta >= -32768 && delta <= 32767)
     {
       if (! TARGET_NEW_MNEMONICS)
-       fprintf (file, "\tcal %s,%d(%s)\n", this_reg, delta, this_reg);
+       fprintf (file, "\tcal %s,%d(%s)\n", this_reg, (int) delta, this_reg);
       else
-       fprintf (file, "\taddi %s,%s,%d\n", this_reg, this_reg, delta);
+       fprintf (file, "\taddi %s,%s,%d\n", this_reg, this_reg, (int) delta);
     }
 
   /* 64-bit constants.  If "int" is 32 bits, we'll never hit this abort.  */
@@ -11266,7 +11265,7 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
   /* Large constants that can be done by one addis instruction.  */
   else if ((delta & 0xffff) == 0)
     asm_fprintf (file, "\t{cau|addis} %s,%s,%d\n", this_reg, this_reg,
-                delta >> 16);
+                (int) (delta >> 16));
 
   /* 32-bit constants that can be done by an add and addis instruction.  */
   else
index a906d446333e1e5e26387d7da0f8fd9f157aab79..c85349df546ab577e33da29a0e31628174c49dac 100644 (file)
@@ -86,7 +86,7 @@ extern tree s390_build_va_list PARAMS ((void));
 extern rtx s390_function_arg PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
 extern void s390_va_start PARAMS ((tree, rtx));
 extern rtx s390_va_arg PARAMS ((tree, tree));
-extern void s390_output_mi_thunk PARAMS ((FILE *, tree, int, tree));
+extern void s390_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
 #endif /* RTX_CODE */
 #endif /* TREE_CODE */
 
index f7404bc7ba74dac14f39ad6d8302eb0221df99b8..420912787fd4dbf3a4922e2bae8a4e17c3e478c0 100644 (file)
@@ -5587,7 +5587,7 @@ void
 s390_output_mi_thunk (file, thunk, delta, function)
      FILE *file;
      tree thunk ATTRIBUTE_UNUSED;
-     int delta;
+     HOST_WIDE_INT delta;
      tree function;
 {
   if (TARGET_64BIT)                                                           
index 96d2f149a72666ddd57e5a9286fcb0861d9e792e..1a53cd14d0e9fe51b54f6e73d2cafd6693e53a9e 100644 (file)
@@ -1,5 +1,5 @@
 /* Configuration file for sparc OpenBSD target.
-   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -64,4 +64,4 @@ Boston, MA 02111-1307, USA.  */
 
 #undef ASM_PREFERRED_EH_DATA_FORMAT
 
-/* Default sparc.h does already define ASM_OUTPUT_MI_THUNK */
+/* Default sparc.h does already define TARGET_ASM_OUTPUT_MI_THUNK */
index dc58871a573f4e02c759e2c77f6604ee01472d65..9f2ea2cababbe0bec2dc17b97368a5c04320405e 100644 (file)
@@ -45,7 +45,7 @@ extern void    xstormy16_expand_builtin_va_start PARAMS ((tree, rtx));
 extern rtx     xstormy16_expand_builtin_va_arg PARAMS ((tree, tree));
 extern void    xstormy16_initialize_trampoline PARAMS ((rtx, rtx, rtx));
 extern rtx     xstormy16_function_value PARAMS ((tree, tree));
-extern void    xstormy16_asm_output_mi_thunk PARAMS ((FILE *, tree, int, tree));
+extern void    xstormy16_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
 #endif
 
 #ifdef RTX_CODE
index 62b8656730d99892c2e14cd252456e14f5593694..58d7ae418a53a0ea36e9871817eb17f3294f9efb 100644 (file)
@@ -1384,7 +1384,7 @@ void
 xstormy16_asm_output_mi_thunk (file, thunk_fndecl, delta, function)
      FILE *file;
      tree thunk_fndecl ATTRIBUTE_UNUSED;
-     int delta;
+     HOST_WIDE_INT delta;
      tree function;
 {
   int regnum = FIRST_ARGUMENT_REGISTER;
@@ -1393,7 +1393,7 @@ xstormy16_asm_output_mi_thunk (file, thunk_fndecl, delta, function)
   if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function))))
     regnum += 1;
   
-  fprintf (file, "\tadd %s,#0x%x\n", reg_names[regnum], (delta) & 0xFFFF);
+  fprintf (file, "\tadd %s,#0x%x\n", reg_names[regnum], (int) delta & 0xFFFF);
   fputs ("\tjmpf ", file);
   assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
   putc ('\n', file);
index 928a2ab6554be6fa9483ad599b9343569655de16..68723086f0878efaf7b684a743350ba9f0c59ed7 100644 (file)
@@ -36,7 +36,7 @@ extern int check_float_value PARAMS ((enum machine_mode, REAL_VALUE_TYPE *, int)
 
 #ifdef TREE_CODE
 extern void vms_check_external PARAMS ((tree, const char *, int));
-extern void vax_output_mi_thunk PARAMS ((FILE *, tree, int, tree));
+extern void vax_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
 #endif /* TREE_CODE */
 
 extern void vms_flush_pending_externals PARAMS ((FILE *));
index 35718813f3edc67adeda1caae26134ceb1c0b130..43ad73cdece976f0b526f561b9c6022c11cd233e 100644 (file)
@@ -997,11 +997,13 @@ void
 vax_output_mi_thunk (file, thunk, delta, function)
      FILE *file;
      tree thunk ATTRIBUTE_UNUSED;
-     int delta;
+     HOST_WIDE_INT delta;
      tree function;
 {
   fprintf (file, "\t.word 0x0ffc\n");                                  
-  asm_fprintf (file, "\taddl2 $%d,4(%Rap)\n", delta);                  
+  fprintf (file, "\taddl2 $");
+  fprintf (file, HOST_WIDE_INT_PRINT_DEC, delta);
+  asm_fprintf (file, ",4(%Rap)\n");
   fprintf (file, "\tjmp ");                                            
   assemble_name (file,  XSTR (XEXP (DECL_RTL (function), 0), 0));      
   fprintf (file, "+2\n");                                              
index 8a7eec836573dd36df3c9edfd208424bb8bc4b15..bbe1ae8f9f618fc98874962ab969aded3888b8e5 100644 (file)
@@ -1,3 +1,9 @@
+2002-10-20  Mark Mitchell  <mark@codesourcery.com>
+
+       * method.c (use_thunk): Compute the vcall index as a HOST_WIDE_INT.
+       * optimize.c (optimize_function): Replace ASM_OUTPUT_MI_THUNK with
+       TARGET_ASM_OUTPUT_MI_THUNK in comments.
+       
 2002-10-18  Zack Weinberg  <zack@codesourcery.com>
 
        * decl.c (start_decl): Point users of the old initialized-
index 5d14f57e7f32d1686b3456ba3bc5917de5395515..cb88833ab23e42bb4efcd27afebe0facc2d413e1 100644 (file)
@@ -422,9 +422,12 @@ use_thunk (thunk_fndecl, emit_p)
       assemble_start_function (thunk_fndecl, fnname);
       if (targetm.asm_out.output_mi_vcall_thunk)
        {
-         int vcall_value = (vcall_offset
-                            ? tree_low_cst (vcall_offset, /*pos=*/0)
-                            : 0);
+         HOST_WIDE_INT vcall_value;
+
+         if (vcall_offset)
+           vcall_value = tree_low_cst (vcall_offset, /*pos=*/0);
+         else
+           vcall_value = 0;
          targetm.asm_out.output_mi_vcall_thunk (asm_out_file, 
                                                 thunk_fndecl, delta, 
                                                 vcall_value,
index 0910bef6e125ce68113e63c104707489862a0938..6fbcc2be192439b736d721fc5706ec071bbe8352 100644 (file)
@@ -1,5 +1,5 @@
 /* Perform optimizations on tree structure.
-   Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
    Written by Mark Michell (mark@codesourcery.com).
 
 This file is part of GNU CC.
@@ -64,7 +64,7 @@ optimize_function (fn)
       /* We do not inline thunks, as (a) the backend tries to optimize
          the call to the thunkee, (b) tree based inlining breaks that
          optimization, (c) virtual functions are rarely inlineable,
-         and (d) ASM_OUTPUT_MI_THUNK is there to DTRT anyway.  */
+         and (d) TARGET_ASM_OUTPUT_MI_THUNK is there to DTRT anyway.  */
       && !DECL_THUNK_P (fn))
     {
       optimize_inline_calls (fn);
index 74231e255ea656affb5b4b0577ad6bb9e7b1f21b..5ca0836de07aa021a0039b0e949e535bc16f3899 100644 (file)
@@ -4154,7 +4154,7 @@ You need not define this macro if you did not define
 @end table
 
 @findex TARGET_ASM_OUTPUT_MI_THUNK
-@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_MI_THUNK (FILE *@var{file}, tree @var{thunk_fndecl}, int @var{delta}, tree @var{function})
+@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_MI_THUNK (FILE *@var{file}, tree @var{thunk_fndecl}, HOST_WIDE_INT @var{delta}, tree @var{function})
 A function that outputs the assembler code for a thunk
 function, used to implement C++ virtual function calls with multiple
 inheritance.  The thunk acts as a wrapper around a virtual function,
@@ -4189,7 +4189,7 @@ not support varargs.
 @end deftypefn
 
 @findex TARGET_ASM_OUTPUT_MI_VCALL_THUNK
-@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_MI_VCALL_THUNK (FILE *@var{file}, tree @var{thunk_fndecl}, int @var{delta}, int @var{vcall_offset}, tree @var{function})
+@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_MI_VCALL_THUNK (FILE *@var{file}, tree @var{thunk_fndecl}, HOST_WIDE_INT @var{delta}, int @var{vcall_offset}, tree @var{function})
 A function like @code{TARGET_ASM_OUTPUT_MI_THUNK}, except that if
 @var{vcall_offset} is non-zero, an additional adjustment should be made
 after adding @code{delta}.  In particular, if @var{p} is the
index b05a87dc2747e32868bf10fdbc19234bd81b9fd2..857aad7288325e91b019c09d9994cb73a5453bff 100644 (file)
@@ -121,11 +121,11 @@ struct gcc_target
     void (* destructor) PARAMS ((rtx, int));
 
     /* Output the assembler code for a thunk function.  */
-    void (* output_mi_thunk) PARAMS ((FILE *, tree, int, tree));
+    void (* output_mi_thunk) PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
 
     /* Output the assembler code for a thunk function with a vcall
        offset.  */
-    void (* output_mi_vcall_thunk) PARAMS ((FILE *, tree, int, int, tree));
+    void (* output_mi_vcall_thunk) PARAMS ((FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
   } asm_out;
 
   /* Functions relating to instruction scheduling.  */