https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119327

--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:4b62cf555b5446cb02fc471519cf1afa09e1a108

commit r16-88-g4b62cf555b5446cb02fc471519cf1afa09e1a108
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Tue Apr 22 21:27:28 2025 +0200

    rs6000: Ignore OPTION_MASK_SAVE_TOC_INDIRECT differences in inlining
decisions [PR119327]

    The following testcase FAILs because the always_inline function can't
    be inlined.
    The rs6000 backend has similarly to other targets a hook which rejects
    inlining which would bring in new ISAs which aren't there in the caller.
    And this hook rejects this because of OPTION_MASK_SAVE_TOC_INDIRECT
    differences.
    This flag is set if explicitly requested or by default depending on
    whether the current function looks hot (or at least not cold):
      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;
    The target nodes that are being compared here are actually the default
    target node (which was created when cfun was NULL) vs. one that was
    created for the always_inline function when it wasn't NULL, so one
    doesn't have it, the other does.
    In any case, this flag feels like a tuning decision rather than hard
    ISA requirement and I see no problems why we couldn't inline
    even explicit -msave-toc-indirect function into -mno-save-toc-indirect
    or vice versa.
    We already ignore OPTION_MASK_P{8,10}_FUSION which are also more
    like tuning flags.

    2025-04-22  Jakub Jelinek  <ja...@redhat.com>

            PR target/119327
            * config/rs6000/rs6000.cc (rs6000_can_inline_p): Ignore also
            OPTION_MASK_SAVE_TOC_INDIRECT differences.

            * g++.dg/opt/pr119327.C: New test.

Reply via email to