From 9b25e12d2d940a61ec97fdc3e5c1fe6060e159f8 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 24 Aug 2017 13:44:35 +0000 Subject: re PR target/81921 (Fails to always-inline intrinsics with -flto) 2017-08-23 Richard Biener PR target/81921 * targhooks.c (default_target_can_inline_p): Properly use target_option_default_node when no DECL_FUNCTION_SPECIFIC_TARGET is present and always compare. * config/i386/i386.c (ix86_valid_target_attribute_tree): Do not imply -mfpmath=sse from TARGET_SSE_P. (ix86_can_inline_p): Properly use target_option_default_node when no DECL_FUNCTION_SPECIFIC_TARGET is present and always compare. * gcc.target/i386/pr81921.c: New testcase. From-SVN: r251333 --- gcc/targhooks.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'gcc/targhooks.c') diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 6a8fae6..2adabcd 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -1442,27 +1442,18 @@ default_target_option_pragma_parse (tree ARG_UNUSED (args), bool default_target_can_inline_p (tree caller, tree callee) { - bool ret = false; tree callee_opts = DECL_FUNCTION_SPECIFIC_TARGET (callee); tree caller_opts = DECL_FUNCTION_SPECIFIC_TARGET (caller); - - /* If callee has no option attributes, then it is ok to inline */ - if (!callee_opts) - ret = true; - - /* If caller has no option attributes, but callee does then it is not ok to - inline */ - else if (!caller_opts) - ret = false; + if (! callee_opts) + callee_opts = target_option_default_node; + if (! caller_opts) + caller_opts = target_option_default_node; /* If both caller and callee have attributes, assume that if the pointer is different, the two functions have different target options since build_target_option_node uses a hash table for the options. */ - else - ret = (callee_opts == caller_opts); - - return ret; + return callee_opts == caller_opts; } /* If the machine does not have a case insn that compares the bounds, -- cgit v1.1