This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH: Fix thunk problem
- To: gcc-patches at gcc dot gnu dot org
- Subject: C++ PATCH: Fix thunk problem
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Thu, 26 Apr 2001 22:07:49 -0700
- Organization: CodeSourcery, LLC
This bug fixes a C++ regression on Alpha. GNATS is down at the
moment, so I can't reference the PR number, but I'll close it when
GNATS comes back up.
The basic problem was that even when EMIT_THUNK was non-zero,
use_thunk sometimes didn't actually emit the thunk.
Tested on i686-pc-linux-gnu, and by visually inspecting the alpha
test-case.
Installed on the mainline and on the branch.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
2001-04-26 Mark Mitchell <mark@codesourcery.com>
* method.c (use_thunk): Make sure that thunks really are emitted
when requested.
Index: method.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/method.c,v
retrieving revision 1.190.2.10
diff -c -p -r1.190.2.10 method.c
*** method.c 2001/04/26 19:41:29 1.190.2.10
--- method.c 2001/04/27 04:47:02
*************** make_thunk (function, delta, vcall_index
*** 377,383 ****
return thunk;
}
! /* Emit the definition of a C++ multiple inheritance vtable thunk. */
void
use_thunk (thunk_fndecl, emit_p)
--- 377,384 ----
return thunk;
}
! /* Emit the definition of a C++ multiple inheritance vtable thunk. If
! EMIT_P is non-zero, the thunk is emitted immediately. */
void
use_thunk (thunk_fndecl, emit_p)
*************** use_thunk (thunk_fndecl, emit_p)
*** 519,524 ****
--- 520,530 ----
DECL_INITIAL (thunk_fndecl) = make_node (BLOCK);
BLOCK_VARS (DECL_INITIAL (thunk_fndecl))
= DECL_ARGUMENTS (thunk_fndecl);
+
+ /* Since we want to emit the thunk, we explicitly mark its name as
+ referenced. */
+ TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (thunk_fndecl)) = 1;
+
expand_body (finish_function (0));
}