This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Numeric suffixes on symbols
- From: Ian Lance Taylor <iant at google dot com>
- To: morrell at alumni dot ucsd dot edu
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 30 Sep 2009 17:38:40 -0700
- Subject: Re: Numeric suffixes on symbols
- References: <418711.28709.qm@web112606.mail.gq1.yahoo.com>
Michael Morrell <morrell@alumni.ucsd.edu> writes:
> I'm building some code that I want to make sure produces the same bits each
> time. I ran into a case where the only difference between the result from
> two different compilation is the names of some of the symbols.
>
> For example, I may see the symbol name:
>
> __PRETTY_FUNCTION__.20638
>
> in the first build, and then:
>
> __PRETTY_FUNCTION__.20694
>
> in the second build.
>
> I can believe that gcc might need to generate a suffix to disambiguate
> function-scoped static variables with the same name, but I need it to do
> so in a deterministic fashion. Over a large code base, this only shows
> up a few times, so that seems strange.
>
> Can someone help to explain this or point me towards the place in the
> compiler where it is generating this suffix?
The number comes from DECL_UID in lhd_set_decl_assembler_name.
That should normally be fixed for a single compilation, but it is
likely affected by some compiler options.
Ian