https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121875
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by LuluCheng <[email protected]>: https://gcc.gnu.org/g:8ef56e12464ac3ae9b4df08d652e60874d886689 commit r15-10375-g8ef56e12464ac3ae9b4df08d652e60874d886689 Author: Lulu Cheng <[email protected]> Date: Wed Sep 24 14:49:53 2025 +0800 LoongArch: Implement TARGET_CAN_INLINE_P[PR121875]. Because LoongArch does not implement TARGET_CAN_INLINE_P, functions with the target attribute set and those without it cannot be inlined. At the same time, setting the always_inline attribute will cause compilation failure. To solve this problem, I implemented this hook. During the implementation process, it checks the status of the target special options of the caller and callee, such as the ISA extension. PR target/121875 gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_can_inline_p): New function. (TARGET_CAN_INLINE_P): Define. gcc/testsuite/ChangeLog: * gcc.target/loongarch/can_inline_1.c: New test. * gcc.target/loongarch/can_inline_2.c: New test. * gcc.target/loongarch/can_inline_3.c: New test. * gcc.target/loongarch/can_inline_4.c: New test. * gcc.target/loongarch/can_inline_5.c: New test. * gcc.target/loongarch/can_inline_6.c: New test. * gcc.target/loongarch/pr121875.c: New test. (cherry picked from commit d6ee89a65bd98b14940245ec79814ae3d38b0121)
