https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63534
--- Comment #4 from Stupachenko Evgeny <evstupac at gmail dot com> ---
Profiling implementation has hard coded "%ebx" use.
There are at least 2 quick solutions to resolve this:
1. Disable the changes for PIC profiling
Lead to different behavior with and without profiling of code with EBX asm
insertions. However could be applied as temporary solution as there are no EBX
asm insertions right now.
2.
print:
push %ebx
call __x86.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
and pop %ebx at the end
Here:
else if (flag_pic)
{
#ifndef NO_PROFILE_COUNTERS
fprintf (file, "\tleal\t%sP%d@GOTOFF(%%ebx),%%" PROFILE_COUNT_REGISTER
"\n",
LPREFIX, labelno);
#endif
fprintf (file, "1:\tcall\t*%s@GOT(%%ebx)\n", mcount_name);
}
Lower profiling performance in PIC mode.
I vote for the second solution and can prepare patch for this.