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

Steve Ellcey sje@cup.hp.com
Mon Dec 8 19:19:00 GMT 2008


On Mon, 2008-12-08 at 10:42 -0800, Mark Mitchell wrote:
> Steve Ellcey wrote:
> 
> > 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 think we need to figure out where that something else is.  Your
> empirical evidence (on HP-UX) certainly suggests that this call is
> unnecessary, but I'd like to understand what is making sure that we call
> assemble_external for a reference to a global function not defined in
> the current translation unit.
> 
> Once we understand that, the patch is probably OK; certainly, it would
> be nice to reduce the presence of this kind of thing in the front ends.
> 
> Thanks,

It looks like it is getting called twice from final.  For a call to an
externally declared function we call assemble_external twice from final,
first via final_scan_insn (final -> final_scan_insn ->
assemble_external) and then we call it again from from
mark_symbol_ref_as_used (final -> final_scan_insn -> output_asm_insn ->
output_operand -> for_each_rtx -> mark_symbol_ref_as_used ->
assemble_external).

Steve Ellcey
sje@cup.hp.com



More information about the Gcc-patches mailing list