diff options
author | Richard Henderson <rth@redhat.com> | 2002-10-23 10:55:56 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-10-23 10:55:56 -0700 |
commit | e23580688cbb529bbbb5ed691b65f01aba1945e0 (patch) | |
tree | 0dce4b5dcecda262471114ba3d6b64ec1cd74bf0 /gcc | |
parent | 8bcefb43ccfaf402c35312dd06c234e2ec975656 (diff) | |
download | gcc-e23580688cbb529bbbb5ed691b65f01aba1945e0.zip gcc-e23580688cbb529bbbb5ed691b65f01aba1945e0.tar.gz gcc-e23580688cbb529bbbb5ed691b65f01aba1945e0.tar.bz2 |
alpha.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): True.
* config/alpha/alpha.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): True.
(alpha_output_mi_thunk_osf): Handle vcall_offset.
* g++.dg/inherit/thunk1.C: Enable for s390 and alpha.
From-SVN: r58462
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/alpha/alpha.c | 35 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/inherit/thunk1.C | 2 |
4 files changed, 43 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1141063..20f3b34 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-10-23 Richard Henderson <rth@redhat.com> + + * config/alpha/alpha.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): True. + (alpha_output_mi_thunk_osf): Handle vcall_offset. + 2002-10-23 Zack Weinberg <zack@codesourcery.com> * langhooks.h (struct lang_hooks_for_tree_inlining): Add diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 5555aae..d6a9f6b 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -301,7 +301,7 @@ static void unicosmk_unique_section PARAMS ((tree, int)); #undef TARGET_ASM_OUTPUT_MI_THUNK #define TARGET_ASM_OUTPUT_MI_THUNK alpha_output_mi_thunk_osf #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK -#define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall +#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true #endif struct gcc_target targetm = TARGET_INITIALIZER; @@ -7866,7 +7866,7 @@ alpha_output_mi_thunk_osf (file, thunk_fndecl, delta, vcall_offset, function) FILE *file; tree thunk_fndecl ATTRIBUTE_UNUSED; HOST_WIDE_INT delta; - HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED; + HOST_WIDE_INT vcall_offset; tree function; { HOST_WIDE_INT hi, lo; @@ -7901,6 +7901,37 @@ alpha_output_mi_thunk_osf (file, thunk_fndecl, delta, vcall_offset, function) emit_insn (gen_adddi3 (this, this, tmp)); } + /* Add a delta stored in the vtable at VCALL_OFFSET. */ + if (vcall_offset) + { + rtx tmp, tmp2; + + tmp = gen_rtx_REG (Pmode, 0); + emit_move_insn (tmp, gen_rtx_MEM (Pmode, this)); + + lo = ((vcall_offset & 0xffff) ^ 0x8000) - 0x8000; + hi = (((vcall_offset - lo) & 0xffffffff) ^ 0x80000000) - 0x80000000; + if (hi + lo == vcall_offset) + { + if (hi) + emit_insn (gen_adddi3 (tmp, tmp, GEN_INT (hi))); + } + else + { + tmp2 = alpha_emit_set_long_const (gen_rtx_REG (Pmode, 1), + vcall_offset, -(vcall_offset < 0)); + emit_insn (gen_adddi3 (tmp, tmp, tmp2)); + lo = 0; + } + if (lo) + tmp2 = gen_rtx_PLUS (Pmode, tmp, GEN_INT (lo)); + else + tmp2 = tmp; + emit_move_insn (tmp, gen_rtx_MEM (Pmode, tmp2)); + + emit_insn (gen_adddi3 (this, this, tmp)); + } + /* Generate a tail call to the target function. */ if (! TREE_USED (function)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8635fdc..e79e4b5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-10-23 Richard Henderson <rth@redhat.com> + + * g++.dg/inherit/thunk1.C: Enable for s390 and alpha. + 2002-10-22 Mark Mitchell <mark@codesourcery.com> PR c++/6579 diff --git a/gcc/testsuite/g++.dg/inherit/thunk1.C b/gcc/testsuite/g++.dg/inherit/thunk1.C index 0c9919a..4dd05c9 100644 --- a/gcc/testsuite/g++.dg/inherit/thunk1.C +++ b/gcc/testsuite/g++.dg/inherit/thunk1.C @@ -1,4 +1,4 @@ -// { dg-do run { target i?86-*-* } } +// { dg-do run { target i?86-*-* s390*-*-* alpha*-*-* } } #include <stdarg.h> |