+2004-04-08 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR c++/14808
+ * defaults.h (TARGET_USE_LOCAL_THUNK_ALIAS_P): New macro. Default
+ to 1 if ASM_OUTPUT_DEF is defined.
+ * doc/tm.texi (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document.
+ * config/i386/cygming.h (TARGET_USE_LOCAL_THUNK_ALIAS_P): Define.
+ Set to non-zero iff not a one_only decl.
+
2004-04-08 Paul Brook <paul@codesourcery.com>
* arm.h (CLASS_LIKELY_SPILLED_P): Define.
ASM_OUTPUT_DEF (STREAM, alias, IDENTIFIER_POINTER (TARGET)); \
} while (0)
+/* Decide whether it is safe to use a local alias for a virtual function
+ when constructing thunks. */
+#undef TARGET_USE_LOCAL_THUNK_ALIAS_P
+#define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) (!DECL_ONE_ONLY (DECL))
+
#undef TREE
#ifndef BUFSIZ
+2004-04-08 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR c++/14808
+ * method.c (use_thunk): Test TARGET_USE_LOCAL_THUNK_ALIAS_P rather
+ than ASM_OUTPUT_DEF.
+
2004-04-08 Jakub Jelinek <jakub@redhat.com>
* decl2.c (mark_used): Don't segfault if cfun != NULL but
if (!emit_p)
return;
-#ifdef ASM_OUTPUT_DEF
- alias = make_alias_for_thunk (function);
-#else
- alias = function;
-#endif
+ if (TARGET_USE_LOCAL_THUNK_ALIAS_P (function))
+ alias = make_alias_for_thunk (function);
+ else
+ alias = function;
fixed_offset = THUNK_FIXED_OFFSET (thunk_fndecl);
virtual_offset = THUNK_VIRTUAL_OFFSET (thunk_fndecl);
push_to_top_level ();
-#ifdef ASM_OUTPUT_DEF
- if (targetm.have_named_sections)
+ if (TARGET_USE_LOCAL_THUNK_ALIAS_P (function)
+ && targetm.have_named_sections)
{
resolve_unique_section (function, 0, flag_function_sections);
DECL_SECTION_NAME (thunk_fndecl) = DECL_SECTION_NAME (function);
}
}
-#endif
/* The back-end expects DECL_INITIAL to contain a BLOCK, so we
create one. */
#define TARGET_VTABLE_DATA_ENTRY_DISTANCE 1
#endif
+/* Decide whether it is safe to use a local alias for a virtual function
+ when constructing thunks. */
+#ifndef TARGET_USE_LOCAL_THUNK_ALIAS_P
+#ifdef ASM_OUTPUT_DEF
+#define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 1
+#else
+#define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 0
+#endif
+#endif
+
/* Select a format to encode pointers in exception handling data. We
prefer those that result in fewer dynamic relocations. Assume no
special support here and encode direct references. */
systems, this is used for Framework includes, which have semantics
that are different from @option{-I}.
@end deftypefn
+
+@deftypefn {Target Hook} bool TARGET_USE_LOCAL_THUNK_ALIAS_P (tree @var{fndecl})
+This target hook returns @code{true} if it is safe to use a local alias
+for a virtual function @var{fndecl} when constructing thunks,
+@code{false} otherwise. By default, the hook returns @code{true} for all
+functions, if a target supports aliases (ie. defines
+@code{ASM_OUTPUT_DEF}), @code{false} otherwise,
+@end deftypefn