aboutsummaryrefslogtreecommitdiff
path: root/gcc/targhooks.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-08-24 13:44:35 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-08-24 13:44:35 +0000
commit9b25e12d2d940a61ec97fdc3e5c1fe6060e159f8 (patch)
tree6b24e2669374d96abfb136318095097a99da7990 /gcc/targhooks.c
parent5d52d2c949fe6277fd1f31be8d6f48e1dae06652 (diff)
downloadgcc-9b25e12d2d940a61ec97fdc3e5c1fe6060e159f8.zip
gcc-9b25e12d2d940a61ec97fdc3e5c1fe6060e159f8.tar.gz
gcc-9b25e12d2d940a61ec97fdc3e5c1fe6060e159f8.tar.bz2
re PR target/81921 (Fails to always-inline intrinsics with -flto)
2017-08-23 Richard Biener <rguenther@suse.de> 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
Diffstat (limited to 'gcc/targhooks.c')
-rw-r--r--gcc/targhooks.c19
1 files changed, 5 insertions, 14 deletions
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,