method.c (implicitly_declare_fn): Don't call defer_fn; abort if it might be needed.
authorGeoffrey Keating <geoffk@apple.com>
Mon, 24 May 2004 21:07:42 +0000 (21:07 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Mon, 24 May 2004 21:07:42 +0000 (21:07 +0000)
* 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

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/cp/method.c
gcc/cp/pt.c

index 34db8d64712d619e7ec3dcf9dd6cb7e921dc3fd0..b2792808dbca8a9749f000277cf815370c9231bf 100644 (file)
@@ -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).
index dfe4b0d2e283d9bb832a5a893ee25ec70ef0c151..7f9e000f66324534a8ce15e9676b6f8acfc8602e 100644 (file)
@@ -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))
index efd0e06269cc57b99f119469b731550cff40b203..4920c541152b38bc87ca1ec27ee5f2afaeaeb321 100644 (file)
@@ -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;
 }
index 38c91a0e188fc90854fde9e65bece2c624df92b2..14a6788cc2772073e67e590e05834a79a61ff6e3 100644 (file)
@@ -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);
 }