]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: Do not inline when callee is versioned but caller is not.
authorLulu Cheng <chenglulu@loongson.cn>
Tue, 30 Sep 2025 12:26:02 +0000 (20:26 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Tue, 11 Nov 2025 07:33:38 +0000 (15:33 +0800)
gcc/ChangeLog:

* config/loongarch/loongarch.cc (loongarch_can_inline_p):
Do not inline when callee is versioned but caller is not.

gcc/config/loongarch/loongarch.cc

index 6d587049102bbabc96f7a16eb0ee4466aa55524e..1f29de5f6e16ef32385cd40f12b7dfa97229225e 100644 (file)
@@ -11383,6 +11383,10 @@ loongarch_compute_pressure_classes (reg_class *classes)
 static bool
 loongarch_can_inline_p (tree caller, tree callee)
 {
+  /* Do not inline when callee is versioned but caller is not.  */
+  if (DECL_FUNCTION_VERSIONED (callee) && ! DECL_FUNCTION_VERSIONED (caller))
+    return false;
+
   tree callee_tree = DECL_FUNCTION_SPECIFIC_TARGET (callee);
   tree caller_tree = DECL_FUNCTION_SPECIFIC_TARGET (caller);