https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119327
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, the difference that precludes inlining is OPTION_MASK_SAVE_TOC_INDIRECT.
This is set conditionally based on
/* If we can shrink-wrap the TOC register save separately, then use
-msave-toc-indirect unless explicitly disabled. */
if ((rs6000_isa_flags_explicit & OPTION_MASK_SAVE_TOC_INDIRECT) == 0
&& flag_shrink_wrap_separate
&& optimize_function_for_speed_p (cfun))
rs6000_isa_flags |= OPTION_MASK_SAVE_TOC_INDIRECT;
where optimize_function_for_speed_p depends not just on -Os/-Oz vs. other
options, but also whether it is cold or not etc., so failing inlining because
of this doesn't make any sense to me. Although in rs6000_isa_flags, it doesn't
feel like this is an ISA flag but just an optimization hint.