[Bug target/121875] LoongArch: Inlining A into B should be allowed if the target feature of A is a subset of B's
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 26 01:58:43 GMT 2025
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
<chenglulu@gcc.gnu.org>:
https://gcc.gnu.org/g:8ef56e12464ac3ae9b4df08d652e60874d886689
commit r15-10375-g8ef56e12464ac3ae9b4df08d652e60874d886689
Author: Lulu Cheng <chenglulu@loongson.cn>
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)
More information about the Gcc-bugs
mailing list