[PATCH/RFC] Mark __asm__ identifiers as referenced in varasm.c

Geoffrey Keating geoffk@apple.com
Thu Jul 27 23:13:00 GMT 2006


Mark Mitchell <mark@codesourcery.com> writes:

> Mike Stump wrote:
> > On Jul 6, 2006, at 5:54 PM, Mark Mitchell wrote:
> >> In my opinion, the problem here is the whole idea that varasm marks a
> >> name as referenced, rather than a declaration.  What I think should
> >> happen is that assemble_name should track back from the SYMBOL_REF to
> >> the FUNCTION_DECL, and mark that as referenced.  From there it's easy to
> >> get the DECL_ASSEMBLER_NAME, which is (supposed to be) the name that
> >> matters.
> > 
> > But, the parameter to assemble_name is just that?
> 
> Yes, and that's what's wrong.  Why throw away the information to which
> the name refers?  We should replace assemble_name with
> assemble_decl_name (taking a DECL), and then, for callers that really
> don't have anything to which to refer, call assemble_name_raw instead.
> Note that this would probably make the compiler faster by avoiding
> assemble_name's hashing every name to see if it might refer to something.

Yes, this would make a reasonable improvement (I've seen the hash
lookup in assemble_name many times in profile output).



More information about the Gcc-patches mailing list