On Tue, Nov 12, 2013 at 7:54 AM, Steven Bosscher <stevenb....@gmail.com> wrote: > On Tue, Nov 12, 2013 at 3:49 PM, Teresa Johnson wrote: >>> Is there a format for compiler-defined labels that would not be able >>> to clash with other user-generated labels? >> >> My understanding is that the "." in the generated name ensures that it >> will not clash with user-generated labels which cannot contain ".". So >> this should not be an issue. > > Is that true for all languages? I don't think we can make that > assumption. Also, there may be clashes with other compiler generated > symbols. I know of at least one Fortran compiler that composes names > for module symbols as "modulename.symbolname", and if symbolname is > "cold" then you can have a clash.
Can we use a language hook to decide what label is kosher for that language and use the "." suffixed label for c,c++? Also, other passes that clone functions seem to be doing something similar, like isra. Function multiversioning too uses ".<target-name>" to disambiguate asm names of versioned functions. For c++, c++filt already does a good job of demangling symbols with "." suffixes. For instance "_Z3foov.cold" demangles to "foo() [clone .cold]" which seems perfect for our purposes. Thanks, Sri > > Ciao! > Steven