https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113689
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #9)
> Like this?
>
> diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
> index f02c6c02ac6..ed0b0e19985 100644
> --- a/gcc/config/i386/i386.cc
> +++ b/gcc/config/i386/i386.cc
> @@ -22785,10 +22785,10 @@ x86_64_select_profile_regnum (bool r11_ok
> ATTRIBUTE_UNUSED)
> && !REGNO_REG_SET_P (reg_live, i))))
> return i;
>
> - sorry ("no register available for profiling %<-mcmodel=large%s%>",
> + sorry ("no register available for profiling %<-mcmodel=large%s%>, use
> r10",
> ix86_cmodel == CM_LARGE_PIC ? " -fPIC" : "");
>
> - return INVALID_REGNUM;
> + return R10_REG;
> }
>
> /* Output assembler code to FILE to increment profiler label # LABELNO
Just the second hunk. I think with sorry call the compilation fails, so what
you actually emit doesn't matter (one can see it with -pipe, sure).