This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch Ping^2, C++] Move assemble_external call in cp/decl2.c.


On Fri, 2008-12-05 at 14:09 -0800, Mark Mitchell wrote:

> But, it seems like your patch is going to make us only call
> assemble_external for functions whose body we actually need, which seems
> contrary to the idea of assemble_external.  In varasm.c,
> assemble_external does:
> 
>    if (!DECL_P (decl) || !DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl))
>     return;
> 
> so won't the call in cp_write_global_declarations just be a no-op?
> 
> More broadly, in unit-at-a-time mode especially, why should the front
> end be involved in this at all?  It seems to me that we should be able
> to use cgraph to keep track of what functions we're actually going to
> reference, and then call assemble_external on all of them before
> actually emitting any code.

It looks like I can simply remove the call to assemble_external from
mark_used and everything still works fine, which means assemble_external
is still getting called when needed from somewhere else.  I tested on
IA64 HP-UX and PA HP-UX builds and got no regressions.  Both of these
platforms complain when there are global declarations for undefined
functions (or data).  While this patch removes one call to
assemble_external from the C++ front-end, there are still 3 others that
I did not touch as well as 5 in the objective C front-end.  While it
might be nice to get rid of these too I didn't think it would be
appropriate for Stage 3.

Is this patch OK for checkin?


2008-12-08  Steve Ellcey  <sje@cup.hp.com>

        * decl2.c (mark_used): Remove assemble_external call.


Index: decl2.c
===================================================================
--- decl2.c     (revision 142545)
+++ decl2.c     (working copy)
@@ -3849,8 +3849,6 @@ mark_used (tree decl)
       note_vague_linkage_fn (decl);
     }
 
-  assemble_external (decl);
-
   /* Is it a synthesized method that needs to be synthesized?  */
   if (TREE_CODE (decl) == FUNCTION_DECL
       && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]