aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/i386/cygming.h5
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/method.c14
-rw-r--r--gcc/defaults.h10
-rw-r--r--gcc/doc/tm.texi8
6 files changed, 44 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dfda231..aafeafa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+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.
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index 00628f0..8502792 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -382,6 +382,11 @@ extern int i386_pe_dllimport_name_p (const char *);
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
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d1873a8a..bfb3191 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 10dfaca..49ba983 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -363,11 +363,10 @@ use_thunk (tree thunk_fndecl, bool emit_p)
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);
@@ -401,8 +400,8 @@ use_thunk (tree thunk_fndecl, bool emit_p)
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);
@@ -414,7 +413,6 @@ use_thunk (tree thunk_fndecl, bool emit_p)
DECL_SECTION_NAME (thunk_fndecl) = DECL_SECTION_NAME (function);
}
}
-#endif
/* The back-end expects DECL_INITIAL to contain a BLOCK, so we
create one. */
diff --git a/gcc/defaults.h b/gcc/defaults.h
index e4a6fae..9f261d0 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -484,6 +484,16 @@ do { fputs (integer_asm_op (POINTER_SIZE / BITS_PER_UNIT, TRUE), FILE); \
#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. */
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index b2fe858..230ee52 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -9209,3 +9209,11 @@ The parameter @var{path} is the include to register. On Darwin
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