https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102059
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |meissner at linux dot ibm.com --- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> --- About the non-LTO mode, the rs6000_can_inline_p succeeds due to: /* If the callee has no option attributes, then it is ok to inline. */ if (!callee_tree) ret = true; This is not correct in my opinion, please see i386.c: static bool ix86_can_inline_p (tree caller, tree callee) { ... if (!callee_tree) callee_tree = target_option_default_node; if (!caller_tree) caller_tree = target_option_default_node; ... So I think the following should be applied: diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index e073b26b430..4a997b0cabc 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -25036,9 +25036,8 @@ rs6000_can_inline_p (tree caller, tree callee) tree caller_tree = DECL_FUNCTION_SPECIFIC_TARGET (caller); tree callee_tree = DECL_FUNCTION_SPECIFIC_TARGET (callee); - /* If the callee has no option attributes, then it is ok to inline. */ if (!callee_tree) - ret = true; + callee_tree = target_option_default_node; else {