summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-20 18:52:01 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-20 18:52:01 +0000
commite7f5e241df9fc5ef1f5f615ddf1eaf5b3b004bc8 (patch)
treef987337a20b33d008b269c7740dfb4a88ae59e1f
parent7dba12f5a27190f6ef4f6b8975d1a0b32717d95b (diff)
downloadppe42-gcc-e7f5e241df9fc5ef1f5f615ddf1eaf5b3b004bc8.tar.gz
ppe42-gcc-e7f5e241df9fc5ef1f5f615ddf1eaf5b3b004bc8.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58333 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog44
-rw-r--r--gcc/config/alpha/alpha-protos.h3
-rw-r--r--gcc/config/alpha/alpha.c9
-rw-r--r--gcc/config/alpha/vms.h2
-rw-r--r--gcc/config/arm/arm-protos.h2
-rw-r--r--gcc/config/arm/arm.c2
-rw-r--r--gcc/config/cris/cris-protos.h2
-rw-r--r--gcc/config/cris/cris.c20
-rw-r--r--gcc/config/d30v/d30v.h2
-rw-r--r--gcc/config/frv/frv-protos.h3
-rw-r--r--gcc/config/frv/frv.c12
-rw-r--r--gcc/config/frv/frv.h12
-rw-r--r--gcc/config/i386/i386-protos.h4
-rw-r--r--gcc/config/i386/i386.c6
-rw-r--r--gcc/config/i386/openbsd.h2
-rw-r--r--gcc/config/i960/i960-protos.h2
-rw-r--r--gcc/config/i960/i960.c2
-rw-r--r--gcc/config/i960/i960.h2
-rw-r--r--gcc/config/ia64/ia64-protos.h2
-rw-r--r--gcc/config/ia64/ia64.c2
-rw-r--r--gcc/config/m68k/m68k-protos.h2
-rw-r--r--gcc/config/m68k/m68k.c12
-rw-r--r--gcc/config/m68k/openbsd.h6
-rw-r--r--gcc/config/mmix/mmix-protos.h2
-rw-r--r--gcc/config/mmix/mmix.c8
-rw-r--r--gcc/config/pa/pa-protos.h2
-rw-r--r--gcc/config/rs6000/rs6000-protos.h2
-rw-r--r--gcc/config/rs6000/rs6000.c13
-rw-r--r--gcc/config/s390/s390-protos.h2
-rw-r--r--gcc/config/s390/s390.c2
-rw-r--r--gcc/config/sparc/openbsd.h4
-rw-r--r--gcc/config/stormy16/stormy16-protos.h2
-rw-r--r--gcc/config/stormy16/stormy16.c4
-rw-r--r--gcc/config/vax/vax-protos.h2
-rw-r--r--gcc/config/vax/vax.c6
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/method.c9
-rw-r--r--gcc/cp/optimize.c4
-rw-r--r--gcc/doc/tm.texi4
-rw-r--r--gcc/target.h4
40 files changed, 142 insertions, 89 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 06c5603687c..871011a429d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/alpha/alpha-protos.h b/gcc/config/alpha/alpha-protos.h
index e52e4f461bc..92b6d5544c7 100644
--- a/gcc/config/alpha/alpha-protos.h
+++ b/gcc/config/alpha/alpha-protos.h
@@ -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,
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 4e491377ca2..b6bcc324ab3 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -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;
diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h
index f1b8884df26..8df61564e72 100644
--- a/gcc/config/alpha/vms.h
+++ b/gcc/config/alpha/vms.h
@@ -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
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index eac8dbbbb41..d1fd43b39c7 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -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));
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 6971a53b2d9..fa046e10860 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -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;
diff --git a/gcc/config/cris/cris-protos.h b/gcc/config/cris/cris-protos.h
index 4db5a2a54b4..a86ae714bd8 100644
--- a/gcc/config/cris/cris-protos.h
+++ b/gcc/config/cris/cris-protos.h
@@ -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
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 7edd8bd1916..4128742a5bc 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -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)
{
diff --git a/gcc/config/d30v/d30v.h b/gcc/config/d30v/d30v.h
index dc0ac209975..32cff3c2bb5 100644
--- a/gcc/config/d30v/d30v.h
+++ b/gcc/config/d30v/d30v.h
@@ -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. */
diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h
index c3f13f5772d..5965c58b295 100644
--- a/gcc/config/frv/frv-protos.h
+++ b/gcc/config/frv/frv-protos.h
@@ -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
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index a49b1572669..39a1cd77b98 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -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);
}
diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h
index 8fc43a46879..f8c2755f1c3 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -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
-
/* Layout of Source Language Data Types. */
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index c3b7c308349..b38a65ac7dc 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -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
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 11602573dd4..299bd826326 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -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,
diff --git a/gcc/config/i386/openbsd.h b/gcc/config/i386/openbsd.h
index 8f54026539b..b792450d1f7 100644
--- a/gcc/config/i386/openbsd.h
+++ b/gcc/config/i386/openbsd.h
@@ -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 ";#"
diff --git a/gcc/config/i960/i960-protos.h b/gcc/config/i960/i960-protos.h
index b7b74dc0130..594e07dd190 100644
--- a/gcc/config/i960/i960-protos.h
+++ b/gcc/config/i960/i960-protos.h
@@ -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 *));
diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c
index fe38d45c5a2..40717783d55 100644
--- a/gcc/config/i960/i960.c
+++ b/gcc/config/i960/i960.c
@@ -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;
diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h
index 11932e967f8..ac24ece0fa9 100644
--- a/gcc/config/i960/i960.h
+++ b/gcc/config/i960/i960.h
@@ -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
diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h
index 6efb266a83b..c4a43cc0308 100644
--- a/gcc/config/ia64/ia64-protos.h
+++ b/gcc/config/ia64/ia64-protos.h
@@ -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,
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 5fa9927f157..2b74f433e5b 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -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))
diff --git a/gcc/config/m68k/m68k-protos.h b/gcc/config/m68k/m68k-protos.h
index 33accb90b7f..3beec986ae4 100644
--- a/gcc/config/m68k/m68k-protos.h
+++ b/gcc/config/m68k/m68k-protos.h
@@ -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));
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 8a1a7292838..f5fb6cf829f 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -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)
{
diff --git a/gcc/config/m68k/openbsd.h b/gcc/config/m68k/openbsd.h
index 666350f8bb2..8d62bdd6fd1 100644
--- a/gcc/config/m68k/openbsd.h
+++ b/gcc/config/m68k/openbsd.h
@@ -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); \
diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h
index e8ef95e9895..0328df183d3 100644
--- a/gcc/config/mmix/mmix-protos.h
+++ b/gcc/config/mmix/mmix-protos.h
@@ -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
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index be1d25ef4de..e79e873f316 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -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);
diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h
index 89942f5c2d6..bbdd6891e4b 100644
--- a/gcc/config/pa/pa-protos.h
+++ b/gcc/config/pa/pa-protos.h
@@ -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. */
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index 7dc0f9f7742..08540e37348 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -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' */
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 73b8db111ef..dcee67b020a 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -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
diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h
index a906d446333..c85349df546 100644
--- a/gcc/config/s390/s390-protos.h
+++ b/gcc/config/s390/s390-protos.h
@@ -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 */
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index f7404bc7ba7..420912787fd 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -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)
diff --git a/gcc/config/sparc/openbsd.h b/gcc/config/sparc/openbsd.h
index 96d2f149a72..1a53cd14d0e 100644
--- a/gcc/config/sparc/openbsd.h
+++ b/gcc/config/sparc/openbsd.h
@@ -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 */
diff --git a/gcc/config/stormy16/stormy16-protos.h b/gcc/config/stormy16/stormy16-protos.h
index dc58871a573..9f2ea2cabab 100644
--- a/gcc/config/stormy16/stormy16-protos.h
+++ b/gcc/config/stormy16/stormy16-protos.h
@@ -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
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 62b8656730d..58d7ae418a5 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -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);
diff --git a/gcc/config/vax/vax-protos.h b/gcc/config/vax/vax-protos.h
index 928a2ab6554..68723086f08 100644
--- a/gcc/config/vax/vax-protos.h
+++ b/gcc/config/vax/vax-protos.h
@@ -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 *));
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 35718813f3e..43ad73cdece 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -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");
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8a7eec83657..bbe1ae8f9f6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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-
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 5d14f57e7f3..cb88833ab23 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -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,
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 0910bef6e12..6fbcc2be192 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -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);
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 74231e255ea..5ca0836de07 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -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
diff --git a/gcc/target.h b/gcc/target.h
index b05a87dc274..857aad72883 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -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. */
OpenPOWER on IntegriCloud