[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:13:46 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121875
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by LuluCheng <chenglulu@gcc.gnu.org>:
https://gcc.gnu.org/g:d6ee89a65bd98b14940245ec79814ae3d38b0121
commit r16-4097-gd6ee89a65bd98b14940245ec79814ae3d38b0121
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.
More information about the Gcc-bugs
mailing list