From: Lulu Cheng Date: Tue, 30 Sep 2025 12:26:02 +0000 (+0800) Subject: LoongArch: Do not inline when callee is versioned but caller is not. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e112de41a5d765544cd31b847689859290e0b0a2;p=thirdparty%2Fgcc.git LoongArch: Do not inline when callee is versioned but caller is not. gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_can_inline_p): Do not inline when callee is versioned but caller is not. --- diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc index 6d587049102..1f29de5f6e1 100644 --- a/gcc/config/loongarch/loongarch.cc +++ b/gcc/config/loongarch/loongarch.cc @@ -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);