: and < are not valid characters for assemblers. See MCAsmInfo::isValidUnquotedName in MCAsmInfo.cpp and method llvm::printLLVMNameWithoutPrefix in AsmWriter.cpp.
Because this, when the such symbols names emitted in .s file will be quoted which will also upset the assembler.
To reproduce the problem, simply build the following source with option -fprofile-instr-generate -c -no-integrated-as:
static int cmp(int a, int b)
{
return a > b;
}
extern int foo(int (*)(int, int));
int bar()
{
return foo(cmp);
}
However there is a downside of this fix -- this is not a backward compatible fix -- once the fix is in, the old version of the indexed profile can not be guaranteed to be usable again (only partially usable) -- the static function's profile data will be dropped (can not be found anymore).
Need more opinion on the impact of partially breaking the old version of indexed format.