This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81921] New: Fails to always-inline intrinsics with -flto
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 22 Aug 2017 09:57:01 +0000
- Subject: [Bug target/81921] New: Fails to always-inline intrinsics with -flto
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81921
Bug ID: 81921
Summary: Fails to always-inline intrinsics with -flto
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Keywords: lto, rejects-valid
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
Target: x86_64-*-*, i?86-*-*
With -flto free_lang_data forces a DECL_FUNCTION_SPECIFIC_TARGET node if not
set
(target_option_default_node). The way ix86_can_inline_p works this causes
behavioral differences for
extern __inline int __attribute__((__gnu_inline__, __always_inline__,
__artificial__, target("sse2")))
_mm_loadu_si128 (int const *__P)
{
return *__P;
}
void __attribute__((target("ssse3"))) foo (void *p)
{
volatile int x = _mm_loadu_si128 (p);
}
with -m32 vs. -m32 -flto. The following fixes it (and allows free-lang-data
to be turned on unconditionally).
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 251266)
+++ config/i386/i386.c (working copy)
@@ -7507,12 +7507,12 @@ ix86_can_inline_p (tree caller, tree cal
tree callee_tree = DECL_FUNCTION_SPECIFIC_TARGET (callee);
/* If callee has no option attributes, then it is ok to inline. */
- if (!callee_tree)
+ if (!callee_tree || callee_tree == target_option_default_node)
ret = true;
/* If caller has no option attributes, but callee does then it is not ok to
inline. */
- else if (!caller_tree)
+ else if (!caller_tree && caller_tree != target_option_default_node)
ret = false;
else