diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-22 23:05:28 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-22 23:05:28 +0000 |
commit | eb344f43ef3115df9af589b4f2cac36f5de42bd7 (patch) | |
tree | 47bcdb93a39b44ac06fdc677f9265a5d43739759 /gcc/cp | |
parent | 3a9a09bbd4bd96e76e02bb0c36fd2988f0e39ae3 (diff) | |
download | gcc-eb344f43ef3115df9af589b4f2cac36f5de42bd7.tar.gz |
gcc/
* target.h (gcc_target.asm_out): Merge output_mi_thunk and
output_mi_vcall_thunk into a single hook. Add can_output_mi_thunk.
* target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Don't conditionalize.
(TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Remove.
(TARGET_ASM_CAN_OUTPUT_MI_THUNK): New.
(TARGET_ASM_OUT): Update.
* hooks.c (hook_bool_tree_hwi_hwi_tree_false): New.
(hook_bool_tree_hwi_hwi_tree_true): New.
(default_can_output_mi_thunk_no_vcall): New.
* hooks.h: Declare them.
* system.h (ASM_OUTPUT_MI_THUNK): Poison.
* config/alpha/alpha.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): New.
(alpha_output_mi_thunk_osf): Add VCALL_OFFSET parameter.
* config/arm/arm.c, config/cris/cris.c, config/frv/frv.c,
config/i960/i960.c, config/ia64/ia64.c, config/m68k/m68k.c,
config/mmix/mmix.c, config/pa/pa.c, config/sparc/sparc.c,
config/stormy16/stormy16.c: Similarly.
* config/i386/i386.c (x86_output_mi_thunk): Merge vcall_offset code.
Handle 64-bit properly. Streamline.
(x86_output_mi_vcall_thunk): Remove.
(x86_this_parameter): Rename from ia32_this_parameter; handle 64-bit.
(x86_can_output_mi_thunk): New.
(TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Remove.
(TARGET_ASM_CAN_OUTPUT_MI_THUNK): New.
(override_options): Don't zap targetm.asm_out.output_mi_vcall_thunk.
* config/rs6000/rs6000.c (rs6000_output_mi_thunk): Rename from
output_mi_thunk; make static; always use function_section.
(TARGET_ASM_OUTPUT_MI_THUNK): New.
(TARGET_ASM_CAN_OUTPUT_MI_THUNK): New.
(rs6000_ra_ever_killed): Test no_new_pseudos not
targetm.asm_out.output_mi_thunk in conjunction with thunks.
* config/rs6000/rs6000-protos.h: Update.
* config/rs6000/sysv4.h (TARGET_ASM_OUTPUT_MI_THUNK): Remove.
* config/rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Don't call
xcoffout_declare_function when using rs6000_output_mi_thunk.
* config/s390/s390.c (s390_output_mi_thunk): Rename from
s390_output_mi_vcall_thunk.
(TARGET_ASM_OUTPUT_MI_THUNK): Remove.
(TARGET_ASM_CAN_OUTPUT_MI_THUNK): New.
* config/vax/vax.c (vax_output_mi_thunk): Static; add vcall_offset.
(TARGET_ASM_OUTPUT_MI_THUNK, TARGET_ASM_CAN_OUTPUT_MI_THUNK): New.
* config/vax/vax-protos.h: Update.
* config/vax/vax.h (ASM_OUTPUT_MI_THUNK): Remove.
gcc/cp/
* method.c (use_thunk): Always compute vcall_value; assert that
it is not zero. Use can_output_mi_thunk; use output_mi_thunk
for vcall thunks as well.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58424 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/method.c | 35 |
2 files changed, 23 insertions, 18 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ed176188426..6f73ad911d1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2002-10-22 Richard Henderson <rth@redhat.com> + + * method.c (use_thunk): Always compute vcall_value; assert that + it is not zero. Use can_output_mi_thunk; use output_mi_thunk + for vcall thunks as well. + 2002-10-21 Mark Mitchell <mark@codesourcery.com> * class.c (empty_base_at_nonzero_offset_p): New function. diff --git a/gcc/cp/method.c b/gcc/cp/method.c index cb88833ab23..60a0dced611 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -361,7 +361,7 @@ use_thunk (thunk_fndecl, emit_p) tree fnaddr; tree function; tree vcall_offset; - HOST_WIDE_INT delta; + HOST_WIDE_INT delta, vcall_value; if (TREE_ASM_WRITTEN (thunk_fndecl)) return; @@ -387,6 +387,17 @@ use_thunk (thunk_fndecl, emit_p) delta = THUNK_DELTA (thunk_fndecl); vcall_offset = THUNK_VCALL_OFFSET (thunk_fndecl); + if (vcall_offset) + { + vcall_value = tree_low_cst (vcall_offset, /*pos=*/0); + + /* It is expected that a value of zero means no vcall. */ + if (!vcall_value) + abort (); + } + else + vcall_value = 0; + /* And, if we need to emit the thunk, it's used. */ mark_used (thunk_fndecl); /* This thunk is actually defined. */ @@ -409,8 +420,8 @@ use_thunk (thunk_fndecl, emit_p) BLOCK_VARS (DECL_INITIAL (thunk_fndecl)) = DECL_ARGUMENTS (thunk_fndecl); - if (targetm.asm_out.output_mi_vcall_thunk - || (targetm.asm_out.output_mi_thunk && !vcall_offset)) + if (targetm.asm_out.can_output_mi_thunk (thunk_fndecl, delta, + vcall_value, function)) { const char *fnname; current_function_decl = thunk_fndecl; @@ -420,22 +431,10 @@ use_thunk (thunk_fndecl, emit_p) init_function_start (thunk_fndecl, input_filename, lineno); current_function_is_thunk = 1; assemble_start_function (thunk_fndecl, fnname); - if (targetm.asm_out.output_mi_vcall_thunk) - { - 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, - function); - } - else - targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl, - delta, function); + targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl, delta, + vcall_value, function); + assemble_end_function (thunk_fndecl, fnname); current_function_decl = 0; cfun = 0; |