> Since R10 is preserved when calling mcount, R10 can be used a scratch > register to call mcount in large model.
Please mention that R10 can be used as a static chain registers and is preserved when calling mcount for nested functions. > gcc/ > > PR target/98482 > * config/i386/i386.c (x86_function_profiler): Use R10 to call > mcount in large model. Sorry for large model with PIC. > > gcc/testsuite/ > > PR target/98482 > * gcc.target/i386/pr98482-1.c: New test. > * gcc.target/i386/pr98482-1.c: Likewise. OK with comment fixes. Thanks, Uros. + case CM_LARGE: + /* NB: R10 can be used as a scratch register here since + R10 is preserved when calling mcount. */ Also mention that R10 can be used as a static chain register and is preserved when calling mcount for nested functions. + fprintf (file, "1:\tmovabsq\t$%s, %%r10\n\tcall\t*%%r10\n", + mcount_name); + break;