]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Implement TARGET_CAN_INLINE_P[PR121875].
authorLulu Cheng <chenglulu@loongson.cn>
Wed, 24 Sep 2025 06:49:53 +0000 (14:49 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Fri, 26 Sep 2025 01:13:18 +0000 (09:13 +0800)
commitd6ee89a65bd98b14940245ec79814ae3d38b0121
tree004387919ea6b394f37b4950f68ad07bffcedc1d
parent11a662dd8bc2d6fb28c584104a1fdd17e78701ae
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.
gcc/config/loongarch/loongarch.cc
gcc/testsuite/gcc.target/loongarch/can_inline_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/loongarch/can_inline_2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/loongarch/can_inline_3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/loongarch/can_inline_4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/loongarch/can_inline_5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/loongarch/can_inline_6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/loongarch/pr121875.c [new file with mode: 0644]