diff options
author | Geoffrey Keating <geoffk@apple.com> | 2004-05-24 21:07:42 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2004-05-24 21:07:42 +0000 |
commit | bf2774382d22d4f842c0a581cbb296f8b1984d49 (patch) | |
tree | 12fe4051c3fd2802ff193d818d68ee45ed61ffd8 | |
parent | a668adb2f3bbe7e4b6f6aee2ca721b8e466d2ee7 (diff) | |
download | gcc-bf2774382d22d4f842c0a581cbb296f8b1984d49.zip gcc-bf2774382d22d4f842c0a581cbb296f8b1984d49.tar.gz gcc-bf2774382d22d4f842c0a581cbb296f8b1984d49.tar.bz2 |
method.c (implicitly_declare_fn): Don't call defer_fn; abort if it might be needed.
* method.c (implicitly_declare_fn): Don't call defer_fn; abort
if it might be needed.
* pt.c (mark_decl_instantiated): Only call defer_fn if
the function actually needs processing in finish_file.
* decl2.c (finish_file): Add check that elements in
deferred_fns_used are really needed there. Remove unnecessary
test of DECL_SAVED_TREE.
From-SVN: r82217
-rw-r--r-- | gcc/cp/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 10 | ||||
-rw-r--r-- | gcc/cp/method.c | 3 | ||||
-rw-r--r-- | gcc/cp/pt.c | 4 |
4 files changed, 22 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 34db8d6..b279280 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +2004-05-24 Geoffrey Keating <geoffk@apple.com> + + * method.c (implicitly_declare_fn): Don't call defer_fn; abort + if it might be needed. + * pt.c (mark_decl_instantiated): Only call defer_fn if + the function actually needs processing in finish_file. + * decl2.c (finish_file): Add check that elements in + deferred_fns_used are really needed there. Remove unnecessary + test of DECL_SAVED_TREE. + 2004-05-23 Paolo Bonzini <bonzini@gnu.org> * Make-lang.in: No need to specify $(LIBCPP). diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index dfe4b0d..7f9e000 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2749,9 +2749,14 @@ finish_file (void) calling import_export_decl will make an inline template instantiation "static", which will result in errors about the use of undefined functions if there is no body for - the function. */ + the function. In fact, all the functions in this list + *should* have a body. */ if (!DECL_SAVED_TREE (decl)) - continue; + { + if (! DECL_DECLARED_INLINE_P (decl) || ! TREE_USED (decl)) + abort (); + continue; + } import_export_decl (decl); @@ -2776,7 +2781,6 @@ finish_file (void) gotten around to synthesizing yet.) */ if (!DECL_EXTERNAL (decl) && DECL_NEEDED_P (decl) - && DECL_SAVED_TREE (decl) && !TREE_ASM_WRITTEN (decl) && (!flag_unit_at_a_time || !cgraph_node (decl)->local.finalized)) diff --git a/gcc/cp/method.c b/gcc/cp/method.c index efd0e06..4920c54 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -1027,7 +1027,8 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p) DECL_NOT_REALLY_EXTERN (fn) = 1; DECL_DECLARED_INLINE_P (fn) = 1; DECL_INLINE (fn) = 1; - defer_fn (fn); + if (TREE_USED (fn)) + abort (); return fn; } diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 38c91a0..14a6788 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -10161,7 +10161,9 @@ mark_decl_instantiated (tree result, int extern_p) maybe_make_one_only (result); } - if (TREE_CODE (result) == FUNCTION_DECL) + if (TREE_CODE (result) == FUNCTION_DECL + && (DECL_ARTIFICIAL (result) + || (DECL_DECLARED_INLINE_P (result) && TREE_USED (result)))) defer_fn (result); } |